Conversation
|
There are a lot of duplicate |
i guess, when you're done with the kerning, you can pass again on the groups and remove those that aren't actually used anywhere in the kerning dict |
About round-trippingThe way I see it, it's not easily possible, for the same reasons we were stuck at earlier: lack of directional data for single glyph kerning. Theoretically it should happen here: def to_glyphs_kerning(self):
"""Add UFO kerning to GSFont."""
for master_id, source in self._sources.items():
for (left, right), value in source.font.kerning.items():
if BRACKET_GLYPH_RE.match(left) or BRACKET_GLYPH_RE.match(right):
# Skip all bracket glyph entries, as they are duplicates of their
# parents'.
continue
left_match = UFO_KERN_GROUP_PATTERN.match(left)
right_match = UFO_KERN_GROUP_PATTERN.match(right)
if left_match:
left = "@MMK_L_{}".format(left_match.group(2))
if right_match:
right = "@MMK_R_{}".format(right_match.group(2))
print(left.endswith(".RTL"), right.endswith(".RTL"), left, right)
self.font.setKerningForPair(master_id, left, right, value)The inserted print statement shows the problem ( Any suggestions welcome. About the checksI need help with the checks.
|
…rrect (or at least lossless) round-tripping of kerning
|
Windows checks are passing now. Only the regression check remains |
|
we want groups.plist be the same for all master UFOs, as fontmake.instantiator will just use the groups.plist of the default master when creating instance UFOs. |
|
Okay guys, I think this is it. Don't ask me how I ended up here, but I'm now basically undoing all of G3 RTL kerning back to pristine G2-style kerning by also pruning As a consequence, the checks that I had altered in The code to assign kerning groups in Round-tripping now means the same as before today's edits, except that we're only looking at pristine G2-style kerning now, indistinguishable from how Glyphs 2 would have saved it. For illustration, see how I removed the assert (
first_derivative_ufos[0].kerning[
("public.kern1.reh-ar", "public.kern2.hah-ar.init.swsh")
]
== -50
)So really all we've done here is undo Georg's work :) |
|
I updated the README about the kerning conversion. Please have a look. There's nothing more to change from my side. |
|
Happy New Year. |
|
Can we please revisit this? I've randomly checked the differences of the regression tests and have found that these are all kerning groups for which no kerning is defined, so they are all legitimately missing from the UFOs as generated by this PR. I therefore strongly believe that this PR is good and see no reason why this is stalled. |
|
I'm inclined to close this in favour of #865 |
This is based on the latest discussion in #778, namely @simoncozens’ last comment.
I needed to make this into a separate branch for my own sanity.