EB-Garamond-Initials icon indicating copy to clipboard operation
EB-Garamond-Initials copied to clipboard

Add coloured glyphs

Open KrasnayaPloshchad opened this issue 8 years ago • 8 comments

This is suitable for EBGaramond-Initials and similar fonts. The implementation can be based on CPAL/COLR table.

KrasnayaPloshchad avatar Jan 16 '17 07:01 KrasnayaPloshchad

What is the advantage of using a coloured font instead of colouring it using the typesetting system? Would it be higher quality? If you don’t like the default colours, you’re going to have to modify the source code and recompile the font yourself. I’m not trying to discourage supporting more features, but it seems like this is only useful for things like emojis.

amarz45 avatar Apr 14 '23 03:04 amarz45

Using two fonts for one letter is a bit awkward, especially on the web. COLRv1 fonts allow the user to modify the colours of the palettes so no changes to the source code are necessary.

georgd avatar Apr 14 '23 05:04 georgd

I did not know that you can modify the colours. Does anyone know how to do this in LaTeX?

amarz45 avatar Apr 14 '23 11:04 amarz45

I, at least, don’t know. The script I committed produces COLRv0 tables, as far as I understand, and I need to investigate more before continuing there. That script was the outcome of trying to do something useful with ChatGPT, which however only phantasized inexistant classes and methods. After reading the documentation to the AI various times, I felt that I understood it enough to produce this 😁

georgd avatar Apr 14 '23 12:04 georgd

I see LibreOffice decleared supporting COLR/CPAL, CBLC/CBDT or sbix OpenType tables for colored fonts from 7.5 release. https://wiki.documentfoundation.org/ReleaseNotes/7.5

And I see Amiri font is already have colored variant.

KrasnayaPloshchad avatar Apr 15 '23 03:04 KrasnayaPloshchad

I see Microsoft Office now support colored glyphs as well. https://babelstone.co.uk/Fonts/Flags.html

KrasnayaPloshchad avatar Aug 12 '23 02:08 KrasnayaPloshchad

COLRv1 fonts allow the user to modify the colours of the palettes so no changes to the source code are necessary.

The support for changing color palettes or defining custom ones in independent of the COLR table version (colors are defined in CPAL table, which in theory can even be used with SVG table).

https://developer.mozilla.org/en-US/docs/Web/CSS/font-palette https://developer.mozilla.org/en-US/docs/Web/CSS/@font-palette-values

khaledhosny avatar Sep 02 '23 11:09 khaledhosny

Since you already have SVGs, you can add the colors directly to them and use https://github.com/googlefonts/nanoemoji (despite its name, it can produce color fonts in general not just for emojis).

khaledhosny avatar Sep 02 '23 11:09 khaledhosny