question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support OT-SVG with CSS var(--color0, ...) and color palettes from CPAL table

See original GitHub issue

In addition to the inlined SVG colors (constant names “yellow” or hex #ABCDEF) which we do support, and the special currentColor keyword, which we don’t yet (cf. #405), OT-SVG table also allows to define color variables (via CSS var() function) that reference color palettes defined in the CPAL table, thus allowing to change the colors by selecting among multiple color palettes (e.g. light vs dark, etc.).

We need to support this both ways: 1) in maximum_color when converting OT-SVG => COLR, and 2) when converting a COLR font with multiple CPAL palettes to OT-SVG (#421).

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
litherumcommented, Sep 2, 2022

Please try the Ventura / iOS 16 betas.

0reactions
rsheetercommented, Sep 6, 2022

This is Nabla OT-SVG font (converted from COLRv1 using our maximum_color tool) inside Safari 16.1 on macOS Ventura showing off its alternate CPAL palettes:

AWESOME! Thanks again @litherum 😃 I will consider myself in your debt by a beer [or your preferred beverage] or two 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

SVG - Scalable vector graphics table (OpenType 1.8.4)
Within an SVG document in the SVG table, colors in a CPAL palette are referenced as implementation-defined CSS variables (custom properties) ...
Read more >
Rocher Color: making a variable color font | Fonts made in Brazil
Before going all in on SVG, I remember having a good feeling about COLR/CPAL fonts. These fonts work pretty much like your regular...
Read more >
Process currentColor properly in colr_to_svg.py #405 - GitHub
400 (review) identifies that black isn't always the current color. Fix it! ... Support OT-SVG with CSS var(--color0, ...) and color palettes from...
Read more >
Multi-Colored SVG Symbol Icons with CSS Variables | frontstuff
Yet, there's one thing that remains absolutely impossible with icon fonts: multicolor support. Only SVG can do this. TL;DR: this post goes in- ......
Read more >
FW: [mpeg-OTspec] COLR, SVG tables: sharing color palettes
We're awaiting agreement from Microsoft on how exactly the CPAL should ... e.g. name IDs for color palette entries (in the current SVG...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found