Skip to content
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

Color font info #126

Open
o-t-w opened this issue Apr 30, 2022 · 1 comment
Open

Color font info #126

o-t-w opened this issue Apr 30, 2022 · 1 comment

Comments

@o-t-w
Copy link

o-t-w commented Apr 30, 2022

I opened this issue on a project that uses this as a dependency. Is it possible to grab this info using lib-font?

In the CSS fonts Level 4 spec, base-palette can reference a named color-palette embedded inside the font. Can lib-font obtain that information?

override-colors can reference different layers of the font either using a numerical index, or named indexes. Can lib-font get the names of these layers?
Wakamai-Fondue/wakamai-fondue-site#147

@Pomax
Copy link
Owner

Pomax commented May 1, 2022

the COLR table format 0 is supported, in the sense that you can query the table and then use its data to find the CPAL entries for glyphs. Get the a glyph's BaseGlyphRecord, then find its record.numLayers associated layers starting at record.firstLayerIndex. Each layer has a glyph id that should match the one you're working with (useful for error detection) and a paletteIndex value that is used with the CPAL table

The just-accepted COLR table format 1 does not have a code backing at present, so a lot of the color-related parts of the in-draft CSS4 spec are unlikely to currently work with this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants