[HarfBuzz] harfbuzz: Branch 'master' - 7 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Mon Oct 29 22:05:12 PDT 2012
src/hb-buffer-private.hh | 1
src/hb-buffer.cc | 13 +++
src/hb-ot-layout-gsub-table.hh | 1
src/hb-ot-layout-gsubgpos-private.hh | 15 ++--
src/hb-ot-shape-complex-arabic.cc | 3
src/hb-ot-shape-complex-indic.cc | 35 ++++++----
test/shaping/hb_test_tools.py | 1
test/shaping/texts/in-tree/shaper-default/script-ethiopic/MANIFEST | 1
test/shaping/texts/in-tree/shaper-default/script-ethiopic/misc/MANIFEST | 1
test/shaping/texts/in-tree/shaper-default/script-ethiopic/misc/misc.txt | 1
10 files changed, 50 insertions(+), 22 deletions(-)
New commits:
commit 0bc7a38463bfb37f12efeb1b8cb2024cf4a347bc
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Oct 29 22:02:45 2012 -0700
[OT] Fix ReverseChainingSubst
We should make it clear that we don't want output buffer in this case,
otherwise buffer->backtrack_len() would be wrong.
diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh
index 67a2752..c1acffd 100644
--- a/src/hb-buffer-private.hh
+++ b/src/hb-buffer-private.hh
@@ -153,6 +153,7 @@ struct hb_buffer_t {
HB_INTERNAL void guess_properties (void);
HB_INTERNAL void swap_buffers (void);
+ HB_INTERNAL void remove_output (void);
HB_INTERNAL void clear_output (void);
HB_INTERNAL void clear_positions (void);
diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index b65beff..1eb513c 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -183,6 +183,19 @@ hb_buffer_t::add (hb_codepoint_t codepoint,
}
void
+hb_buffer_t::remove_output (void)
+{
+ if (unlikely (hb_object_is_inert (this)))
+ return;
+
+ have_output = false;
+ have_positions = false;
+
+ out_len = 0;
+ out_info = info;
+}
+
+void
hb_buffer_t::clear_output (void)
{
if (unlikely (hb_object_is_inert (this)))
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index 90faa79..05b18cc 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -1343,6 +1343,7 @@ struct SubstLookup : Lookup
else
{
/* in-place backward substitution */
+ c->buffer->remove_output ();
c->buffer->idx = c->buffer->len - 1;
do
{
commit 2616689d159024d2b1cb1e68f9936b2129bf9be6
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Oct 29 21:51:56 2012 -0700
More tracing fixups
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index 79e4b86..dd7bdd3 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -459,7 +459,7 @@ static inline bool match_input (hb_apply_context_t *c,
if (!skippy_iter.next (&property)) return TRACE_RETURN (false);
- if (likely (!match_func (c->buffer->info[skippy_iter.idx].codepoint, input[i - 1], match_data))) return false;
+ if (likely (!match_func (c->buffer->info[skippy_iter.idx].codepoint, input[i - 1], match_data))) return TRACE_RETURN (false);
unsigned int this_lig_id = get_lig_id (c->buffer->info[skippy_iter.idx]);
unsigned int this_lig_comp = get_lig_comp (c->buffer->info[skippy_iter.idx]);
@@ -655,9 +655,10 @@ static inline bool apply_lookup (hb_apply_context_t *c,
const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */
apply_lookup_func_t apply_func)
{
+ hb_auto_trace_t<HB_DEBUG_APPLY> trace (&c->debug_depth, "APPLY", NULL, HB_FUNC, "idx %d codepoint %u", c->buffer->idx, c->buffer->cur().codepoint);
unsigned int end = c->buffer->len;
if (unlikely (count == 0 || c->buffer->idx + count > end))
- return false;
+ return TRACE_RETURN (false);
/* TODO We don't support lookupRecord arrays that are not increasing:
* Should be easy for in_place ones at least. */
@@ -669,13 +670,13 @@ static inline bool apply_lookup (hb_apply_context_t *c,
for (unsigned int i = 0; i < count; /* NOP */)
{
if (unlikely (c->buffer->idx == end))
- return true;
+ return TRACE_RETURN (true);
while (c->should_mark_skip_current_glyph ())
{
/* No lookup applied for this index */
c->buffer->next_glyph ();
if (unlikely (c->buffer->idx == end))
- return true;
+ return TRACE_RETURN (true);
}
if (lookupCount && i == lookupRecord->sequenceIndex)
@@ -690,7 +691,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
/* Err, this is wrong if the lookup jumped over some glyphs */
i += c->buffer->idx - old_pos;
if (unlikely (c->buffer->idx == end))
- return true;
+ return TRACE_RETURN (true);
if (!done)
goto not_applied;
@@ -704,7 +705,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
}
}
- return true;
+ return TRACE_RETURN (true);
}
commit 937f8d3871863b8b1ed1d8900cf41999d92ba30f
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Oct 29 21:49:33 2012 -0700
[Arabic] Enable dlig and mset for Arabic
That's what the spec says, and what Uniscribe does.
diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc
index 5720891..8428534 100644
--- a/src/hb-ot-shape-complex-arabic.cc
+++ b/src/hb-ot-shape-complex-arabic.cc
@@ -178,8 +178,9 @@ collect_features_arabic (hb_ot_shape_planner_t *plan)
map->add_bool_feature (HB_TAG('c','a','l','t'));
map->add_gsub_pause (NULL);
- /* ArabicOT spec enables 'cswh' for Arabic where as for basic shaper it's disabled by default. */
map->add_bool_feature (HB_TAG('c','s','w','h'));
+ map->add_bool_feature (HB_TAG('d','l','i','g'));
+ map->add_bool_feature (HB_TAG('m','s','e','t'));
}
#include "hb-ot-shape-complex-arabic-fallback.hh"
commit 911ed096980630fd4a37bf2024036daae13a6056
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Oct 29 19:42:19 2012 -0700
Ignore gid0 in test results
diff --git a/test/shaping/hb_test_tools.py b/test/shaping/hb_test_tools.py
index 0b1ec00..6139ec1 100644
--- a/test/shaping/hb_test_tools.py
+++ b/test/shaping/hb_test_tools.py
@@ -299,6 +299,7 @@ class DiffHelpers:
if any (l.find("uni25CC") >= 0 for l in lines if l[0] == '+'): return True
if any (l.find("dottedcircle") >= 0 for l in lines if l[0] == '+'): return True
if any (l.find("glyph0") >= 0 for l in lines if l[0] == '+'): return True
+ if any (l.find("gid0") >= 0 for l in lines if l[0] == '+'): return True
if any (l.find("notdef") >= 0 for l in lines if l[0] == '+'): return True
return all (l[0] == ' ' for l in lines)
commit bc513add7999baf32f126ceebbd318105ee66985
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Oct 29 19:03:55 2012 -0700
Add missing TRACE_RETURN
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index da31bdf..79e4b86 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -491,7 +491,7 @@ static inline bool match_input (hb_apply_context_t *c,
if (p_total_component_count)
*p_total_component_count = total_component_count;
- return true;
+ return TRACE_RETURN (true);
}
static inline void ligate_input (hb_apply_context_t *c,
unsigned int count, /* Including the first glyph (not matched) */
commit 10b88d89ef1efcfddbbfabd3669399b472c8a900
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Oct 29 18:18:24 2012 -0700
Add Ethiopic test case
This sequence: U+120B,U+135F,U+120B with the Nyala font from Win7
exposes a GPOS bug in Uniscribe, in that the positioned mark is wrongly
moved as a result a following kern.
This is the one "failure" in the Ethiopic test suite :-).
ETHIOPIC: 118900 out of 118901 tests passed. 1 failed (0.000841036%)
diff --git a/test/shaping/texts/in-tree/shaper-default/script-ethiopic/MANIFEST b/test/shaping/texts/in-tree/shaper-default/script-ethiopic/MANIFEST
new file mode 100644
index 0000000..b8752e7
--- /dev/null
+++ b/test/shaping/texts/in-tree/shaper-default/script-ethiopic/MANIFEST
@@ -0,0 +1 @@
+misc
diff --git a/test/shaping/texts/in-tree/shaper-default/script-ethiopic/misc/MANIFEST b/test/shaping/texts/in-tree/shaper-default/script-ethiopic/misc/MANIFEST
new file mode 100644
index 0000000..29cfb2f
--- /dev/null
+++ b/test/shaping/texts/in-tree/shaper-default/script-ethiopic/misc/MANIFEST
@@ -0,0 +1 @@
+misc.txt
diff --git a/test/shaping/texts/in-tree/shaper-default/script-ethiopic/misc/misc.txt b/test/shaping/texts/in-tree/shaper-default/script-ethiopic/misc/misc.txt
new file mode 100644
index 0000000..60dd8cc
--- /dev/null
+++ b/test/shaping/texts/in-tree/shaper-default/script-ethiopic/misc/misc.txt
@@ -0,0 +1 @@
+ááá
commit 88d3c98e309e14c3115825d1d8d40d0b3eec2d97
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Oct 29 16:27:02 2012 -0700
[Indic] Position pre-base reordering Ra after Chillus in Malayalam
The logic for pre-base reordering follows the left matra logic.
We had an exception for Malayalam/Tamil in the left matra repositioning
which was not reflected in pre-base reordering.
Malayalam failures down from 337 to 323.
BENGALI: 353996 out of 354285 tests passed. 289 failed (0.0815727%)
DEVANAGARI: 707339 out of 707394 tests passed. 55 failed (0.00777502%)
GUJARATI: 366489 out of 366506 tests passed. 17 failed (0.0046384%)
GURMUKHI: 60769 out of 60809 tests passed. 40 failed (0.0657797%)
KANNADA: 951086 out of 951913 tests passed. 827 failed (0.0868777%)
KHMER: 299106 out of 299124 tests passed. 18 failed (0.00601757%)
LAO: 53611 out of 53644 tests passed. 33 failed (0.0615167%)
MALAYALAM: 1048011 out of 1048334 tests passed. 323 failed (0.0308108%)
ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%)
SINHALA: 271726 out of 271847 tests passed. 121 failed (0.0445103%)
TAMIL: 1091837 out of 1091837 tests passed. 0 failed (0%)
TELUGU: 970558 out of 970573 tests passed. 15 failed (0.00154548%)
TIBETAN: 208469 out of 208469 tests passed. 0 failed (0%)
diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index 6a87c1e..30a9a1f 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -1157,21 +1157,28 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
*/
unsigned int new_pos = base;
- while (new_pos > start &&
- !(is_one_of (info[new_pos - 1], FLAG(OT_M) | HALANT_OR_COENG_FLAGS)))
- new_pos--;
-
- /* In Khmer coeng model, a V,Ra can go *after* matras. If it goes after a
- * split matra, it should be reordered to *before* the left part of such matra. */
- if (new_pos > start && info[new_pos - 1].indic_category() == OT_M)
+ /* Malayalam / Tamil do not have "half" forms or explicit virama forms.
+ * The glyphs formed by 'half' are Chillus or ligated explicit viramas.
+ * We want to position matra after them.
+ */
+ if (buffer->props.script != HB_SCRIPT_MALAYALAM && buffer->props.script != HB_SCRIPT_TAMIL)
{
- unsigned int old_pos = i;
- for (unsigned int i = base + 1; i < old_pos; i++)
- if (info[i].indic_category() == OT_M)
- {
- new_pos--;
- break;
- }
+ while (new_pos > start &&
+ !(is_one_of (info[new_pos - 1], FLAG(OT_M) | HALANT_OR_COENG_FLAGS)))
+ new_pos--;
+
+ /* In Khmer coeng model, a V,Ra can go *after* matras. If it goes after a
+ * split matra, it should be reordered to *before* the left part of such matra. */
+ if (new_pos > start && info[new_pos - 1].indic_category() == OT_M)
+ {
+ unsigned int old_pos = i;
+ for (unsigned int i = base + 1; i < old_pos; i++)
+ if (info[i].indic_category() == OT_M)
+ {
+ new_pos--;
+ break;
+ }
+ }
}
if (new_pos > start && is_halant_or_coeng (info[new_pos - 1]))
More information about the HarfBuzz
mailing list