-
Notifications
You must be signed in to change notification settings - Fork 621
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
Exposing OS/2 table? #1337
Comments
If we can model them in a nice way, sure. Which fields? |
I currently only want sxHeight and sCapHeight, but I guess the API would expose anything. How that API would look is really a tough question, I have been thinking about it and I don’t have an answer. The only similar API I know is FT_Get_Sfnt_Table, I like how it can handle newer table versions with additional fields, but I don’t really know if it is a good API design-wise or if it is a good fit for HarfBuzz. |
Perhaps an API could be based on value tags from the MVAR table? For example, HB_EXTERN hb_bool_t
hb_ot_font_get_metrics (hb_font_t *font,
hb_tag_t metrics_tag, // eg. hasc, hlgp, undo, xhgt, cpht
hb_position_t *position); |
Thanks Sascha. Yes, that's indeed what I liked before. A couple changes:
|
|
I prefer not to expose table by table. Which OS/2 fields do you need that are not supported by MVAR tags? https://docs.microsoft.com/en-us/typography/opentype/spec/mvar |
Not currently in this project, but in LibreOffice I need also |
I prefer to have the metrics API, and expose more things separately. |
width/wght we can add private MVAR-like tags and fetch using the same API (and hook to variations as well). |
Why do you rely on fsSelection? |
Also, |
In LibreOffice Edit. I just checked XeTeX, and it uses |
Our font-metrics code already takes that into account.
Right. Those would be useful.
Okay, let us know. |
Weight, width and italic angle sound like candidates for an API that could be modeled around the STAT table; the implementation would fall back to OS/2 if STAT is not present. |
Sounds good. |
@ebraminio want to implement the proposed API, with MVAR? |
Sounds interesting! |
My conclusion till this point from the discussion and reading some parts of the specs is the proposed API will be like this and placed on
And valid tags for hb_ot_metrics_t enum are:
|
Personally I’d find a separate API for stylistic attributes more natural because the returned range is different. Metrics are positions; stylistic attributes are values along variation axes. Personally, I’d also keep |
OK so we clearly need three different APIs, back to API design I guess,
|
Forget about STAT and BASE tables. Let's define one simple API for MVAR tags for now. |
Sooner or later ot-metrics will be finished, any idea about the other part using tags on https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg on a different API, what should be named? And can I have a digest of what is STAT use, still confused I can say. |
Take a break, leave me alone for a while. It's holiday season! ;) |
Hehehe |
From
So |
No. |
Related to harfbuzz#1337 May or may not used in addition to an API related to STAT.
Related to harfbuzz#1337 May used in addition to an API related to STAT. Lots of Apple fonts have it.
Related to #1337 May used in addition to an API related to STAT. Lots of Apple fonts have it.
I thought more and like to expose italicAngle in ot-metrics and font-extents. I suggest we expose it not as an angle but as, eg for horizontal direction, |
If/when we do that we should also update our fallback mark-positioning to use that to adjust mark x position depending on the y. |
Was thinking about you proposal more in caret sense, apparently italicAngle is considered to have some use other than caret #1880 (comment) so like to know what is Khaled's use as I don't think it would be nice to force our only user to reverse our work exactly to access some value it should've accessed easily at the first place. |
Italic angle is used by TeX for mark positioning as well as "italic correction". While using this for mark positioning is considered fallback behavior in OpenType fonts, Italic correction is a legit thing. |
I’m working on a small project using HarfBuzz and I need to access a couple of fields from
OS/2
table. It is a simple table and I can just read it in my code, but HarfBuzz already reads it for the font extents so I thought to ask if exposing the rest of the table is something HarfBuzz might want to do?The text was updated successfully, but these errors were encountered: