diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-07-26 23:12:54 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-07-26 23:12:54 +0000 |
commit | cb4479a9348f90c2b8cbbdc2de8d1d88eb788d34 (patch) | |
tree | d6e793712350429cc28fced7f201457fd1656765 /pango/pangoxft-font.c | |
parent | c613cb2ce4eb5940c2c414deff5544bb90ae9303 (diff) | |
download | pango-cb4479a9348f90c2b8cbbdc2de8d1d88eb788d34.tar.gz |
Patch from Theppitak Karoonboonyanan that factors out common code from
Fri Jul 26 18:48:49 2002 Owen Taylor <otaylor@redhat.com>
* configure.in modules/thai/Makefile.am
modules/thai/thai-shaper.[ch]
modules/thai/thai-xft.c modules/thai/thai-x.c:
Patch from Theppitak Karoonboonyanan that factors
out common code from thai-x.c and adds a new
Xft shaper for Thai. (#78346)
* pango/pangoxft.h pango/pangoxft-font.c: Add
pango_xft_font_has_char()
to optimize for cases where we don't actually need
to load the font.
* pango/pangoxft.h: Document pango_xft_font_get_glyph().
* modules/basic/basic-xft.c (basic_engine_shape): Clean
up an unused variable warning.
Diffstat (limited to 'pango/pangoxft-font.c')
-rw-r--r-- | pango/pangoxft-font.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/pango/pangoxft-font.c b/pango/pangoxft-font.c index 4f82bb8e..9f505a7e 100644 --- a/pango/pangoxft-font.c +++ b/pango/pangoxft-font.c @@ -841,8 +841,21 @@ pango_xft_font_unlock_face (PangoFont *font) XftUnlockFace (xft_font); } +/** + * pango_xft_font_get_glyph: + * @font: a #PangoFont for the Xft backend + * @wc: Unicode codepoint to look up + * + * Gets the glyph index for a given unicode codepoint + * for @font. If you only want to determine + * whether the font has the glyph, use pango_xft_font_has_char(). + * + * Return value: the glyph index, or 0, if the unicode + * codepoint doesn't exist in the font. + **/ guint -pango_xft_font_get_glyph (PangoFont *font, gunichar wc) +pango_xft_font_get_glyph (PangoFont *font, + gunichar wc) { XftFont *xft_font; @@ -850,5 +863,28 @@ pango_xft_font_get_glyph (PangoFont *font, gunichar wc) xft_font = pango_xft_font_get_font (font); - return XftCharIndex (0, xft_font, wc); + return XftCharIndex (NULL, xft_font, wc); } + +/** + * pango_xft_font_has_char: + * @font: a #PangoFont for the Xft backend + * @wc: Unicode codepoint to look up + * + * Determines whether @font has a glyph for the codepoint @wc. + * + * Return value: %TRUE if @font has the requested codepoint. + **/ +gboolean +pango_xft_font_has_char (PangoFont *font, + gunichar wc) +{ + XftFont *xft_font; + + g_return_val_if_fail (PANGO_XFT_IS_FONT (font), 0); + + xft_font = pango_xft_font_get_font (font); + + return XftCharExists (NULL, xft_font, wc); +} + |