src/hb-ot-map-private.hh | 7 +- src/hb-ot-shape-normalize.cc | 1 src/hb-ot-shape.cc | 35 ++++++++++ src/hb-ot.h | 8 ++ src/hb-set-private.hh | 7 +- src/hb-set.cc | 2 src/hb-unicode.cc | 2 src/main.cc | 9 +- test/shaping/texts/in-tree/shaper-indic/indic/script-bengali/misc/misc.txt | 1 9 files changed, 62 insertions(+), 10 deletions(-)
New commits: commit 1a2a4a0078dda834443edd421037a4bcbad18c5e Author: Behdad Esfahbod <[email protected]> Date: Sat May 5 22:38:20 2012 +0200 Fix warning and build issues As reported by Jonathan Kew on the list. diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh index ee489d0..7dd19b9 100644 --- a/src/hb-set-private.hh +++ b/src/hb-set-private.hh @@ -136,7 +136,7 @@ struct _hb_set_t elt_t elts[ELTS]; /* 8kb */ ASSERT_STATIC (sizeof (elt_t) * 8 == BITS); - ASSERT_STATIC (sizeof (elts) * 8 > MAX_G); + ASSERT_STATIC (sizeof (elt_t) * 8 * ELTS > MAX_G); }; diff --git a/src/main.cc b/src/main.cc index 442b1b9..03b6e6c 100644 --- a/src/main.cc +++ b/src/main.cc @@ -124,10 +124,11 @@ main (int argc, char **argv) const LangSys &langsys = n_langsys == -1 ? script.get_default_lang_sys () : script.get_lang_sys (n_langsys); - printf (n_langsys == -1 - ? " Default Language System\n" - : " Language System %2d of %2d: %.4s\n", n_langsys, num_langsys, - (const char *)script.get_lang_sys_tag (n_langsys)); + if (n_langsys == -1) + printf (" Default Language System\n"); + else + printf (" Language System %2d of %2d: %.4s\n", n_langsys, num_langsys, + (const char *)script.get_lang_sys_tag (n_langsys)); if (langsys.get_required_feature_index () == Index::NOT_FOUND_INDEX) printf (" No required feature\n"); commit a5e39fed85e069ba1afbf90408349ad99ceb0e1d Author: Behdad Esfahbod <[email protected]> Date: Wed Apr 25 00:14:46 2012 -0400 Minor diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh index c7f4aa0..ee489d0 100644 --- a/src/hb-set-private.hh +++ b/src/hb-set-private.hh @@ -38,6 +38,8 @@ struct _hb_set_t inline void init (void) { clear (); } + inline void fini (void) { + } inline void clear (void) { memset (elts, 0, sizeof elts); } diff --git a/src/hb-set.cc b/src/hb-set.cc index 3b1c5bd..0a0bc61 100644 --- a/src/hb-set.cc +++ b/src/hb-set.cc @@ -67,6 +67,8 @@ hb_set_destroy (hb_set_t *set) { if (!hb_object_destroy (set)) return; + set->fini (); + free (set); } commit 1827dc208c867e433a95237d1ed3fc7a73d1d9a7 Author: Behdad Esfahbod <[email protected]> Date: Tue Apr 24 16:56:37 2012 -0400 Add hb_ot_shape_glyphs_closure() Experimental API for now. diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh index d5fc4ce..3811206 100644 --- a/src/hb-ot-map-private.hh +++ b/src/hb-ot-map-private.hh @@ -69,6 +69,10 @@ struct hb_ot_map_t inline void position (hb_font_t *font, hb_buffer_t *buffer) const { apply (1, (hb_ot_map_t::apply_lookup_func_t) hb_ot_layout_position_lookup, font, buffer); } + HB_INTERNAL void substitute_closure (hb_face_t *face, + hb_set_t *glyphs) const; + + inline void finish (void) { features.finish (); lookups[0].finish (); @@ -125,9 +129,6 @@ struct hb_ot_map_t void *face_or_font, hb_buffer_t *buffer) const; - HB_INTERNAL void substitute_closure (hb_face_t *face, - hb_set_t *glyphs) const; - hb_mask_t global_mask; hb_tag_t chosen_script[2]; diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index b31cdc5..167b1d7 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -30,6 +30,7 @@ #include "hb-ot-shape-normalize-private.hh" #include "hb-font-private.hh" +#include "hb-set-private.hh" @@ -478,3 +479,37 @@ _hb_ot_shape (hb_font_t *font, return TRUE; } + + +void +hb_ot_shape_glyphs_closure (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features, + hb_set_t *glyphs) +{ + hb_ot_shape_plan_t plan; + + buffer->guess_properties (); + + hb_ot_shape_plan_internal (&plan, font->face, &buffer->props, features, num_features); + + /* TODO: normalization? have shapers do closure()? */ + /* TODO: Deal with mirrored chars? */ + hb_map_glyphs (font, buffer); + + /* Seed it. It's user's responsibility to have cleard glyphs + * if that's what they desire. */ + unsigned int count = buffer->len; + for (unsigned int i = 0; i < count; i++) + hb_set_add (glyphs, buffer->info[i].codepoint); + + /* And find transitive closure. */ + hb_set_t copy; + copy.init (); + + do { + copy.set (glyphs); + plan.map.substitute_closure (font->face, glyphs); + } while (!copy.equal (glyphs)); +} diff --git a/src/hb-ot.h b/src/hb-ot.h index a4cb371..2d750c3 100644 --- a/src/hb-ot.h +++ b/src/hb-ot.h @@ -34,6 +34,14 @@ #include "hb-ot-tag.h" HB_BEGIN_DECLS + +void +hb_ot_shape_glyphs_closure (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features, + hb_set_t *glyphs); + HB_END_DECLS #undef HB_OT_H_IN diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh index 660aaee..c7f4aa0 100644 --- a/src/hb-set-private.hh +++ b/src/hb-set-private.hh @@ -35,6 +35,9 @@ struct _hb_set_t { + inline void init (void) { + clear (); + } inline void clear (void) { memset (elts, 0, sizeof elts); } commit bb09f0ec10216b11189b5e8584856adf0f14d1fc Author: Behdad Esfahbod <[email protected]> Date: Tue Apr 24 16:02:12 2012 -0400 Minor diff --git a/src/hb-unicode.cc b/src/hb-unicode.cc index a660ccc..f2fbebb 100644 --- a/src/hb-unicode.cc +++ b/src/hb-unicode.cc @@ -85,7 +85,6 @@ hb_unicode_compose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t *ab HB_UNUSED, void *user_data HB_UNUSED) { - /* TODO handle Hangul jamo here? */ return FALSE; } @@ -96,7 +95,6 @@ hb_unicode_decompose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t *b HB_UNUSED, void *user_data HB_UNUSED) { - /* TODO handle Hangul jamo here? */ return FALSE; } commit 29a7e306e30e894f7a38daf73eca9fc772c58158 Author: Behdad Esfahbod <[email protected]> Date: Tue Apr 24 16:01:30 2012 -0400 Minor diff --git a/src/hb-ot-shape-normalize.cc b/src/hb-ot-shape-normalize.cc index b9834ca..0bcf7f5 100644 --- a/src/hb-ot-shape-normalize.cc +++ b/src/hb-ot-shape-normalize.cc @@ -269,6 +269,7 @@ _hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer, { /* Composes. Modify starter and carry on. */ buffer->out_info[starter].codepoint = composed; + /* XXX update cluster */ set_unicode_props (&buffer->out_info[starter], buffer->unicode); buffer->skip_glyph (); commit 585b107cdee7305920dacc83c9ee1f8eeff7afd1 Author: Behdad Esfahbod <[email protected]> Date: Tue Apr 24 16:00:50 2012 -0400 Add test caes for a minority language using Bengali U+0985 BENGALI LETTER A followed by U+09D7 BENGALI AU LENGTH MARK. According to Bobby de Vos on the mailing list, this results in a dotted circle with most shaping engines, but is a legitimate sequence in this minority language. We reached the consensus on the list to NOT implement dotted-circle in HarfBuzz. diff --git a/test/shaping/texts/in-tree/shaper-indic/indic/script-bengali/misc/misc.txt b/test/shaping/texts/in-tree/shaper-indic/indic/script-bengali/misc/misc.txt index a5331c6..c208625 100644 --- a/test/shaping/texts/in-tree/shaper-indic/indic/script-bengali/misc/misc.txt +++ b/test/shaping/texts/in-tree/shaper-indic/indic/script-bengali/misc/misc.txt @@ -46,3 +46,4 @@ রà§à¦ à§°à§à¦ à§±à§à¦ +ঠà§
_______________________________________________ HarfBuzz mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/harfbuzz
