googlefonts / science-gothic

Science Gothic, a libre variable font
Other
142 stars 4 forks source link

Lowercase Q Changes To The Small Cap Version In Thicker Weights In The Variable File #300

Closed Bronnel721 closed 8 months ago

Bronnel721 commented 1 year ago

GGScigOFLRegular-0966b6 I just checked the source files and it isn't in there. I think the build that you have is the problem. Also, o and u with hook in lowercase, small capitals, and uppercase are spaced weirdly. Screenshot (13)

kateliev commented 9 months ago

@tphinney it took me quite some time to figure it out and to find a solution. Please read my explanation below and approve on the proposed solution.

The designspace swap: Currently we have an alternate /q.alt.sc. Upon reaching location ~wt>800 the /q is swapped with the alternate by dropping the last of the trailing suffixes /q.alt.sc -> /q.alt (removing *.sc). This unfortunately is a bug, because we do not have a glyph named /q.alt so the compiler reports it and refuses to compile the font. Or at least that is what happens with the latest FontLab trying to compile the font. But I presume we compiled current TTF using UFO and fontmake as stated in the docs, thus the error slipped under the radar. Also it seems that the UFO approach renders the swap by removing the whole suffix /q.alt.sc -> /q manifesting as the bug reported above.

The logical solution would have been renaming the glyph from /q.alt.sc to /q.sc.alt. That is actually better, because we are making an alternate to the smallcaps alternate :) But unfortunately this does not work as well, because the swap /q.sc.alt-> /q.sc is working, but the SMCP feature does not recognize it (see below).

The smallcaps swap: The feature swaps /q.sc -> /q as expected, but it does this ahead of the desigspace swap tag, no matter my later attempts to correct it with <rulesprocessing=last>. The glyph is swapped and the desigspace swap cannot occur as there is no actual /q.sc only /q.

Conclusion I see two possible solutions here each having its strengths and weaknesses:

  1. Drop the support for alternates of the small caps altogether. Yes we will loose the clean and readable design we implemented, but will reduce complexity and potential future errors. Actually we are discussing only 2 glyphs here /q.alt.sc/uni051B.alt.sc
  2. Fix the situation by introducing an actual /q.alt at ~wt>800 that is 1:1 copy of /q - should be a component/auto glyph. Then manually edit the SMCP feature to introduce sub q.alt by q.alt.sc. This will swap /q -> /q.alt -> /q.alt.sc as we expect it. I have tested it and it just works. Problems here are the dummy glyphs introduced to the font and the manual editing of the SMCP feature as currently all features are nicely auto-generated by FontLab
kateliev commented 9 months ago

I have implemented the above suggested solution (2) and pushed it to the repo. It just works: image

Bronnel721 commented 9 months ago

It's working good! However, I can't generate the fonts because I was in Demo Mode and because I was in Demo Mode, I can't generate fonts anymore.

kateliev commented 9 months ago

Yes! We consider it now done! Will build the fonts within this week as there are some other issues that need fixing.

Bronnel721 commented 9 months ago

Will build the fonts within this week as there are some other issues that need fixing.

Yeah, like how ohook and uhook have bad spacing. And in EVERY form.

tphinney commented 9 months ago

Actually, those are “horn” diacritics rather than “hook”… I know they look kind of like hooks, but there is a different thing called a “hook” It sounds right, I know, so at first I just blindly copied that error when writing it up, myself! Tracking it as: https://github.com/googlefonts/science-gothic/issues/305