-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add LTR script kerning to DFLT for InDesign default composer #787
Conversation
un-kerned you mean? In the old kernFeatureWriter we had more complex logic as to what and when to use DFLT script for which kern/dist lookup: ufo2ft/Lib/ufo2ft/featureWriters/kernFeatureWriter2.py Lines 452 to 497 in 8a512b8
whereas here you seem to unilaterally opt for LTR kern in DFLT.. Could we port some of that logic in here? |
I imagine it's not just indesign that uses DFLT when no explicit script/language is requested, that's what DFLT is supposed to be meant for, so the issue that we leave DFLT unkerned is more general than Indesign itself. |
Yes, un-kerned! |
at least we could implement the simple unequivocal cases when there is no doubt what DFLT can contain, if only LTR or RTL are present. I do see what you mean that "for RTL script you need to switch to the "good" composer anyway, so no need to bother", so I'd be inclined to accept that view that LTR be the default (also because we have no way to specify what the user intention is in the source) |
OK, I'll read through the old feature writer and see how I could apply the same logic to the new one |
in ambiguous cases the old writer would bail out with an error, arguably too harsh. Besides, having re-read that code, it looks like it is not doing what you want, i.e. ensuring that DFLT contains at least the LTR stuff; when langsyses contain both LTR and RTL, and we produce both LTR and RTL lookups, it is only registering under the respective scripts and not adding anything to DFTL; when langsyses contain one set of scripts and not the other one, and we have two kinds of lookups to register, it adds to DFLT the lookups for which we have no explict langsys definitions (which is kind of the opposite of what you want); finally, when there's only one set of lookups, it always registers them under the relevant langsys (if any) and also always under DFLT. I think only the latter part of the code is worth carrying over to the new writer. In addition, we can keep this proposed behaviour to default to LTR in DFLT when when have mixed LTR and RTL scripts/lookups, with the understanding that RTL being more 'advanced' for "dumb" text applications and requires one to define a RTL language for full OTL support. |
@anthrotype I'm with you on what the old writer was doing (= not exactly what I want: I want to always have kerning in DFLT, even if the feature file has all the languagesystem declarations)
Is this what you propose: Currently in my PR:
Your proposed change:
Basically default to registering LTR lookups, but if there are none, register the RTL lookups instead? Or is it something else? |
Yes sound good to me |
@anthrotype I've applied your feedback |
Should I leave a day or two before merging to check if anyone else has objections to this? Or does it seem straightforward enough? |
nah, it's fine. We can always pin a version or revert as needed |
Hello, this is an Adobe-specific "fix" for the following situation: in InDesign, using the default paragraph composer (not World-ready), and having no language selected, InDesign will not bother detecting the actual script of the text runs, and use the appropriate kerning; instead it sticks to only what is registered in the DFLT script.
With the split by script kerning, there's very little kerning under DFLT and it looks as though the font is unkerned.
In this PR I'm registering all the LTR script lookups under DFLT, so that InDesign applies that kerning even when no language is selected. The idea is that for RTL scripts you need to switch to the "good" composer anyway, so no need to bother.