diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2012-12-30 20:52:10 -0600 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2012-12-30 20:52:10 -0600 |
commit | a4f56b5d8b3c3009fea7dafc3804fe573045bb32 (patch) | |
tree | 18ae120d43e4e6cfe5b7cbfb4648cb5f218368c9 /pango | |
parent | f0cd936cf62c552bc6b17f6ecb70c2de783a9e80 (diff) | |
download | pango-a4f56b5d8b3c3009fea7dafc3804fe573045bb32.tar.gz |
Fix most of "failed to choose font" warnings
If we are in fallback mode, with a font that has to space glyph, then
looking up engine/font for any character not in the font was failing
badly. In that case, if there's only one engine (which is the case
these days), just choose it.
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pango-context.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c index b15f44d1..6c61d777 100644 --- a/pango/pango-context.c +++ b/pango/pango-context.c @@ -1155,7 +1155,7 @@ typedef struct { } GetShaperFontInfo; static gboolean -get_shaper_and_font_foreach (PangoFontset *fontset G_GNUC_UNUSED, +get_shaper_and_font_foreach (PangoFontset *fontset, PangoFont *font, gpointer data) { @@ -1180,6 +1180,15 @@ get_shaper_and_font_foreach (PangoFontset *fontset G_GNUC_UNUSED, } } + if (!fontset && info->engines && info->engines->next == NULL) + { + /* We are in no-fallback mode and there's only one engine, just + * return it. */ + info->shape_engine = (PangoEngineShape *) info->engines->data; + info->font = font; + return TRUE; + } + return FALSE; } |