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

[wish] Pure OT shaping: disabling non-canonic convenience functionality (normalization, fallback, synthesis) #80

Closed
twardoch opened this issue Jan 22, 2015 · 5 comments

Comments

@twardoch
Copy link

Introduce ways to disable functionalities of the "ot" shaping backend which are not canonical to OpenType Layout, including:

  • normalization
  • synthetic GDEF
  • fallback glyph positioning
  • fallback Arabic and Thai

etc.

Behdad already stated his intent to do this, and this is the issue to track it.

@behdad
Copy link
Member

behdad commented Jan 23, 2015

Technically synthesized GDEF is part of OpenType requirements.

@behdad
Copy link
Member

behdad commented Jan 23, 2015

In particular, in this page:

http://www.microsoft.com/typography/otspec/GDEF.htm

There's this text:

"""If the font does not include a GlyphClassDef table, the client must define and maintain this information when using the GSUB and GPOS tables."""

@twardoch
Copy link
Author

Good point. I'd leave it in, then. The other issues bother me more. For testing purposes, synth GDEF can be worked around very easily (by supplying an empty GlyphClassDef). The other behaviors are a bit more tricky to catch, and thus more misleading. Also, I guess they're the ones where HarfBuzz does "more" than other engines do.

@behdad
Copy link
Member

behdad commented Apr 19, 2015

Ok lets see what you can do without HarfBuzz as is:

Normalization can be fully disabled if you use hb_unicode_funcs_create(hb_unicode_funcs_get_default) and then set compose(), decompose(), and decompose_compatibility() callbacks that do nothing (return false / 0).

Fallback positioning can be disabled if you similarly use a font_funcs implementation that returns false for get_glyph_extents(). Also see hb_font_create_sub_font(). You don't need to modify your existing font_funcs, you can provide an overlay that disables get_glyph_extents(), similar to the unicode_funcs approach.

The fallback Thai shaping (ie. the shape-to-PUA) is automatically disabled if the font has a GSUB script for Thai.

The fallback Arabic shaping is automatically disabled if the font has at least one of init/medi/fini/isol.

I think I still want to implement a pure mode in the API, but this should unblock anyone needing that today.

@behdad
Copy link
Member

behdad commented Jul 22, 2015

So talking to Jonathan, we think we want to allow disabling these:

  • Fallback Arabic shaping,
  • fallback Thai shaping,
  • fallback positioning

on the grounds that these are neither part of OpenType, nor Unicode. I'm leaning towards disabling them all together, with no fine-grained control.

@behdad behdad closed this as completed Mar 2, 2017
gpgreen pushed a commit to gpgreen/harfbuzz that referenced this issue Jan 10, 2024
disable .so files

Fix harfbuzz#79

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-harfbuzz/80)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants