-
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
Adding vertical origin to <advance> element #95
Comments
I support this. How can we make that happen? |
question was partly rethorical. Of course we'd need a PR to update the spec. I wonder how that would effect the current UFO readers, especially fontTools.ufoLib. I imagine it would blow up with some NotImplementedError or similar. |
oh.. formatVersion is an int #78 |
It seems like I'm missing something here, but wouldn't |
@benkiel yeah, I know. I am only concerned how we can introduce changes such as this without disrupting existing implementations of the spec. Even changing the type of formatVersion from int to float, to distinguish a major.minor version, is a breaking change. |
as well as upgrading vericalOrigin from lib key to a proper glif
That is what the Adobe Feature File specification expects And it is also what Glyphs.app uses as the default glyph advance height. If we align the expected default height value between FDK and Glyphs.app on the one hand, and UFO on the other hand, it makes it easier to translate between them. One would only need to set a the glyph.height attribute when it is different from the default value (ie. OS2.TypoAscender - OS2TypoDescender). |
What happens when OS/2.TypoAscender or OS/2.TypoDescender aren't set? |
+1. Although I would like to see what consequences this has for, say, defcon and fontParts. |
for ref, here's the linked glyphsLib issue: When a glyph doesn't have |
We fall back to info.ascender and info.descender, and if those aren't set either, then it is undefined. |
Would |
I guess |
So how would ufoLib2 then get at the right value? Will all glyphs be initialized with a value for height? |
ufoLib2 Glyph.height property would simply return on whatever is stored in the GLIF. If the height attribute is set in the advance element, then return that. Otherwise return None. |
I think that's good, but is not the same as saying to change the default value to some calculated value :) |
and for UFOReader and UFOWriter classes, they would similarly just read or write whatever is not None in the current Glyph object. |
right. |
So, the spec should say something like: if this value is not in the glif data, return None, which signals client code to do the appropriate |
btw, i'm working now on the formatVersionMinor (#78) PR in fonttools which should unblock this. |
About changing the default value for glyph.height, I think I don't need that any more. The only reason was to make it match Glyphs.app default value to avoid having to write out explicit glyph.height for all UFO glyphs, even when a font was not explicitly designed for vertical layout. But I can use some other heuristic to guess if a given .glyphs source is intended for vertical typesetting, and if so I will export all verticalOrigin and height attributes, and ufo2ft will do its job. The addition of verticalOrigin as first-class citizen in GLIF would still be nice, even though not a blocker. |
I just run into the same issue again. Having it default to zero is just plain wrong. That should be fixed ASAP. It should default to |
The default value is different but it is definitely possible to build vmtx table and ufo2ft supports it. I agree with you the default should change. |
You can build a vmtx table but it will not be correct. At least I don’t know how without manually setting the height in each glyph. |
Yes that is what I meant, you need to explicitly set the height in all glyphs whose height is != 0, because that's the current default value in the UFO spec. |
I think we need to upgrade the
public.verticalOrigin
lib key to a proper item in the next version of UFO.Perhaps like this:
<advance height="1000" width="450" verticalOriginY="850"/>
or just
<advance height="1000" width="450" verticalOrigin="850"/>
The text was updated successfully, but these errors were encountered: