-
Notifications
You must be signed in to change notification settings - Fork 681
Minimal API for COLR/CPAL #1016
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
Conversation
| { | ||
| const OT::CPAL& cpal = _get_cpal(face); | ||
| if (unlikely (palette >= cpal.numPalettes)) |
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 work is great, thanks!
I believe you can move the logic of this and hb_ot_color_get_color_layers to their tables themselves and use this make this a proxy for them.
I guess we can remove the non-used helpers on that tables also afterward.
|
Closes #849 |
| * | ||
| * Since: REPLACEME | ||
| */ | ||
| typedef uint32_t hb_ot_color_t; |
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.
Just a bikeshedding, hb_ot_color_t or hb_color_t Behdad? Also suggested your idea on having helper macros for color channels.
|
Closing, not sure about this any more. Can be done from scratch if we ever want it. |
|
Why?!! I definitely want something like this. Leave open, it's fine. |
|
I thought we had another PR from @ebraminio for that, but looks like we don’t. |
|
Khaled, do you remember why this was considered WIP? Can we revive it maybe? |
|
I wanted other opinions about the API. I tried to rebase it on master in September 11 but there were so many changes and I could manage to get it compile but it was crashing and I got lost finding out what was going on. |
|
No problem, I will also look it to see if I can progress it maybe :) |
Update colr-cpal-api and minor tweaks
Add a helper macro and fix asan/everything bots issue
|
Khaled and Behdad any chance you can see if is this good enough? My questions, is hb_ot_color_has_{cpal,colr}_data as public API needed? May |
|
The macros should be all caps I think. |
|
|
|
Makes enough sense, thanks
…On Sat, Oct 20, 2018, 00:36 Khaled Hosny ***@***.***> wrote:
has_*_datawould be used by clients to see if the font can decompose color
glyphs or not, and it can check that once instead of calling the color API
on each glyph and checking the result.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1016 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAy3wYw4IBNp6rE180mYNhgQHRXKR_MVks5umj7bgaJpZM4Tucjz>
.
|
|
Don't merge any API in please until we get the 2.0.0 post-releases out first. |
Sure. How about have it as a branch on the repo itself? Asking from Khaled, any personal reason marking it as WIP? Please rename the macros if you like to |
| int r = hb_ot_color_get_red (color); | ||
| int g = hb_ot_color_get_green (color); | ||
| int b = hb_ot_color_get_blue (color); | ||
| cairo_set_source_rgba (cr, r / 255., g / 255., b / 255., alpha); |
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.
My fault probably, this needs / 255. also I guess
|
@ebraminio feel free to close this PR, move the branch to harfbuzz/harfbuzz repo and open a new one. I don’t seem to remember much of what I was doing here, so feel free to fix as you see fit. |
|
Merged on ot-color as Khaled agreement (not master, don't get confused) |
WIP, the tests do not pass (table in cpal-v1.ttf fails sanitization). Here is a LibreOffice using it (WIP as well):
