-
Notifications
You must be signed in to change notification settings - Fork 30
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
Kerning pairs should be defined as "visual left to right" #96
Comments
Agreed on closing the previous issue and starting a focused discussion, this has been dragging out too long (I know I am guilty here). I believe one thought was to change the plists to |
I've opened #97 to track vertical kerning. I think the renaming of |
I'm not sure if this is going to solve an issue. I've made a kerning tool that interprets any pair with an I can't see a situation that making the order visual, would solve a problem but maybe it's just because I haven't encountered that kerning pair. |
As for neutral pairs like |
@typoman it's not neutral when the kerning is stored as writing direction, it leads to abiguity (for example see this comment). Trust me, I used to think that storing kerning in the writing direction order made the most sense or tagging pairs with direction (LTR, RTL, both), but I've come around to what @behdad has been saying: UFO2 was right, visual order is the best encoding for this. |
I also believe that visual order is more logical. What I'm not sure is if this is going to solve an issue or create more issues later, since everything works fine now. |
It won't be an easy transition, and I'm sure there will be issues because of this transition, but it will ultimately be worth it. |
And, to be very clear, any change to how kerning is encoded would mean a new file, like |
Exactly. Add a |
|
@anthrotype gave me a thorough explanation about how things are changing and why this makes sense. I'm going to put a summary of what I understood from his explanation here on how this is changing the compiler behaviour. This example shows how the encoding of an example neutral kerning pair works in the two specs. Visual left to right order encodingUFO
ufo2ft kern feapos parentheses period -30; # inside an LTR lookup
pos period parentheses <-30 0 -30 0>; # inside an RTL lookup Logical order encodingUFO
ufo2ft kern feapos parentheses period -30; # inside a dflt script lookup Because the current spec sates the kerning pairs are written in logical order, there is no way to tell if the increase/decrease was in which direction (maybe LTR and RTL, maybe only one). But with visual order (neutral) this pair will be interpreted as an increase/decrease in space between those glyphs regardless of the direction and will be encoded in both LTR/RTL lookups (depending on what scripts are already present in the feature file). I hope I got this right but please correct me if I'm wrong. |
So let's say I'm writing an UFO version 3 for a font that has only Hebrew letters and some Latin punctuation. I have 3 kerning pairs: LEFT: /mem-hb, RIGHT: /dalet-hb, VALUE: -20 How am I supposed to store this in kerning.plist ?
where the visual /slash/period is assumed to be used for RTL only (because no other strong scripts are in the font)? But what happens if also Latin letters are present?
I'm talking about UFO 3, not UFO 4. |
of course that's a rethorical question and the answer is "you can't", which is the main reason this issue exists. Would be nice to make progress on this front after three years of inactivity, we just need a "champion" that wants to carry this through the final line |
|
since slash and period are both neutral direction-wise, and there's no way to guess whether font developer wants to reduce by -50 the xadvance of slash when it precedes a period in a LTR run of text, and/or reduce both xadvance and xorigin of period by -50 when it precedes a slash in a RTL run, one might argue that one should interpret a pair such as {("slash", "period"): -50} in kerning.plist as visual left/right terms, thus do |
UFO3 defines kerning pairs as "in writing direction", which is confusing and ambiguous, as documented in #16.
That issue is a mess, and it's hard to find important comments such as #16 (comment) and #16 (comment), so I propose to close it in favor of this one, where we can focus on the solution.
It seem the consensus is that the next major version of UFO should define kerning pairs as "visual left to right", to avoid ambiguity (as it was in UFO2).
We should come up with a recommendation of how to upconvert existing mixed LTR/RTL kerning. A special point of interest would be the naming of kern groups:
public.kern1.*
groups used in UFO3 RTL kerning should becomepublic.kern2.*
and vice versa, which may cause name clashes.The text was updated successfully, but these errors were encountered: