static double pango_font_green;
static double pango_font_blue;
-/* Necessary to track whether the dpi changes and trigger a LOG() message,
- * which is more easily visible to users. */
-static double logged_dpi = 0.0;
-
static PangoLayout *create_layout_with_dpi(cairo_t *cr) {
PangoLayout *layout;
PangoContext *context;
context = pango_cairo_create_context(cr);
- const double dpi = (double)root_screen->height_in_pixels * 25.4 /
- (double)root_screen->height_in_millimeters;
- if (logged_dpi != dpi) {
- logged_dpi = dpi;
- LOG("X11 root window dictates %f DPI\n", dpi);
- } else {
- DLOG("X11 root window dictates %f DPI\n", dpi);
- }
- pango_cairo_context_set_resolution(context, dpi);
+ pango_cairo_context_set_resolution(context, get_dpi_value());
layout = pango_layout_new(context);
g_object_unref(context);
/* Free the font description */
pango_font_description_free(savedFont->specific.pango_desc);
break;
- default:
- assert(false);
- break;
}
savedFont = NULL;
pango_font_green = foreground.green;
pango_font_blue = foreground.blue;
break;
- default:
- assert(false);
- break;
}
}
draw_text_pango(i3string_as_utf8(text), i3string_get_num_bytes(text),
drawable, visual, x, y, max_width, i3string_is_markup(text));
return;
- default:
- assert(false);
}
}
draw_text_pango(text, strlen(text),
drawable, root_visual_type, x, y, max_width, false);
return;
- default:
- assert(false);
}
}
/* Calculate extents using Pango */
return predict_text_width_pango(i3string_as_utf8(text), i3string_get_num_bytes(text),
i3string_is_markup(text));
- default:
- assert(false);
- return 0;
}
+ assert(false);
}