From 7c121825763ce613f036c5e1326b65840f599b6d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 17 Nov 2021 17:25:17 +0000 Subject: [PATCH] clients: don't use deprecated fontconfig aliases The "sans" and "mono" aliases for "sans-serif" and "monospace" are deprecated[1]. Let's standardize on the non-deprecated versions, which were already in use in some places. [1]: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/blob/be453bd1590b545d490aa024ef267948419b4d3a/fonts.conf.in#L33-67 Signed-off-by: Alyssa Ross --- clients/cliptest.c | 2 +- clients/content_protection.c | 4 ++-- clients/fullscreen.c | 2 +- clients/keyboard.c | 2 +- clients/stacking.c | 2 +- clients/terminal.c | 2 +- clients/window.c | 2 +- shared/cairo-util.c | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clients/cliptest.c b/clients/cliptest.c index 89983850..59d5372c 100644 --- a/clients/cliptest.c +++ b/clients/cliptest.c @@ -341,7 +341,7 @@ redraw_handler(struct widget *widget, void *data) cairo_scale(cr, 4.0, 4.0); cairo_set_line_width(cr, 0.5); cairo_set_line_join(cr, CAIRO_LINE_JOIN_BEVEL); - cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, + cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size(cr, 5.0); draw_geometry(cr, &cliptest->view, ex, ey, n); diff --git a/clients/content_protection.c b/clients/content_protection.c index 27e2b8a9..0a3e98f5 100644 --- a/clients/content_protection.c +++ b/clients/content_protection.c @@ -123,7 +123,7 @@ draw_content(cairo_surface_t *surface, int x, int y, int width, int height, cairo_fill(cr); cairo_set_source_rgba(cr, 0, 0, 0, 1.0); - cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, + cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 15); if (type == WESTON_PROTECTED_SURFACE_TYPE_HDCP_0) @@ -263,7 +263,7 @@ buttons_redraw_handler(struct widget *widget, void *data) cairo_fill(cr); cairo_set_source_rgba(cr, 0, 0, 0, 1.0); - cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, + cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 10); cairo_move_to(cr, allocation.x + 5, allocation.y + 15); diff --git a/clients/fullscreen.c b/clients/fullscreen.c index 1b44ad53..5dfd3c59 100644 --- a/clients/fullscreen.c +++ b/clients/fullscreen.c @@ -80,7 +80,7 @@ draw_string(cairo_t *cr, cairo_save(cr); - cairo_select_font_face(cr, "sans", + cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 14); diff --git a/clients/keyboard.c b/clients/keyboard.c index b2ef2db9..ee419b2d 100644 --- a/clients/keyboard.c +++ b/clients/keyboard.c @@ -377,7 +377,7 @@ redraw_handler(struct widget *widget, void *data) cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip(cr); - cairo_select_font_face(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); + cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size(cr, 16); cairo_translate(cr, allocation.x, allocation.y); diff --git a/clients/stacking.c b/clients/stacking.c index 5e9084f8..3ab764bc 100644 --- a/clients/stacking.c +++ b/clients/stacking.c @@ -200,7 +200,7 @@ draw_string(cairo_t *cr, cairo_save(cr); - cairo_select_font_face(cr, "sans", + cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 14); diff --git a/clients/terminal.c b/clients/terminal.c index 07fb173e..42fe4b73 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -3143,7 +3143,7 @@ int main(int argc, char *argv[]) config_file = weston_config_get_name_from_env(); config = weston_config_parse(config_file); s = weston_config_get_section(config, "terminal", NULL, NULL); - weston_config_section_get_string(s, "font", &option_font, "mono"); + weston_config_section_get_string(s, "font", &option_font, "monospace"); weston_config_section_get_int(s, "font-size", &option_font_size, 14); weston_config_section_get_string(s, "term", &option_term, "xterm"); weston_config_destroy(config); diff --git a/clients/window.c b/clients/window.c index f54d38e7..02b3aba9 100644 --- a/clients/window.c +++ b/clients/window.c @@ -5424,7 +5424,7 @@ menu_redraw_handler(struct widget *widget, void *data) cairo_rectangle(cr, x, y, width, height); cairo_fill(cr); - cairo_select_font_face(cr, "sans", + cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 12); diff --git a/shared/cairo-util.c b/shared/cairo-util.c index 3a32b90a..3bdf9654 100644 --- a/shared/cairo-util.c +++ b/shared/cairo-util.c @@ -494,7 +494,7 @@ create_layout(cairo_t *cr, const char *title) layout = pango_cairo_create_layout(cr); if (title) { pango_layout_set_text(layout, title, -1); - desc = pango_font_description_from_string("Sans Bold 10"); + desc = pango_font_description_from_string("sans-serif Bold 10"); pango_layout_set_font_description(layout, desc); pango_font_description_free(desc); } @@ -577,7 +577,7 @@ theme_render_frame(struct theme *t, cairo_text_extents_t extents; cairo_font_extents_t font_extents; - cairo_select_font_face(cr, "sans", + cairo_select_font_face(cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size(cr, 14);