googlefonts / roboto-classic

Development of a Roboto Variable font
SIL Open Font License 1.1
151 stars 15 forks source link

Added script to fix anchor regressions for ufos #9

Closed m4rc1e closed 6 years ago

m4rc1e commented 6 years ago

Fix glyph anchors for Roboto VF.

Script uses lxml since ufoLib rearranges data.

The script will do the following:

  1. Deletes anchors used for design puposes e.g making glyphs built with components
  2. Renames anchors so no custom MarkWriterFeature is needed for fontmake
  3. Ensures each mark glyph only has 1 anchor which starts with an '_'
m4rc1e commented 6 years ago

@cjdunn this will solve our anchor issue. You'll need lxml for this.

before:

after:

mkmk 42 modified: All involve uni1ABB and uni1ABC

screen shot 2018-06-22 at 13 23 31 left: before, right: after

The sources had duplicate anchors for these glyphs. The script will remove these duplicates and produce the intended positioning.

mkmk 180 missing All involve cedilla, commaaccent, ogonek

These glyphs should not have mkmk positioning. They are not used as combining marks.

roboto_diff.txt

davelab6 commented 6 years ago

Thanks Marc, looks like a winner

cjdunn commented 6 years ago

Hi @m4rc1e thanks for sending this, very much appreciated. I ended up re-writing the script to run directly in RoboFont without needing lxml, since I already had functions that do the duplicating, renaming, and removing of anchors. I thought this would be handy to have in this kind of operation has to be done again in the future by myself or another designer.

I updated the anchors for all UFOs and rebuilt the var font, the result is in this fea branch: https://github.com/TypeNetwork/Roboto/pull/10

Please let me know if this works for you, thanks.

*Alternatively, if you'd like to just run your script on the UFOs that's OK with me too.

davelab6 commented 6 years ago

Thanks CJ! Will you publish the derived RF script? :)

davelab6 commented 6 years ago

Ah I checked the PR and see you did already!! Awesome thanks :))

cjdunn commented 6 years ago

Hi @m4rc1e thank you for your comments here: https://github.com/TypeNetwork/Roboto/pull/10#issuecomment-400248867

I made a new branch:fea-fix-anchors-v2 starting from this commit: https://github.com/TypeNetwork/Roboto/commit/0a0fd4621fa564a0abf8a33227b1c88820c3424c

and ran the fixAnchor script again. Here is the resulting PR: https://github.com/TypeNetwork/Roboto/pull/11

Please let me know if this works any better for you, thanks

m4rc1e commented 6 years ago

Closing as file was included in #11