Setting application color in COLR font?
jkwchui
Posts: 2
Hello all. I am working on a CJK font, which was constructed by importing ~30k SVGs into Glyphs. OT-SVG has poor support on Windows, so I am trying to get a COLR version.
Glyphs can import SVGs into their proprietary Color layer, and in turn export that out as COLR/CPAL. The problem is that their import discards fill="currentColor", and the Color layer also don't support setting the equivalent of currentColor. I want parts of the font to respect the application color choice.
OpenType 1.9 specs says that "A palette entry index value of 0xFFFF is a special case indicating that
the text foreground color (defined by the application) should be used". Is there a way to set that value after the font had been exported? Or does anyone have suggestions for how to approach this?
Tagged:
0
Comments
-
In the color selection of a layer, there is the “*” option. This uses the text color:
Converting the SVG “currentColor” value to this special 0xFFFF/“*” color index is a good idea.
Please keep editor-specific topics to the forums of those editors. We are happy to help over at the Glyphs Forum.0 -
Thanks for the response, but I had already raised that in the Glyphs forum last July (https://forum.glyphsapp.com/t/native-color-layer-user-color/26808/13). This solution you suggest applies to the Color Palette layers and not native Color layer. My sense is that this is not possible in Glyphs, and I am looking to see if others have a non-Glyphs based suggestion.
0 -
You are right, the full-color layers are currently only using fixed colors. We will offer arbitrary palette colors in addition to fixed colors for full-color layers in the future, but I cannot say just yet when that will be ready. For now, post-processing the exported font and editing the desired color index with a tool like TTX should do the trick.1
-
Aside:
>OT-SVG has poor support on Windows...
Actually, the platform has good support for OT-SVG: DWrite and Direct2D have APIs that make it not difficult for app developers to support OT-SVG, and these should work in the Windows XAML platform and WinUI.
Support in Windows apps is, of course, a different matter. Adobe apps and Firefox on Windows do support OT-SVG. If you have an older version of Edge (pre-Chromium), that supported OT-SVG.0
Categories
- All Categories
- 40 Introductions
- 3.7K Typeface Design
- 795 Font Technology
- 1K Technique and Theory
- 613 Type Business
- 444 Type Design Critiques
- 539 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 480 Typography
- 300 History of Typography
- 113 Education
- 67 Resources
- 495 Announcements
- 79 Events
- 105 Job Postings
- 148 Type Releases
- 162 Miscellaneous News
- 269 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports