ttf2font: Flip x coordinates for dense fonts

DM42 dense fonts are flipped backwards, so respect that encoding

Fixes: #1177

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
Christophe de Dinechin 2024-09-12 22:10:50 +02:00
parent 01927b1c97
commit 4e8eee969a

View file

@ -457,7 +457,7 @@ void processFont(cstring fontName,
int dbo = y * colsGlyph + (rwidth - x); int dbo = y * colsGlyph + (rwidth - x);
if (bit) if (bit)
{ {
int bx = denseBitMapX + x + colsBeforeGlyph; int bx = denseBitMapX + (colsGlyph - x - 1) + colsBeforeGlyph;
uint32_t bitOffset = by * denseWidth + bx; uint32_t bitOffset = by * denseWidth + bx;
uint32_t byteOffset = bitOffset / 8; uint32_t byteOffset = bitOffset / 8;
if (byteOffset > denseBitMapSize) if (byteOffset > denseBitMapSize)