-
Notifications
You must be signed in to change notification settings - Fork 51
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
Glyphs GSLayer vertOrigin and vertWidth aren't being saved #557
Comments
@anthrotype @schriftgestalt I'm not entirely sure what Glyphs is doing here, but making this "work" in glyphsLib gives completely different results with the calculations. Here's what I added to glyphsLib/builder/builders.py to save these values in the UFO:
The calculation for the vmtx
This gives completely different results from what Glyphs produces. I can't share the file here right now, but I can email it to both of you. |
The vertOrigin is a delta to the default origin (the ascender). I decided this a long time ago and didn't change it since to not disturb existing files. |
@schriftgestalt Ok, so in ufo2ft |
Probably. It is a bit confusing as makeOTF expects different numbers as what goes in the vmtx table. |
Ok, so Glyphs writes the vmtx in the feature file like
The actual vmtx table leaves So to get the equivalent values in ufo2ft we need |
@punchcutter Thanks for investigating this issue. Yes, support for vertical typesetting in fontmake is poor. I hope to find the time to look into this in the coming weeks. |
the problem is defcon Glyph defaults to ufo2ft is simply taking that at face value. If the default glyph height is 0, how can one distinguish between a true 0 height from one which was not explicitly set and thus should default to typoAscender - typoDescender? |
then i guess glyphsLib should set the UFO glyph height accordingly. That is, when vertWidth is present, use that; if not present, then it should store it as (typoAscender - typoDescender) |
argh... we have the same problem when parsing vertWidth into a GSFont in glyphsLib. When vertWidth is missing in the .glyphs file, it currently defaults to 0, so we can't tell a real vertWidth of 0 from one that is not set and should default to typoAscender - typoDescender... |
when vertOrigin and vertWidth are not set in a GSLayer they should defaut to None. I'll fix that. |
@schriftgestalt how does Glyphs.app decide whether to produce vhea and vmtx tables? What are the minimum pieces of data required? |
It seems that Glyphs.app produces a vhea and vmtx any time there is at least one glyph containing a master layer where either vertOrigin or vertWidth is explicitly set to a non-default value. |
I've thought about this again. I think we don't have to change the UFO spec default value for
Then ufo2ft should be able to build vhea and vmtx and VORG tables from the generated UFOs containing the above metrics data (and Noto Mongolian https://github.com/googlefonts/noto-fonts/issues/1414 can be fixed). |
I am working to prep a CJK font for release on Google Fonts (https://github.com/Fontworks-TechService/Reggae – I have requested that it be made public but may not be yet) that requires support for Glyphs' This branch contains the updated .glyphs file, as well as the build.py file that I am using to generate the finalized .ttf file, if it would be useful for testing. Right now, this bug is blocking me from completing work on this release :). |
@aaronbell the branch url 404s since it's a private repo. Can you send me the font? I'm working on a fix. |
Yeah, I'd requested that they open it up but I think they want it to be perfect first. Anyway, I'll email you the font. |
I have glyphsLib v5.3.1 installed, but if vertWidth is 0, it will not be reflected in vmtx.AdvancedHeight. Is 'vertWidth=0' not allowed? |
@kokiabe thanks for the report. I suspect it might be this line where it checks glyphsLib/Lib/glyphsLib/builder/glyph.py Line 280 in 8422053
which would return False if vertWidth == 0, and thus the if branch is not executed in that case. I think the fix should be to check /cc @m4rc1e |
@anthrotype Thank you for your support! The |
I should add support for those vertical values when writing .ufo file. My initial approach would be to just write out the values what are set in the .glyphs file. But I suspect that would not be enough? So do I need to write default values for all glyphs (if at least one glyph has them set)? |
are you talking about glyph.height and "public.verticalOrigin" key? Well, the problem is that those have differing default values in Glyphs.app and UFO, so you can't "just" write them out, you'd have to follow the translation logic encoded in glyphsLib. See #629 and #659 |
For vertical layout vertOrigin and vertWidth can be set in Glyphs, but these values aren't being used in glyphsLib. When going to defcon we need verticalOrigin to be set properly so that the vmtx table can be built correctly.
Also, in Glyphs if these values aren't explicitly set on some glyphs we still get values in the vmtx table. In both cases (explicitly set or not set) we are not getting the right values when running fontmake so vertical layout is completely mangled.
The text was updated successfully, but these errors were encountered: