Skip to content

Conversation

jfkthame
Copy link
Collaborator

See mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=986802.

Testcase for this is to use arial.ttf from Windows XP, and disable the 'liga' feature; the lam-alef ligature should still happen, because requiredFeature points to the 'rlig' feature, but this will only work if it is processed at the proper stage, not if its lookups are inserted before all others.

Expected result:
$ ./test/shaping/hb-unicode-encode 644,627 | BUILD/util/hb-shape arial-winxp.ttf --features liga=0
[afii62840=0+1114]

Without this patch, we get:
$ ./test/shaping/hb-unicode-encode 644,627 | BUILD/util/hb-shape arial-winxp.ttf --features liga=0
[afii62760=1+470|afii62817=0+424]

because the 'rlig' lookup is applied too early, before the basic joining forms.

jfkthame and others added 30 commits January 20, 2014 14:23
… including Old Hangul sequences that don't have Unicode compositions. Merge clusters in decomposed syllables.
…as some fonts want these to be visible/spacing glyphs.
I believe Windows 8 disables it, and spec update dated
Jan 2014 also clearly says it's disabled by default:

  http://www.microsoft.com/typography/OpenTypeDev/arabic/intro.htm#features
The OT shaper supersedes the fallback shaper in every case
and the latter become an extra weight for 99.9% of users.
See thread "[HarfBuzz] compilation error of 0.9.26 with MinGW"
started by Werner.
Seems like configure.ac is already able to handle it.
Apparently some modern fonts have proper GPOS mark positioning
tables, but undesirable precomposed forms!  See thread
"Hebrew composition to presentation forms" and:

  http://tex.stackexchange.com/questions/156775/having-trouble-with-vowel-positioning-in-ezra-sil-xelatex

Test case: U+fb1d,05d9,05b4
Useful for Android / Chrome / etc when ICU is built in the same
library as harfbuzz itself.
This is a higher-priority shaper than default shaper ("ot"), but
only picks up fonts that have AAT "morx"/"mort" table.

Note that for this to work the font face's get_table() implementation
should know how to return the full font blob.

Based on patch from Konstantin Ritt.
behdad and others added 21 commits April 27, 2014 13:24
On iOS CoreText and CoreGraphics are stand-alone frameworks
Many GCC versions don't define __arm64__
As requested by Martin Hosken on the list.
Disables any cluster-merging.  Added for testing purposes while
we investigate what kind of API to add for this.
commit b5a0f69
Author: Behdad Esfahbod <behdad@behdad.org>
Date:   Thu Oct 17 18:04:23 2013 +0200

    [indic] Pass zero-context=false to would_substitute for newer scripts

    For scripts without an old/new spec distinction, use zero-context=false.
    This changes behavior in Sinhala / Khmer, but doesn't seem to regress.
    This will be useful and used in Javanese.

The *intention* was to change zero-context from true to false for scripts that
don't have old-vs-new specs.  However, checking the code, looks like we
essentially change zero-context to always be true; ie. we only changed things
for old-spec, and we broke them.  That's what causes this bug:

  https://bugs.freedesktop.org/show_bug.cgi?id=76705

The root of the bug is here:

  /* Use zero-context would_substitute() matching for new-spec of the main
   * Indic scripts, but not for old-spec or scripts with one spec only. */
  bool zero_context = indic_plan->config->has_old_spec || !indic_plan->is_old_spec;

Note that is_old_spec itself is:

  indic_plan->is_old_spec = indic_plan->config->has_old_spec && ((plan->map.chosen_script[0] & 0x000000FF) != '2');

It's easy to show that zero_context is now always true.  What we really meant was:

  bool zero_context = indic_plan->config->has_old_spec && !indic_plan->is_old_spec;

Ie, "&&" instead of "||".  We made this change supposedly to make Javanese
work.  But apparently we got it working regardless!  So I'm going to fix this
to only change the logic for old-spec and not touch other cases.
@behdad
Copy link
Member

behdad commented Apr 28, 2014

Thanks Jonathan.

Three points:

  1. I'd add the new feature_tag argument after the existing feature_index. I've done that here: 935abef
  2. Given that 'locl' feature is applied in first stage, I think applying RequiredFeature after everything else (ie. in the last stage) is most useful.
  3. What I don't like about your approach is that it disables some lookups that might have been enabled previously. Eg. if the font designer sets a RequiredFeature that happens to be called 'liga', then we won't apply the normal 'liga' anymore even though we should...

I think I really prefer to just move the RequiredFeature application to the last stage. Your approach is quite neat, but makes too much assumptions on the tag of the feature being set correctly.

I'm undecided, please advise which way you think we should take this.

@behdad behdad closed this in da13293 Jun 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants