diff options
author | marcus <marcus@FreeBSD.org> | 2004-06-01 03:41:46 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2004-06-01 03:41:46 +0800 |
commit | 9b2d796500cd98e45caf4785b8e35fa9bb32e312 (patch) | |
tree | d59737bcedd029bb6fc9bf3ae7ae6f56f36249c6 /x11-toolkits | |
parent | 70ee535472ac0e027cf6ca1f809a75b9ce82f78f (diff) | |
download | freebsd-ports-gnome-9b2d796500cd98e45caf4785b8e35fa9bb32e312.tar.gz freebsd-ports-gnome-9b2d796500cd98e45caf4785b8e35fa9bb32e312.tar.zst freebsd-ports-gnome-9b2d796500cd98e45caf4785b8e35fa9bb32e312.zip |
Fix a crash when trying to render non-Hangul unicode characters. This was
especially problematic in pan and evolution.
Obtained from: GNOME CVS
Tested by: Tom McLaughlin <tmclaugh@sdf.lonestar.org>
Diffstat (limited to 'x11-toolkits')
-rw-r--r-- | x11-toolkits/pango/Makefile | 1 | ||||
-rw-r--r-- | x11-toolkits/pango/files/patch-hangul | 85 |
2 files changed, 86 insertions, 0 deletions
diff --git a/x11-toolkits/pango/Makefile b/x11-toolkits/pango/Makefile index 5aae206ceffb..a2d15fd5fd21 100644 --- a/x11-toolkits/pango/Makefile +++ b/x11-toolkits/pango/Makefile @@ -7,6 +7,7 @@ PORTNAME= pango PORTVERSION= 1.4.0 +PORTREVISION= 1 CATEGORIES= x11-toolkits MASTER_SITES= ${MASTER_SITE_GNOME:S,%SUBDIR%,sources/${PORTNAME}/1.4,} \ ftp://ftp.gtk.org/pub/gtk/v2.3/ diff --git a/x11-toolkits/pango/files/patch-hangul b/x11-toolkits/pango/files/patch-hangul new file mode 100644 index 000000000000..36e55c8ad068 --- /dev/null +++ b/x11-toolkits/pango/files/patch-hangul @@ -0,0 +1,85 @@ +=================================================================== +RCS file: /cvs/gnome/pango/modules/hangul/hangul-fc.c,v +retrieving revision 1.13 +retrieving revision 1.14 +diff -u -r1.13 -r1.14 +--- modules/hangul/hangul-fc.c 2003/09/23 23:11:51 1.13 ++++ modules/hangul/hangul-fc.c 2004/04/17 16:17:57 1.14 +@@ -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_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 @@ + 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 @@ + 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); +=================================================================== +RCS file: /cvs/gnome/pango/modules/hangul/hangul-defs.h,v +retrieving revision 1.4 +retrieving revision 1.5 +diff -u -r1.4 -r1.5 +--- modules/hangul/hangul-defs.h 2002/11/03 19:56:24 1.4 ++++ modules/hangul/hangul-defs.h 2004/04/17 16:17:57 1.5 +@@ -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) |