-
Notifications
You must be signed in to change notification settings - Fork 591
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
[shape] Add dedicated OpenType and AAT shapers #4269
base: main
Are you sure you want to change the base?
Conversation
This is the main HarfBuzz shaper and it does OpenType or AAT shaping using based on the available font tables, and it never fails. We will introduce “ot” and “aat” shaper that do only OpenType or AAT shaping and fail otherwise.
They currently fail if relevant tables are missing, but don’t actually enforce the relevant shaping model.
This is a good start. But I think you need to tell the shaper which mode it's operating under. If a font has morx+GPOS, right now the |
Also, I think both those shapers should NOT fail if their layout tables are missing. We just need to communicate to the main shaper what layout tables to prefer / what not to pick up. Shaping without layout tables is fine I think, no? |
Maybe lets sketch out what exactly the two should do first. |
Yes, this is just a sketch, and I wanted to get your input before going further.
So I suppose there are a few situations to handle:
For the first 3 cases I don’t want anything to change, shaping should continue as it does not. For the last case I want OpenType layout tables to take precedence. My idea is to order the shapers as following: In my use case I wouldn’t use I can imagine |
@behdad does any of what I wrote above make sense? |
I've been travelling. Will respond soon. |
Okay the main thing I'm uncomfortable with is suddenly making "ot" shaper fail at all. This wasn't the case before. I'm fine if it starts ignoring "aat" tables, but failing might be bad. I know there are a client or more that explicitly pass "ot"... |
The way I see it is rather:
shaper order will have "hb" at the top. |
My reasoning is that "no layout table" is valid OpenType / AAT shaping. So we shouldn't fail. |
But if the shapers don’t fail, then if I set |
I can see two options for "ot", does any of these satisfy your requirements:
|
OK, so another idea. Make the new bool has_aat = hb_aat_layout_has_substitution(face) || hb_aat_layout_has_positioning(face);
bool has_ot = hb_ot_layout_has_substitution(face) || hb_ot_layout_has_positioning(face);
if (has_aat && has_ot)
// hybrid font, we want OT
shapers = {"ot", "fallback"};
else
// Keep HarfBuzz defaults
shapers = default_shapers; |
But if "ot" always tries ot before aat, then you won't even need the conditional, right? |
Or is that what you want to avoid? |
@jfkthame can we get some direction here? |
Right, I wouldn’t need it indeed. Not for my use case here. |
Fixes #4108