src/hb-ot-shape-complex-hangul.cc | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-)
New commits: commit 29ea403d67e29c2d531c1f613ce3d69e60f078f6 Author: Behdad Esfahbod <[email protected]> Date: Thu Jan 2 14:20:00 2014 +0800 [hangul] Fix decomposition logic Seems to be working now. diff --git a/src/hb-ot-shape-complex-hangul.cc b/src/hb-ot-shape-complex-hangul.cc index 4194497..1d79c43 100644 --- a/src/hb-ot-shape-complex-hangul.cc +++ b/src/hb-ot-shape-complex-hangul.cc @@ -168,16 +168,13 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan, unsigned int vindex = nindex / TCount; unsigned int tindex = nindex % TCount; - if (tindex && has_glyph) - goto next; /* <LVT> supported. Nothing to do. */ - if (!tindex && buffer->idx + 1 < count && isCombiningT (buffer->cur(+1).codepoint)) { /* <LV,T>, try to combine. */ - tindex = buffer->cur(+1).codepoint - TBase; - hb_codepoint_t new_s = s + tindex; + unsigned int new_tindex = buffer->cur(+1).codepoint - TBase; + hb_codepoint_t new_s = s + new_tindex; if (font->get_glyph (new_s, 0, &glyph)) { buffer->replace_glyphs (2, 1, &new_s); @@ -187,11 +184,12 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan, } } - /* Otherwise, decompose if font doesn't support <LV>, - * or if having non-combining <LV,T>. Note that we - * already handled combining <LV,T> above. */ + /* Otherwise, decompose if font doesn't support <LV> or <LVT>, + * or if having non-combining <LV,T>. Note that we already handled + * combining <LV,T> above. */ if (!has_glyph || - (buffer->idx + 1 < count && + (!tindex && + buffer->idx + 1 < count && isT (buffer->cur(+1).codepoint))) { hb_codepoint_t decomposed[3] = {LBase + lindex, @@ -199,7 +197,7 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan, TBase + tindex}; if (font->get_glyph (decomposed[0], 0, &glyph) && font->get_glyph (decomposed[1], 0, &glyph) && - (tindex && font->get_glyph (decomposed[2], 0, &glyph))) + (!tindex || font->get_glyph (decomposed[2], 0, &glyph))) { buffer->replace_glyphs (1, tindex ? 3 : 2, decomposed); if (unlikely (buffer->in_error)) @@ -209,7 +207,6 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan, } } - next: buffer->next_glyph (); } buffer->swap_buffers (); commit bdb20dafc3f737923da3dca0c832fdf4ab8daabc Author: Behdad Esfahbod <[email protected]> Date: Thu Jan 2 14:04:30 2014 +0800 [hangul] Fix decomposition Part of https://github.com/behdad/harfbuzz/pull/10 diff --git a/src/hb-ot-shape-complex-hangul.cc b/src/hb-ot-shape-complex-hangul.cc index ed32935..4194497 100644 --- a/src/hb-ot-shape-complex-hangul.cc +++ b/src/hb-ot-shape-complex-hangul.cc @@ -165,8 +165,8 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan, bool has_glyph = font->get_glyph (s, 0, &glyph); unsigned int lindex = (s - SBase) / NCount; unsigned int nindex = (s - SBase) % NCount; - unsigned int vindex = nindex / VCount; - unsigned int tindex = nindex % VCount; + unsigned int vindex = nindex / TCount; + unsigned int tindex = nindex % TCount; if (tindex && has_glyph) goto next; /* <LVT> supported. Nothing to do. */ commit 32478656ce6e7926c3ad481511f02187ca743af6 Author: Behdad Esfahbod <[email protected]> Date: Thu Jan 2 14:01:56 2014 +0800 [hangul] Tighten up character categories I had tried to expand to fill the blocks, but that sounds wrong in retrospect. diff --git a/src/hb-ot-shape-complex-hangul.cc b/src/hb-ot-shape-complex-hangul.cc index 94cf5e5..ed32935 100644 --- a/src/hb-ot-shape-complex-hangul.cc +++ b/src/hb-ot-shape-complex-hangul.cc @@ -60,7 +60,7 @@ collect_features_hangul (hb_ot_shape_planner_t *plan) #define isCombiningT(u) (hb_in_range<hb_codepoint_t> ((u), TBase+1, TBase+TCount-1)) #define isCombinedS(u) (hb_in_range<hb_codepoint_t> ((u), SBase, SBase+SCount-1)) -#define isT(u) (hb_in_ranges<hb_codepoint_t> ((u), 0x11A8, 0x11FF, 0xD7C8, 0xD7FF)) +#define isT(u) (hb_in_ranges<hb_codepoint_t> ((u), 0x11A8, 0x11FF, 0xD7CB, 0xD7FB)) static void preprocess_text_hangul (const hb_ot_shape_plan_t *plan, @@ -82,7 +82,7 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan, * * - <L>: U+1100..115F, U+A960..A97F * - <V>: U+1160..11A7, U+D7B0..D7C7 - * - <T>: U+11A8..11FF, U+D7C8..D7FF + * - <T>: U+11A8..11FF, U+D7CB..D7FB * * - Only the <L,V> sequences for the 11xx ranges combine. * - Only <LV,T> sequences for T in U+11A8..11C3 combine. _______________________________________________ HarfBuzz mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/harfbuzz
