-
Notifications
You must be signed in to change notification settings - Fork 606
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
Shaping and instantiating variable fonts #2112
Comments
|
This will be instantiation feature of subsetter as also referred on #1558 as a not in scope there, perhaps @blueshade7 and @garretrieger can comment on the status and planning for instantiation. |
|
It's something that we want to add, but not being actively worked on at the moment. |
|
Thanks, good to know. I’m happy to try working on this if someone can spec out an interface to it. |
|
Perhaps Garret should comment here also, hb_subset has a simple API #1381 (comment) so I guess var coords will become a new field on subset_input, if, not another API like hb_subset_var_instantiate is considered that takes a hb_font_t instead hb_face_t and returns the instanced hb_face_t, which wouldn't need to use subset input object even. It should be started by removing var tables and applying mvar to the needed places, and the real challenge will be in glyf/CFF2 and GSUB/GSUB/GPOS rebuild. I guess we can progress with a bottom up approach with adding related methods to each of those tables, starting with easier ones like OS2 instancing (applying mvar to its values) or harder ones like applying gvar to glyf in TT-VF fonts or CFF2. |
|
I think one advantage of doing instanciation and sunsetting at the same time would be when instantiating large fonts to be embedded in PDF files, to avoid wasting time on glyphs that would be immediately sunsetted away. |
|
We should add variation-space specification to subset input and cut the font to adhere to that. That defaults to preserving all variation space, but should allow for narrowing down the space all the way to instantiating a single instance and leaving no variation behind. So, @anthrotype's work on partial-instancing in fonttools should be considered at the same time, for API and implementation design purposes, even if not immediately implemented. |
|
OK, I've been looking at this again; here are some things I think we will need to do.
|
|
FWIW, while I admire the goal of reducing varfonts to other varfonts (limiting the variation space), I think a sensible v1.0 goal would be subsetting to statics ie. producing a font that represents only a point in the variation space, not a region. |
|
Meh. It's not actually that much more code. I'd still have to do all the things I mentioned. |
|
Does HarfBuzz having some APIs that could be helpful for this? If so, anyone could make use of them to subset a single instance, even if HarfBuzz doesn’t have such functionality. |
|
This is starting to happen. First PR is #3708 (review) |
|
Hey, we've recently implemented tracing of used variation axis ranges in subfont, mainly in anticipation of this feature. We would like to do automatic instantiation/axis trimming to make it easier to author performant web pages with variable fonts. Just a 🤚 that we'd be excited to beta test whenever you have something ready! 🤗 We currently use the subsetting features via |
|
Full instancing (that is reducing a variable font to a fully static instance) should be ready for use in the very near future. Mainly we're waiting on #3816 to be merged. Partial instancing (pinning/modifying some but not all axes) will be worked on next. |
|
Is instantiating CFF2 table supported or planned? |
|
CFF2 is not currently supported. Currently the focus is on implementing for glyf. We do plan to also do instancing for CFF2 as well once the glyf implementation is done. |
|
We've just released subfont 7.0.0, which uses |
I seem to remember Behdad saying that Harfbuzz will not just be able to shape but also instantiate static instances of variable fonts. This will be helpful for me because, as a layout engine, SILE needs to pass fonts to a PDF generator, and the PDF library doesn't support variable fonts.
I just found the shaping example in the documentation (oops), but is the instantiator done yet? Is it on the radar?
The text was updated successfully, but these errors were encountered: