-
Notifications
You must be signed in to change notification settings - Fork 611
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
Recover design coords from a hb_font_t #1865
Comments
Need to add This is slightly problematic since in a future with avar2 table, converting back from normalized to design coords might not be unique... |
I think I forced FreeType to add similar API and exposed them to the same dilemma... We don't currently keep the design coords. Got to save them so we can return. And yeah, no idea what to do if user called set_var_coords_normalized and later called get_var_coords_design. |
Note that the main problem is with initial values. Once I have my ui set up,the changes only flow from the sliders to the font, which is fine. The issue is what to set the sliders to the first time I see the hb_font_t. In pango, I've reverted to opening the font with freetype and using FT_Get_MM_Var for now. But wanted to get away from that, and just go fontconfig -> fontname -> hb_blob_create_from_file. Maybe the right answer is to make fontconfig add the design coords to the pattern. |
I would suggest to clear saved design coords when normalized coords are set from the outside, and only return design coords when you have them. |
Right. But we don't have a (existing, clean, ..) way to return "not-representable". |
Something like this?
|
Do we need a separate API or what is done here #1890 is useful for this also as it is now able to convert back from normalized coordination to design in a hb_font_t? |
I mean I think we can store original design coordination but do simulation also with the API if we don't have original ones, if what the API promises isn't convenient enough. |
If the transform is reversible, sure would be nice to return it. |
Reopening to finalize this and mark non-experimental. |
I thought about this in reference to #1914. If we are to inject |
|
Right. |
Nevermind. See #1914 (comment) |
Any remaining issue with the API will address later by deprecating it. Fixes harfbuzz#1865
I want to create a ui for font variations.
I have a hb_font_t. From that I can get the hb_face_t, and all the axis infos to set up sliders.
But there is currently no way for me to find the coords of the hb_font_t to set the sliders current value. hb_font_get_var_coords_normalized gives me something, but it does not obviously relate to the min/max/default values in the axis info.
The text was updated successfully, but these errors were encountered: