hpjansson / chafa

πŸ“ΊπŸ—Ώ Terminal graphics for the 21st century.
https://hpjansson.org/chafa/
GNU Lesser General Public License v3.0
2.98k stars 64 forks source link

Multicolor glyph support #231

Open hpjansson opened 2 weeks ago

hpjansson commented 2 weeks ago

@PhMajerus suggested color emoji/glyph support in #201. Especially the various color hearts are interesting. This requires:

We could seize the opportunity to allow monochrome glyphs to be represented this way too (as grayscale coverage), using bigger 16x16 pixmaps for matching, then employ it automatically at high work factors to maximize quality.

PhMajerus commented 2 weeks ago

If you want to support several shapes, there are 3 sets that can easily be handled with the same converter as they provide the same colors and just need a chars lookup table change: Squares: β¬›β¬œπŸŸ₯🟧🟨🟩🟦πŸŸͺ🟫, they are in Unicode 12.0, but be aware that the first two might not look the same as the rest of the set in some fonts, or even render as monochrome symbols instead of Emojis. Circles: ⚫βšͺπŸ”΄πŸŸ πŸŸ‘πŸŸ’πŸ”΅πŸŸ£πŸŸ€, they are in Unicode 12.0, and again the first two might look different. Hearts: πŸ–€πŸ€β€οΈπŸ§‘πŸ’›πŸ’šπŸ’™πŸ’œπŸ€Ž, this set is in Unicode 12.0 and should render as consistent color Emojis in all fonts.

And then there is the better but less supported one: Hearts (extended): πŸ–€πŸ©ΆπŸ€β€οΈπŸ§‘πŸ’›πŸ’šπŸ’™πŸ©΅πŸ’œπŸ€ŽπŸ©·, this set is nicer as it provides 12 colors instead of 9 and the lighter gray and blue really help for many images, but it requires Unicode 15.0, so it should probably be a separate explicit choice.

oshaboy commented 2 weeks ago

First things first, there should be some way of testing these with multiple fonts. None of the emoji have a "canonical" exact color like 16 color ANSI does (sure you can customize them in most terminals, but traditionally ANSI art assumes the colors match the behavior of default VGA)

I tried installing many emoji fonts on a Linux system but they all caused conflicts and I haven't come up with a better way of testing for multiple emoji fonts. Some of the colors can vary wildly in hue, saturation and brightness across fonts.

So there needs to be a program that allows someone to quickly swap and compare emoji heart images in several popular fonts