chafa icon indicating copy to clipboard operation
chafa copied to clipboard

Taking advantage of Unicode Combining Characters

Open cdluminate opened this issue 5 years ago • 1 comments

Generally we cannot overlap several characters together, but those "combining characters" can. https://en.wikipedia.org/wiki/Combining_character
https://www.compart.com/en/unicode/combining

If chafa makes use of those special characters, more details will be added to the result. Maybe this requires some breaking change, so it's merely a wishlist.

cdluminate avatar Sep 16 '18 12:09 cdluminate

Interesting idea. We'd have to change the core algorithm, but it shouldn't be too hard. To avoid a combinatorial explosion, we could find the best-fit base symbol first and then try combining it with modifiers (logical OR of the symbol's mask and that of each combining character).

I imagine the overscores, underscores and various overstrokes could be especially useful.

Relatedly, I've been thinking of a --zalgo [0-9] parameter that would add random fuzz to the output. That wouldn't improve the quality, but it could be a nice effect.

hpjansson avatar Sep 16 '18 14:09 hpjansson