mirror of
https://github.com/swaywm/sway.git
synced 2026-03-29 07:58:16 -04:00
Add client support for HiDPI
This adds HiDPI support to swaybar, swaybg, and swaylock.
This commit is contained in:
parent
61184e3208
commit
b2226ac655
9 changed files with 96 additions and 61 deletions
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text, bool markup) {
|
||||
PangoLayout *layout = pango_cairo_create_layout(cairo);
|
||||
PangoAttrList *attrs = pango_attr_list_new();
|
||||
pango_attr_list_insert(attrs, pango_attr_scale_new(2));
|
||||
if (markup) {
|
||||
pango_layout_set_markup(layout, text, -1);
|
||||
} else {
|
||||
|
|
@ -17,6 +19,8 @@ PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text
|
|||
PangoFontDescription *desc = pango_font_description_from_string(font);
|
||||
pango_layout_set_font_description(layout, desc);
|
||||
pango_layout_set_single_paragraph_mode(layout, 1);
|
||||
pango_layout_set_attributes(layout, attrs);
|
||||
pango_attr_list_unref(attrs);
|
||||
pango_font_description_free(desc);
|
||||
return layout;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue