From 57746d341768ae48c9d899dcf3ae95caaa4c0f23 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 7 Aug 2002 15:12:50 +0000 Subject: Get rid of direct access to FT_Face. Wed Aug 7 11:07:10 2002 Owen Taylor * modules/hangul/hangul-xft.c (hangul_engine_shape): Get rid of direct access to FT_Face. --- ChangeLog | 5 +++++ ChangeLog.pre-1-10 | 5 +++++ ChangeLog.pre-1-2 | 5 +++++ ChangeLog.pre-1-4 | 5 +++++ ChangeLog.pre-1-6 | 5 +++++ ChangeLog.pre-1-8 | 5 +++++ modules/hangul/hangul-fc.c | 27 +++++++-------------------- modules/hangul/hangul-xft.c | 27 +++++++-------------------- 8 files changed, 44 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b5ded81..a120753a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Aug 7 11:07:10 2002 Owen Taylor + + * modules/hangul/hangul-xft.c (hangul_engine_shape): Get + rid of direct access to FT_Face. + Wed Aug 7 10:57:49 2002 Owen Taylor * modules/hangul/Makefile.am modules/thai/Makefile.am: diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 2b5ded81..a120753a 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,8 @@ +Wed Aug 7 11:07:10 2002 Owen Taylor + + * modules/hangul/hangul-xft.c (hangul_engine_shape): Get + rid of direct access to FT_Face. + Wed Aug 7 10:57:49 2002 Owen Taylor * modules/hangul/Makefile.am modules/thai/Makefile.am: diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 2b5ded81..a120753a 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,8 @@ +Wed Aug 7 11:07:10 2002 Owen Taylor + + * modules/hangul/hangul-xft.c (hangul_engine_shape): Get + rid of direct access to FT_Face. + Wed Aug 7 10:57:49 2002 Owen Taylor * modules/hangul/Makefile.am modules/thai/Makefile.am: diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 2b5ded81..a120753a 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,8 @@ +Wed Aug 7 11:07:10 2002 Owen Taylor + + * modules/hangul/hangul-xft.c (hangul_engine_shape): Get + rid of direct access to FT_Face. + Wed Aug 7 10:57:49 2002 Owen Taylor * modules/hangul/Makefile.am modules/thai/Makefile.am: diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 2b5ded81..a120753a 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,8 @@ +Wed Aug 7 11:07:10 2002 Owen Taylor + + * modules/hangul/hangul-xft.c (hangul_engine_shape): Get + rid of direct access to FT_Face. + Wed Aug 7 10:57:49 2002 Owen Taylor * modules/hangul/Makefile.am modules/thai/Makefile.am: diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 2b5ded81..a120753a 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,8 @@ +Wed Aug 7 11:07:10 2002 Owen Taylor + + * modules/hangul/hangul-xft.c (hangul_engine_shape): Get + rid of direct access to FT_Face. + Wed Aug 7 10:57:49 2002 Owen Taylor * modules/hangul/Makefile.am modules/thai/Makefile.am: diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index 13ff5fba..ab934832 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -59,19 +59,10 @@ set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGl glyphs->glyphs[i].geometry.width = logical_rect.width; } -static guint -find_char (FT_Face face, PangoFont *font, gunichar wc) -{ - int index = FT_Get_Char_Index (face, wc); - - if (index && index <= face->num_glyphs) - return index; - else - return 0; -} +#define find_char pango_xft_font_get_glyph static void -render_syllable (FT_Face face, PangoFont *font, gunichar *text, int length, +render_syllable (PangoFont *font, gunichar *text, int length, PangoGlyphString *glyphs, int *n_glyphs, int cluster_offset) { int index; @@ -91,7 +82,7 @@ render_syllable (FT_Face face, PangoFont *font, gunichar *text, int length, wc = S_FROM_LVT(text[0], text[1], text[2]); else wc = S_FROM_LV(text[0], text[1]); - index = find_char (face, font, wc); + index = find_char (font, wc); pango_glyph_string_set_size (glyphs, *n_glyphs + 1); if (!index) set_glyph (font, glyphs, *n_glyphs, cluster_offset, @@ -108,7 +99,7 @@ render_syllable (FT_Face face, PangoFont *font, gunichar *text, int length, { int jindex; - index = find_char (face, font, text[i]); + index = find_char (font, text[i]); if (index) { pango_glyph_string_set_size (glyphs, *n_glyphs + 1); @@ -123,7 +114,7 @@ render_syllable (FT_Face face, PangoFont *font, gunichar *text, int length, for (j = 0; j < 3 && (__jamo_to_ksc5601[jindex][j] != 0); j++) { wc = __jamo_to_ksc5601[jindex][j] - KSC_JAMOBASE + UNI_JAMOBASE; - index = (wc >= 0x3131) ? find_char (face, font, wc) : 0; + index = (wc >= 0x3131) ? find_char (font, wc) : 0; pango_glyph_string_set_size (glyphs, *n_glyphs + 1); if (!index) set_glyph (font, glyphs, *n_glyphs, cluster_offset, @@ -145,16 +136,12 @@ hangul_engine_shape (PangoFont *font, int n_chars, n_glyphs; int i; const char *p, *start; - FT_Face face; gunichar jamos_static[3]; guint max_jamos = G_N_ELEMENTS (jamos_static); gunichar *jamos = jamos_static; int n_jamos; - face = pango_xft_font_get_face (font); - g_assert (face); - n_chars = g_utf8_strlen (text, length); n_glyphs = 0; start = p = text; @@ -173,7 +160,7 @@ hangul_engine_shape (PangoFont *font, (IS_T (jamos[n_jamos - 1]) && IS_V (wc)))) { /* Draw a syllable. */ - render_syllable (face, font, jamos, n_jamos, glyphs, + render_syllable (font, jamos, n_jamos, glyphs, &n_glyphs, start - text); n_jamos = 0; start = p; @@ -193,7 +180,7 @@ hangul_engine_shape (PangoFont *font, } if (n_jamos != 0) - render_syllable (face, font, jamos, n_jamos, glyphs, &n_glyphs, + render_syllable (font, jamos, n_jamos, glyphs, &n_glyphs, start - text); if (jamos != jamos_static) diff --git a/modules/hangul/hangul-xft.c b/modules/hangul/hangul-xft.c index 13ff5fba..ab934832 100644 --- a/modules/hangul/hangul-xft.c +++ b/modules/hangul/hangul-xft.c @@ -59,19 +59,10 @@ set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGl glyphs->glyphs[i].geometry.width = logical_rect.width; } -static guint -find_char (FT_Face face, PangoFont *font, gunichar wc) -{ - int index = FT_Get_Char_Index (face, wc); - - if (index && index <= face->num_glyphs) - return index; - else - return 0; -} +#define find_char pango_xft_font_get_glyph static void -render_syllable (FT_Face face, PangoFont *font, gunichar *text, int length, +render_syllable (PangoFont *font, gunichar *text, int length, PangoGlyphString *glyphs, int *n_glyphs, int cluster_offset) { int index; @@ -91,7 +82,7 @@ render_syllable (FT_Face face, PangoFont *font, gunichar *text, int length, wc = S_FROM_LVT(text[0], text[1], text[2]); else wc = S_FROM_LV(text[0], text[1]); - index = find_char (face, font, wc); + index = find_char (font, wc); pango_glyph_string_set_size (glyphs, *n_glyphs + 1); if (!index) set_glyph (font, glyphs, *n_glyphs, cluster_offset, @@ -108,7 +99,7 @@ render_syllable (FT_Face face, PangoFont *font, gunichar *text, int length, { int jindex; - index = find_char (face, font, text[i]); + index = find_char (font, text[i]); if (index) { pango_glyph_string_set_size (glyphs, *n_glyphs + 1); @@ -123,7 +114,7 @@ render_syllable (FT_Face face, PangoFont *font, gunichar *text, int length, for (j = 0; j < 3 && (__jamo_to_ksc5601[jindex][j] != 0); j++) { wc = __jamo_to_ksc5601[jindex][j] - KSC_JAMOBASE + UNI_JAMOBASE; - index = (wc >= 0x3131) ? find_char (face, font, wc) : 0; + index = (wc >= 0x3131) ? find_char (font, wc) : 0; pango_glyph_string_set_size (glyphs, *n_glyphs + 1); if (!index) set_glyph (font, glyphs, *n_glyphs, cluster_offset, @@ -145,16 +136,12 @@ hangul_engine_shape (PangoFont *font, int n_chars, n_glyphs; int i; const char *p, *start; - FT_Face face; gunichar jamos_static[3]; guint max_jamos = G_N_ELEMENTS (jamos_static); gunichar *jamos = jamos_static; int n_jamos; - face = pango_xft_font_get_face (font); - g_assert (face); - n_chars = g_utf8_strlen (text, length); n_glyphs = 0; start = p = text; @@ -173,7 +160,7 @@ hangul_engine_shape (PangoFont *font, (IS_T (jamos[n_jamos - 1]) && IS_V (wc)))) { /* Draw a syllable. */ - render_syllable (face, font, jamos, n_jamos, glyphs, + render_syllable (font, jamos, n_jamos, glyphs, &n_glyphs, start - text); n_jamos = 0; start = p; @@ -193,7 +180,7 @@ hangul_engine_shape (PangoFont *font, } if (n_jamos != 0) - render_syllable (face, font, jamos, n_jamos, glyphs, &n_glyphs, + render_syllable (font, jamos, n_jamos, glyphs, &n_glyphs, start - text); if (jamos != jamos_static) -- cgit v1.2.1