diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-02-02 10:52:49 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-02-02 10:52:49 +0000 |
commit | da58dbfdea113caa46448c0bb3bf945b4a18f502 (patch) | |
tree | bd04c2e6d5d4f74ee5eef9a3dd8a1c2bdaeb5f7e /pango/pangoxft-font.c | |
parent | 93be594100f783b409cba98f6c9d58060c4ef433 (diff) | |
download | pango-da58dbfdea113caa46448c0bb3bf945b4a18f502.tar.gz |
Use PANGO_GLYPH_NULL for when no glyph should be drawn. Use
2006-02-02 Behdad Esfahbod <behdad@gnome.org>
* modules/arabic/arabic-fc.c, modules/basic/basic-atsui.c,
modules/basic/basic-fc.c, modules/basic/basic-win32.c,
modules/basic/basic-x.c, modules/hangul/hangul-fc.c,
modules/hebrew/hebrew-fc.c, modules/indic/indic-fc.c,
modules/khmer/khmer-fc.c, modules/syriac/syriac-fc.c,
modules/thai/thai-fc.c, modules/tibetan/tibetan-fc.c,
pango/fonts.c, pango/pango-engine-private.h pango/pango-types.h,
pango/pangocairo-fcfont.c, pango/pangocairo-font.c,
pango/pangocairo-private.h, pango/pangocairo-render.c,
pango/pangofc-decoder.c, pango/pangofc-font.c,
pango/pangoft2-render.c, pango/pangoft2.c pango/pangowin32.c,
pango/pangox.c, pango/pangoxft-font.c pango/pangoxft-private.h,
pango/pangoxft-render.c, pango/shape.c: Use PANGO_GLYPH_NULL for
when no glyph should be drawn. Use PANGO_GLYPH_UNKNOWN_FLAG for
all backends to mark unknown flags. There's no need for
pango_font_get_unknown_glyph() anymore, since all backends know
how to handle PANGO_GLYPH_UNKNOWN_FLAG gracefully. We may add
that in the future however. (fixes bug #73147, closes bug #329524)
Diffstat (limited to 'pango/pangoxft-font.c')
-rw-r--r-- | pango/pangoxft-font.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/pango/pangoxft-font.c b/pango/pangoxft-font.c index 2e26dbad..c7004c0c 100644 --- a/pango/pangoxft-font.c +++ b/pango/pangoxft-font.c @@ -51,8 +51,6 @@ static gboolean pango_xft_font_real_has_char (PangoFcFont *font, gunichar wc); static guint pango_xft_font_real_get_glyph (PangoFcFont *font, gunichar wc); -static PangoGlyph pango_xft_font_real_get_unknown_glyph (PangoFcFont *font, - gunichar wc); static void pango_xft_font_real_shutdown (PangoFcFont *font); static XftFont *xft_font_get_font (PangoFont *font); @@ -74,7 +72,6 @@ pango_xft_font_class_init (PangoXftFontClass *class) fc_font_class->unlock_face = pango_xft_font_real_unlock_face; fc_font_class->has_char = pango_xft_font_real_has_char; fc_font_class->get_glyph = pango_xft_font_real_get_glyph; - fc_font_class->get_unknown_glyph = pango_xft_font_real_get_unknown_glyph; fc_font_class->shutdown = pango_xft_font_real_shutdown; } @@ -209,7 +206,7 @@ get_glyph_extents_missing (PangoXftFont *xfont, PangoFont *font = PANGO_FONT (xfont); XftFont *xft_font = xft_font_get_font (font); - gint cols = (glyph & ~PANGO_XFT_UNKNOWN_FLAG) > 0xffff ? 3 : 2; + gint cols = (glyph & ~PANGO_GLYPH_UNKNOWN_FLAG) > 0xffff ? 3 : 2; _pango_xft_font_get_mini_font (xfont); @@ -323,21 +320,7 @@ pango_xft_font_get_glyph_extents (PangoFont *font, if (!fcfont->fontmap) /* Display closed */ goto fallback; - if (glyph == (PangoGlyph)-1) - glyph = 0; - - if (glyph & PANGO_XFT_UNKNOWN_FLAG) - { - get_glyph_extents_missing (xfont, glyph, ink_rect, logical_rect); - } - else if (glyph) - { - if (!fcfont->is_transformed) - get_glyph_extents_xft (fcfont, glyph, ink_rect, logical_rect); - else - get_glyph_extents_raw (xfont, glyph, ink_rect, logical_rect); - } - else + if (glyph == PANGO_GLYPH_NULL) { fallback: @@ -355,6 +338,18 @@ pango_xft_font_get_glyph_extents (PangoFont *font, logical_rect->y = 0; logical_rect->height = 0; } + return; + } + else if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) + { + get_glyph_extents_missing (xfont, glyph, ink_rect, logical_rect); + } + else + { + if (!fcfont->is_transformed) + get_glyph_extents_xft (fcfont, glyph, ink_rect, logical_rect); + else + get_glyph_extents_raw (xfont, glyph, ink_rect, logical_rect); } } @@ -453,13 +448,6 @@ pango_xft_font_real_get_glyph (PangoFcFont *font, return XftCharIndex (NULL, xft_font, wc); } -static PangoGlyph -pango_xft_font_real_get_unknown_glyph (PangoFcFont *font, - gunichar wc) -{ - return wc | PANGO_XFT_UNKNOWN_FLAG; -} - static void pango_xft_font_real_shutdown (PangoFcFont *fcfont) { @@ -586,7 +574,7 @@ pango_xft_font_unlock_face (PangoFont *font) * * Use pango_fc_font_get_glyph() instead. * - * Return value: the glyph index, or 0, if the Unicode + * Return value: the glyph index, or %PANGO_GLYPH_NULL, if the Unicode * character does not exist in the font. * * Since: 1.2 @@ -595,7 +583,7 @@ guint pango_xft_font_get_glyph (PangoFont *font, gunichar wc) { - g_return_val_if_fail (PANGO_XFT_IS_FONT (font), 0); + g_return_val_if_fail (PANGO_XFT_IS_FONT (font), PANGO_GLYPH_NULL); return pango_fc_font_get_glyph (PANGO_FC_FONT (font), wc); } |