Fix the LSB alignment and switch to the internal TTF implementation

This commit is contained in:
dpjudas 2024-01-08 16:11:30 +01:00 committed by Christoph Oelckers
parent ccdbc8450a
commit ba274757be
2 changed files with 2 additions and 2 deletions

View file

@ -14,7 +14,7 @@
#include <stdexcept>
#include <cstring>
// #define USE_INTERNAL_TTF
#define USE_INTERNAL_TTF
class CanvasTexture
{

View file

@ -276,7 +276,7 @@ TrueTypeGlyph TrueTypeFont::LoadGlyph(uint32_t glyphIndex, double height) const
// TBD: gridfit or not?
glyph.advanceWidth = (int)std::round(advanceWidth * scale * scaleX);
glyph.leftSideBearing = (int)std::round(lsb * scale * scaleX + bboxMin.x);
glyph.leftSideBearing = (int)std::round(bboxMin.x);
glyph.yOffset = (int)std::round(bboxMin.y);
return glyph;