I don't think that's a great idea. The rest of my system uses Pango's algorithms for doing font fallback and font shaping, and I don't see a reason to differ from it.
Not to mention that it's very unlikely that I want my window title to suddenly switch completely to a fullwidth font because it had one Japanese character in it. On Sat, Oct 4, 2014 at 5:50 PM, Ryo Munakata <ryomnk...@gmail.com> wrote: > On Sat, 04 Oct 2014 15:08:12 -0700 > Bill Spitzak <spit...@gmail.com> wrote: > > > 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); > > Hi, Bill. > Thank you for reviewing! > > Yeah, pango does fallback without any setup but that isn't what I want. > > What I want to do with 'fonts' entry is: if *every single* font in the list > doesn't have *all the needed* glyphs, then, we set the first font in the > list > and use pango fallback mode. > > The code you wrote is something like: > sans doesn't seem to have some glyphs. Let's use pango fallback mode. > > pango_layout_set_best_font() does the followings: > 1. Oops, sans doesn't have all the needed glyphs. > 2. So then, try the next font in the list. > 3. It also doen't contain some glyphs. Let's try the third one. > 4. Finally, it contains all the needed glyphs. Let's use the third one. > or: > 4. It also doesn't. Set the first font and let's use pango fallback mode. > (This is the case you showed me) > > The point is pango_layout_set_best_font() respects the fonts list users > specified as much as possible. > > Maybe the commit message I wrote is unclear or broken. > Sorry about that. > > -- > Ryo Munakata <ryomnk...@gmail.com> > _______________________________________________ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/wayland-devel > -- Jasper
_______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel