From 4e8eee969a34b639ed013ab216b72849f3656855 Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Thu, 12 Sep 2024 22:10:50 +0200 Subject: [PATCH] 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 --- tools/ttf2font/ttf2font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ttf2font/ttf2font.cpp b/tools/ttf2font/ttf2font.cpp index 2ba1299e..fa8e6046 100644 --- a/tools/ttf2font/ttf2font.cpp +++ b/tools/ttf2font/ttf2font.cpp @@ -457,7 +457,7 @@ void processFont(cstring fontName, int dbo = y * colsGlyph + (rwidth - x); if (bit) { - int bx = denseBitMapX + x + colsBeforeGlyph; + int bx = denseBitMapX + (colsGlyph - x - 1) + colsBeforeGlyph; uint32_t bitOffset = by * denseWidth + bx; uint32_t byteOffset = bitOffset / 8; if (byteOffset > denseBitMapSize)