Closed bluebear94 closed 1 year ago
It seems that the if (indic_plan->is_old_spec || end - start > 127)
branch in initial_reordering_consonant_syllable
is taken by HarfBuzz in the cluster_004
test, but the equivalent branch in RustyBuzz is not.
In HB’s data_create_indic
, plan->map.chosen_script[0]
turns out to be 0xFFFF
. Why this value, I don’t know, but changing line 479 of our complex/indic.rs
to
.map_or(true, |tag| tag.to_bytes()[3] != b'2');
makes cluster_004
pass.
In HB’s data_create_indic, plan->map.chosen_script[0] turns out to be 0xFFFF.
0xFFFF is a special value in GSUB/GPOS. Maybe this.
Also:
/**
* HB_OT_LAYOUT_NO_SCRIPT_INDEX:
*
* Special value for script index indicating unsupported script.
*/
#define HB_OT_LAYOUT_NO_SCRIPT_INDEX 0xFFFFu
In rustybuzz we use None
instead of 0xFFFF. Which leads to this confusion.
But also, I have no idea what (plan->map.chosen_script[0] & 0x000000FFu) != '2'
suppose to check.
@behdad Would you mind clarifying this line of code? I know it's 11 years old, but still.
(plan->map.get_chosen_script (0) & 0x000000FF) != '2'
Why we're checking the last byte and why it must not be '2'
/0x32?
@bluebear94 https://github.com/harfbuzz/harfbuzz/commit/855a3f478eea5b770e64611d09fd347336c56b67 doesn't affect us, right?
Or you haven't finished 2.8.2 yet?
@bluebear94 harfbuzz/harfbuzz@855a3f4 doesn't affect us, right?
I don’t believe it does.
Or you haven't finished 2.8.2 yet?
No, I still have some commits to go through.
I think these cover all the relevant changes.
All good. Thanks!
5257 commits left...
@behdad Would you mind clarifying this line of code? I know it's 11 years old, but still.
(plan->map.get_chosen_script (0) & 0x000000FF) != '2'
Why we're checking the last byte and why it must not be
'2'
/0x32?
This is checking for old Indic script tags (deva
vs dev2
) the old tags trigger an old (and obsolete) processing model for backward compatibility with fonts designed against the old OpenType Indic spec.
Thanks. Not it makes sense.
(plan->map.get_chosen_script (0) & 0x000000FF) != '2'
The Indic scripts have two tags. Old and new. The old tag for Devanagari is deva
whereas the new tag is dev2
. All the new tags end with 2
.
@behdad Thanks!
Troublesome commits so far:
in_house::cluster_004
test fails:Could this be another rounding error?Not likely, the things that are wrong are the cluster indices.