-
Notifications
You must be signed in to change notification settings - Fork 607
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
[metrics] Add a private tag for Italic correction, Ital #2378
Conversation
@@ -107,6 +107,7 @@ _get_gasp (hb_face_t *face, float *result, hb_ot_metrics_tag_t metrics_tag) | |||
#define _HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER_HHEA HB_TAG ('H','d','s','c') | |||
#define _HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP_OS2 HB_TAG ('O','l','g','p') | |||
#define _HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP_HHEA HB_TAG ('H','l','g','p') | |||
#define _HB_OT_METRICS_TAG_ITALIC_CORRECTION HB_TAG ('I','t','a','l') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to suggest something better
8875152
to
730124d
Compare
730124d
to
7d63c21
Compare
g_assert_cmpint (value, ==, 426); | ||
int x_scale; | ||
hb_font_get_scale (font, &x_scale, NULL); | ||
g_assert_cmpint ((int) roundf (-asinf ((float) value / x_scale) * 180.f / (float) M_PI), ==, -12); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to get post->italicDegree back, can be done by HB_OT_METRICS_TAG_HORIZONTAL_CARET_RUN / HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE right now also of course
I don't understand this. "Italic correction" is a specific TeX-related concept that is not the same as "italic angle", and cannot be directly computed from it; it's a per-glyph metric that is up to the font designer to specify. In XeTeX (for example), we do synthesize a "fake" value for italic correction -- using italic angle as one of the inputs -- but that's just a fallback heuristic to make up for the lack of this glyph metric in OpenType fonts. I don't think harfbuzz should be attempting to do anything like that; it's purely an application-level function. |
#1890 is what I suggest but nobody shows any interest and Behdad says no client will use that (but I believe a font manager easily can take advantage of it, don't you know any other client willing to use it?) so the only remained option will be providing one |
Another doomed attempt :/ let's agree on having hb-style or a |
let's take another look later |
Fixes #1880 (or, it can be considered for)
Compare https://github.com/harfbuzz/harfbuzz/pull/2378/files#diff-3e0886e0824e462dddb236ac6d8b2fbbR78 to https://github.com/harfbuzz/harfbuzz/pull/2374/files#diff-3e0886e0824e462dddb236ac6d8b2fbbR67 (-426 vs 430)