<div dir="ltr"><div>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.<br><br></div>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.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 5:50 PM, Ryo Munakata <span dir="ltr"><<a href="mailto:ryomnktml@gmail.com" target="_blank">ryomnktml@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Sat, 04 Oct 2014 15:08:12 -0700<br>
Bill Spitzak <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>> wrote:<br>
<br>
> On 10/04/2014 04:37 AM, Ryo Munakata wrote:<br>
> > cairo-util has used sans font family for title fonts so far.<br>
> > But sans doesn't support glyphs of some non-ascii characters.<br>
> > So now let users choose a font family for titles.<br>
> ><br>
> > To show texts correctly now using pangocairo for redering fonts.<br>
> > If any single font in 'fonts' entry doesn't contain all the needed glyphs,<br>
> > we use the fallback mode of pango.<br>
><br>
> As far as I can tell Pango does this fallback without any setup, not<br>
> sure why you have all this code for turning on fallback. The following<br>
> seems to produce all the assigned glyphs in just about every block I<br>
> tried, and certainly produces glyphs that are not in sans:<br>
><br>
>    PangoFontDescription *font_description = pango_font_description_new ();<br>
>    pango_font_description_set_family (font_description, "sans");<br>
>    pango_font_description_set_weight (font_description,<br>
> PANGO_WEIGHT_NORMAL);<br>
>    pango_font_description_set_absolute_size (font_description, 32 *<br>
> PANGO_SCALE);<br>
>    PangoLayout *layout = pango_cairo_create_layout (cr);<br>
>    pango_layout_set_font_description (layout, font_description);<br>
>    pango_layout_set_markup (layout, text, -1);<br>
>    pango_layout_set_width(layout, (W-20) * PANGO_SCALE);<br>
>    pango_layout_set_height(layout, (H-100) * PANGO_SCALE);<br>
>    cairo_move_to (cr, 10.0, 100.0);<br>
>    pango_cairo_show_layout (cr, layout);<br>
>    g_object_unref (layout);<br>
>    pango_font_description_free (font_description);<br>
<br>
</div></div>Hi, Bill.<br>
Thank you for reviewing!<br>
<br>
Yeah, pango does fallback without any setup but that isn't what I want.<br>
<br>
What I want to do with 'fonts' entry is: if *every single* font in the list<br>
doesn't have *all the needed* glyphs, then, we set the first font in the list<br>
and use pango fallback mode.<br>
<br>
The code you wrote is something like:<br>
sans doesn't seem to have some glyphs. Let's use pango fallback mode.<br>
<br>
pango_layout_set_best_font() does the followings:<br>
 1. Oops, sans doesn't have all the needed glyphs.<br>
 2. So then, try the next font in the list.<br>
 3. It also doen't contain some glyphs. Let's try the third one.<br>
 4. Finally, it contains all the needed glyphs. Let's use the third one.<br>
or:<br>
 4. It also doesn't. Set the first font and let's use pango fallback mode.<br>
    (This is the case you showed me)<br>
<br>
The point is pango_layout_set_best_font() respects the fonts list users specified as much as possible.<br>
<br>
Maybe the commit message I wrote is unclear or broken.<br>
Sorry about that.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Ryo Munakata <<a href="mailto:ryomnktml@gmail.com">ryomnktml@gmail.com</a>><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Jasper<br>
</div>