diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-02-04 17:13:19 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-02-04 17:13:19 +0000 |
commit | 8adcead819b6bb6781f0b01c6b17175b2918af8f (patch) | |
tree | 204c6320b3725a06c132483dce21fcc70e1f6c73 /pango/pangoft2.c | |
parent | e14cca806c98818515054556df949c482519fc70 (diff) | |
download | pango-8adcead819b6bb6781f0b01c6b17175b2918af8f.tar.gz |
Move the FT_IS_SFNT(font) logic into pango_ft2_get_unknown glyph.
2006-02-04 Behdad Esfahbod <behdad@gnome.org>
* pango/pangoft2.c, pango/pangoft2-render.c: Move the
FT_IS_SFNT(font) logic into pango_ft2_get_unknown glyph.
Diffstat (limited to 'pango/pangoft2.c')
-rw-r--r-- | pango/pangoft2.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/pango/pangoft2.c b/pango/pangoft2.c index c20afdf5..901cd99a 100644 --- a/pango/pangoft2.c +++ b/pango/pangoft2.c @@ -316,11 +316,10 @@ pango_ft2_font_get_glyph_extents (PangoFont *font, if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) { - FT_Face face = pango_ft2_font_get_face (font); - if (face && FT_IS_SFNT (face)) - glyph = pango_ft2_get_unknown_glyph (font); - else + glyph = pango_ft2_get_unknown_glyph (font); + if (glyph == PANGO_GLYPH_EMPTY) { + /* No unknown glyph found for the font, draw a box */ PangoFontMetrics *metrics = pango_font_get_metrics (font, NULL); if (metrics) @@ -471,16 +470,22 @@ pango_ft2_font_get_coverage (PangoFont *font, * pango_ft2_get_unknown_glyph: * @font: a #PangoFont * - * Return the index of a glyph suitable for drawing unknown characters. + * Return the index of a glyph suitable for drawing unknown characters, + * or %PANGO_GLYPH_EMPTY if no suitable glyph found. * - * Use pango_fc_font_get_unknown_glyph() instead. + * For most uses, pango_fc_font_get_unknown_glyph() should be used instead. * - * Return value: a glyph index into @font + * Return value: a glyph index into @font, or %PANGO_GLYPH_EMPTY **/ PangoGlyph pango_ft2_get_unknown_glyph (PangoFont *font) { - return 0; + FT_Face face = pango_ft2_font_get_face (font); + if (face && FT_IS_SFNT (face)) + /* TrueType fonts have an 'unknown glyph' box on glyph index 0 */ + return 0; + else + return PANGO_GLYPH_EMPTY; } typedef struct |