love icon indicating copy to clipboard operation
love copied to clipboard

Support for per-character horizontal spacing

Open stone628 opened this issue 3 years ago • 1 comments

added Font:getCharSpacing, Font:setCharSpacing tested with love.graphics.print and Font:getWrap

character spacing is in pixel unit, negative value for letters to be shown closer

stone628 avatar Dec 07 '21 08:12 stone628

The general API seems reasonable, although I wonder how it would interact with cursive-style languages like Arabic (which love doesn't fully support yet, but hopefully will in the future). I wonder what other libraries do in that situation?

slime73 avatar Mar 29 '22 00:03 slime73

Now that I've been working on support for things like ligatures and other forms of character combining and separating (via Harfbuzz), I think this change isn't compatible with those concepts at the love.graphics Font level.

It makes more sense for it to be done for font files themselves I think - for example ImageFonts already support an extra spacing value which gets applied to each character. BMFont definition files have a per-character advance value you can modify, and TrueType fonts can be modified as well.

slime73 avatar Dec 25 '22 15:12 slime73