Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation incorrect about default application of “liga” #2213

Closed
NorbertLindenberg opened this issue Feb 29, 2020 · 10 comments · Fixed by #2665
Closed

Documentation incorrect about default application of “liga” #2213

NorbertLindenberg opened this issue Feb 29, 2020 · 10 comments · Fixed by #2665
Assignees

Comments

@NorbertLindenberg
Copy link

The HarfBuzz documentation at
https://harfbuzz.github.io/shaping-opentype-features.html
says that for horizontal text the “liga” and “frac” features (among others) are enabled by default.

In testing with Brahmic scripts (9 × Indic, Khmer, Lao, Myanmar, Thai, Balinese, Sinhala, Tibetan) on Chrome 80, I found that not always to be the case. “frac” doesn’t seem to be enabled for any of these scripts, and “liga” only for Lao, Thai, and the USE scripts (which don’t include Sinhala yet in HarfBuzz).

“frac” isn’t applied to Brahmic scripts by CoreText and DirectWrite either, so it’s probably best to update the documentation to say for which scripts / engines HarfBuzz actually turns it on by default.

I see “liga” being applied to all Brahmic scripts by default by CoreText, and to Lao, Myanmar, Thai, and the USE scripts by DirectWrite. This means here the right answer isn’t obvious in the absence of a standard.

@khaledhosny
Copy link
Collaborator

frac is applied selectively to number(s) fraction slash number(s) sequences.

@NorbertLindenberg
Copy link
Author

I see – thank you! Also, “frac” is only applied if the digit glyphs haven’t been substituted yet. After accounting for that in my tests, I see that HarfBuzz indeed applies “frac” across all the scripts I’m testing with. CoreText and DirectWrite still don’t.

@NorbertLindenberg NorbertLindenberg changed the title Documentation incorrect about default application of “liga” and “frac” Documentation incorrect about default application of “liga” Mar 1, 2020
@khaledhosny
Copy link
Collaborator

khaledhosny commented Mar 1, 2020

It is known that HarfBuzz application of frac (and also numr/dnom) by default is a unique HarfBuzz feature, which is meant to enable the Unicode-specified behavior of the fraction slash. From https://www.unicode.org/versions/Unicode12.0.0/ch06.pdf:

Fraction Slash. U+2044 fraction slash is used between digits to form numeric fractions, such as 2/3 and 3/9. The standard form of a fraction built using the fraction slash is defined as follows: any sequence of one or more decimal digits (General Category = Nd), followed by the fraction slash, followed by any sequence of one or more decimal digits. Such a fraction should be displayed as a unit, such as ¾ or [3/4]. The precise choice of display can depend on additional formatting information.

@khaledhosny
Copy link
Collaborator

Looks like indic, khmer, and myanmar shapers explicitly disable liga. Few other shapers explicitly disable feature that are otherwise enabled for all scripts, so we need to list them all.

@khaledhosny
Copy link
Collaborator

#2665

@behdad
Copy link
Member

behdad commented Sep 2, 2020

Looks like indic, khmer, and myanmar shapers explicitly disable liga.

Every time we disabled a feature, it was because there were fonts that misrendered. Ie. Uniscribe doesn't applying that feature and fonts in the wild were referring to them and relying on them NOT being applied. I'm sure that was the case for Khmer. Don't remember about Indic/Myanmar. Some git archeology might suggest why it was done.

I think was done in Indic shaper because Khmer was originally shaped with Indic shaper. Myanmar was forked off the Indic shaper so that's probably why is disabled there. Later we forked Khmer off Indic as well. So miight be doable to enable liga in Myanmar & Indic and just leave it off in Khmer.

@behdad
Copy link
Member

behdad commented Sep 2, 2020

Yep, this was done in 2012 in 6b389dd
That commit is short on details. What I said is accurate I believe.
cc @jfkthame

@behdad
Copy link
Member

behdad commented Sep 2, 2020

See how same change was done re kern: eb10233

@khaledhosny
Copy link
Collaborator

I tested Indic (Oriya) and Myanmar with Uniscribe, it enables liga for Myanmar but not for Indic. I opened #2681 for the Myanmar shaper.

@khaledhosny
Copy link
Collaborator

One difference between HarfBuzz and Uniscribe (I don’t know if it is known), is that with HarfBuzz features disabled by the shaper can’t be overridden by the user, while it can be overridden with Uniscribe (i.e. --features="+liga" makes no difference with ot shaper but enables the feature with uniscribe).

@khaledhosny khaledhosny assigned khaledhosny and unassigned n8willis Sep 12, 2020
dscorbett pushed a commit that referenced this issue Sep 28, 2020
This seems to have been carried over from the Indic shaper, but
Uniscribe enables it by default.

See #2213 (comment)
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 a pull request may close this issue.

4 participants