[PATCH weston v2 1/2] Add font entry to shell section for title fonts

Bill Spitzak spitzak at gmail.com
Sat Oct 4 15:08:12 PDT 2014


On 10/04/2014 04:37 AM, Ryo Munakata wrote:
> cairo-util has used sans font family for title fonts so far.
> But sans doesn't support glyphs of some non-ascii characters.
> So now let users choose a font family for titles.
>
> To show texts correctly now using pangocairo for redering fonts.
> If any single font in 'fonts' entry doesn't contain all the needed glyphs,
> we use the fallback mode of pango.

As far as I can tell Pango does this fallback without any setup, not 
sure why you have all this code for turning on fallback. The following 
seems to produce all the assigned glyphs in just about every block I 
tried, and certainly produces glyphs that are not in sans:

   PangoFontDescription *font_description = pango_font_description_new ();
   pango_font_description_set_family (font_description, "sans");
   pango_font_description_set_weight (font_description, 
PANGO_WEIGHT_NORMAL);
   pango_font_description_set_absolute_size (font_description, 32 * 
PANGO_SCALE);
   PangoLayout *layout = pango_cairo_create_layout (cr);
   pango_layout_set_font_description (layout, font_description);
   pango_layout_set_markup (layout, text, -1);
   pango_layout_set_width(layout, (W-20) * PANGO_SCALE);
   pango_layout_set_height(layout, (H-100) * PANGO_SCALE);
   cairo_move_to (cr, 10.0, 100.0);
   pango_cairo_show_layout (cr, layout);
   g_object_unref (layout);
   pango_font_description_free (font_description);



More information about the wayland-devel mailing list