-
Notifications
You must be signed in to change notification settings - Fork 600
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
[style] New API, hb_style_get_value #1890
Conversation
Haven't looked at what you've done, but related: |
At first glance I like this, but see my comment linked above. This needs to hook up to font's currently-set variation values as well. And of course, what you have is the fallback path. The (missing) main path should be reading |
The values here don't scale and are like
Was working on it as wanted to have it in separate change, done
I'd say lets do that later, fallback won't be needed there even, mixing that with this just complicates things for a simple font crawling application. |
c7325e7
to
e2e4903
Compare
If someday we decide to expose one of these flags, |
8cae97b
to
899eacf
Compare
test/api/test-ot-style.c
Outdated
/* XXX: It should be 900! */ | ||
g_assert_cmpfloat_hb (hb_ot_style_get_value (font, HB_OT_STYLE_TAG_WEIGHT), 1);\ | ||
/* XXX: It should be 50! */ | ||
g_assert_cmpfloat_hb (hb_ot_style_get_value (font, (hb_ot_style_tag_t) HB_TAG ('C','N','T','R')), 0.5); |
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.
Oh I see why but not sure if we like to do that :/
b0245e2
to
50bf5cf
Compare
src/hb-ot-var-avar-table.hh
Outdated
@@ -128,11 +162,24 @@ struct avar | |||
const SegmentMaps *map = &firstAxisSegmentMaps; | |||
for (unsigned int i = 0; i < count; i++) | |||
{ | |||
coords[i] = map->map (coords[i]); | |||
// coords[i] = map->map (coords[i]); |
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.
guess can't reversed easily, test-ot-style test is working without this so if I could map unmap work I could reversed it correctly.
49ae8f7
to
c0e94e2
Compare
test/api/test-ot-style.c
Outdated
#define g_assert_cmpfloat_with_epsilon(n1, n2, epsilon) g_assert_cmpfloat ((int) roundf (n1), ==, (int) roundf (n2)) | ||
#endif | ||
|
||
#define EPSILON 0.01 |
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.
This is its precision on retrieving original coords which I believe is pretty good.
c443ad7
to
4d6582c
Compare
Dropped How about renaming |
52ebbd0
to
07b3639
Compare
@behdad can you review this also? Specially on |
Not now. I'm very conflicted on this still :). Let me recover a bit and be more comfortable with other code that has gone in first. Like to come to a conclusion on the pen stuff first. Thanks. |
0847aa4
to
1cb782b
Compare
d9e5401
to
ccb8e20
Compare
Searches variation axes of a hb_font_t object for a specific axis first, if not set, then tries to get default style values from different tables of the font.
ptem, used for AAT's tracking/`trak` table is equivalent to opsz of variable fonts. For variable AAT fonts, such as SFNS, ideally variable axis of the hb_font_t should be set and equivalent to ptem, https://crbug.com/1005969#c37
as previous off tracker agreement we had on having this as an experimental API, just like to experiment with the API on other projects to show its usefulness and guess there will be some clients for this just like the draw API clients found on github so they can comment on usefulness and correctness of the API also so let's have this as an experimental API for now. |
Searches variation axes of a hb_font_t object for a specific axis first,
if not set, then tries to get default style values from different
tables of the font.
Related patches, master...ebraminio:style master...ebraminio:style2 master...ebraminio:italicangle #1468