diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-4 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 6 | ||||
-rw-r--r-- | modules/hangul/hangul-defs.h | 1 | ||||
-rw-r--r-- | modules/hangul/hangul-fc.c | 31 |
7 files changed, 57 insertions, 5 deletions
@@ -1,3 +1,9 @@ +2004-04-18 Changwoo Ryu <cwryu@debian.org> + + * modules/hangul/hangul-defs.h (IS_JAMO): + * modules/hangul/hangul-fc.c (hangul_engine_shape, render_basic): + handle non-Hangul unicode chars, fixes #129741, #137347. + 2004-04-05 Anders Carlsson <andersca@gnome.org> * examples/argcontext.c (arg_context_parse): diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index a43e592e..7bd03c7d 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,9 @@ +2004-04-18 Changwoo Ryu <cwryu@debian.org> + + * modules/hangul/hangul-defs.h (IS_JAMO): + * modules/hangul/hangul-fc.c (hangul_engine_shape, render_basic): + handle non-Hangul unicode chars, fixes #129741, #137347. + 2004-04-05 Anders Carlsson <andersca@gnome.org> * examples/argcontext.c (arg_context_parse): diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index a43e592e..7bd03c7d 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,9 @@ +2004-04-18 Changwoo Ryu <cwryu@debian.org> + + * modules/hangul/hangul-defs.h (IS_JAMO): + * modules/hangul/hangul-fc.c (hangul_engine_shape, render_basic): + handle non-Hangul unicode chars, fixes #129741, #137347. + 2004-04-05 Anders Carlsson <andersca@gnome.org> * examples/argcontext.c (arg_context_parse): diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index a43e592e..7bd03c7d 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,9 @@ +2004-04-18 Changwoo Ryu <cwryu@debian.org> + + * modules/hangul/hangul-defs.h (IS_JAMO): + * modules/hangul/hangul-fc.c (hangul_engine_shape, render_basic): + handle non-Hangul unicode chars, fixes #129741, #137347. + 2004-04-05 Anders Carlsson <andersca@gnome.org> * examples/argcontext.c (arg_context_parse): diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index a43e592e..7bd03c7d 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,9 @@ +2004-04-18 Changwoo Ryu <cwryu@debian.org> + + * modules/hangul/hangul-defs.h (IS_JAMO): + * modules/hangul/hangul-fc.c (hangul_engine_shape, render_basic): + handle non-Hangul unicode chars, fixes #129741, #137347. + 2004-04-05 Anders Carlsson <andersca@gnome.org> * examples/argcontext.c (arg_context_parse): diff --git a/modules/hangul/hangul-defs.h b/modules/hangul/hangul-defs.h index 2ddf339a..59ed4625 100644 --- a/modules/hangul/hangul-defs.h +++ b/modules/hangul/hangul-defs.h @@ -48,6 +48,7 @@ #define HTONE1 0x302E #define HTONE2 0x302F +#define IS_JAMO(wc) (wc >= LBASE && wc <= TEND) #define IS_L(wc) (wc >= LBASE && wc <= LEND) #define IS_V(wc) (wc >= VFILL && wc <= VEND) #define IS_T(wc) (wc > TBASE && wc <= TEND) diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index c64d6de7..1e5b2229 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -1,7 +1,7 @@ /* Pango * hangul-fc.c: Hangul shaper for FreeType based backends * - * Copyright (C) 2002 Changwoo Ryu + * Copyright (C) 2002-2004 Changwoo Ryu * Author: Changwoo Ryu <cwryu@debian.org> * * This library is free software; you can redistribute it and/or @@ -275,6 +275,21 @@ render_syllable (PangoFont *font, gunichar *text, int length, render_tone(font, tone, glyphs, n_glyphs, cluster_offset); } +static void +render_basic (PangoFont *font, gunichar wc, + PangoGlyphString *glyphs, int *n_glyphs, int cluster_offset) +{ + int index; + index = find_char (font, wc); + pango_glyph_string_set_size (glyphs, *n_glyphs + 1); + if (index) + set_glyph (font, glyphs, *n_glyphs, cluster_offset, index); + else + set_glyph (font, glyphs, *n_glyphs, cluster_offset, + get_unknown_glyph (font, wc)); + (*n_glyphs)++; +} + static void hangul_engine_shape (PangoEngineShape *engine, PangoFont *font, @@ -307,13 +322,14 @@ hangul_engine_shape (PangoEngineShape *engine, if (n_jamos) { gunichar prev = jamos[n_jamos - 1]; - if ((!IS_L (prev) && IS_S (wc)) || + if ((!IS_JAMO (wc) && !IS_S (wc) && !IS_M (wc)) || + (!IS_L (prev) && IS_S (wc)) || (IS_T (prev) && IS_L (wc)) || (IS_V (prev) && IS_L (wc)) || (IS_T (prev) && IS_V (wc)) || - IS_M(prev)) + IS_M (prev)) { - /* Draw a syllable. */ + /* Draw a syllable with these jamos. */ render_syllable (font, jamos, n_jamos, glyphs, &n_glyphs, start - text); n_jamos = 0; @@ -333,7 +349,12 @@ hangul_engine_shape (PangoEngineShape *engine, jamos = g_renew (gunichar, jamos, max_jamos); } - if (IS_S (wc)) + if (!IS_JAMO (wc) && !IS_S (wc) && !IS_M (wc)) + { + render_basic (font, wc, glyphs, &n_glyphs, start - text); + start = g_utf8_next_char (p); + } + else if (IS_S (wc)) { jamos[n_jamos++] = L_FROM_S (wc); jamos[n_jamos++] = V_FROM_S (wc); |