-
Notifications
You must be signed in to change notification settings - Fork 1
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
Cubic Beziers in glyf table #38
Comments
Okay I opened OpenType/opentype-next#7 |
Suggesting that we move cubics-for-glyf discussion here. I see two ways: Use flag bit 7 to add cubics in, without bumping any version or major bump. glyf table has its version in head table's glyphDataFormat; not sure if any software checks that. That might be good if they don't check if we choose the semi-backward-compatible way (more about that below). Given that glyf table was the common thread we inherited from TrueType and has not changed in 30ish years, changing it drastically constitutes a new font format, so we might as well address many other issues at the same time, in particular: 1. 16bit GIDs, and 2. add versatile component reuse (including variations), particularly without consuming GIDs necessarily. |
Do the cubic curves have to live in the glyf table, or could they be in a new table, say |
Just want to leave this about cu2qu algorithm here, because it is relevant. I'll comment on the relevance later. |
The nice thing about (ab)using bit 7 in the glyf table is that you get the potential to use cubic and quadratic curves in the same glyph. This may however create more potential for confusion than it is worth... |
Here is the messy Twitter thread where some discussion took place on 2020-09-16. Twitter makes it very difficult to follow the whole discussion. |
Coincidentally that afternoon I published a build of Samsa that handles an experimental version of TrueType: Samsa Cubic. Versions of MutatorSans as quadratic (standards compliant) and cubic (non-compliant) are included for convenient comparison. The experimental “ttf-cubic” format is identical to TrueType, except:
Design goals for ttf-cubic:
Follow these instructions if you want to make one:
Remember the only environment that supports ttf-cubic is Samsa! Note that there is nothing specifically relating to variable fonts in ttf-cubic, although currently Samsa does not handle static fonts. If anyone has other prototype font/table formats that they would like to try out in Samsa, please let me know. |
Using bit 7 on every cubic off-curve point is safe, I think. To retain the benefits of sequences of smooth curves in cubic and quadratic, to avoid recoding existing fonts, and interpreting usefully all combinations of off-curve, on curve and bit7, we can allow cubics to be optionally defined by one off-curve point defining both tangents like a quadratic, its two mathematical control points at the same position. Some examples (the 0 and 1 below represent bit 7):
Bit 7 set for an on-curve point is an error, or ignored for this table version. Too complicated? One option might be to keep to one curve order per contour, so just one flag needed, which could be stolen from the endPts array (limiting point ids to max 32767 instead of 65535). |
Easiest way to do this:
Things to think about:
The text was updated successfully, but these errors were encountered: