From d20e89ff5457ce832ada07ac51d7563f735bb423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 16 Jun 2024 18:43:43 -0300 Subject: [PATCH] Ceil advance in scaled bitmap glyphs --- src/eepp/graphics/fonttruetype.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/eepp/graphics/fonttruetype.cpp b/src/eepp/graphics/fonttruetype.cpp index b10eed3be..a012afe20 100644 --- a/src/eepp/graphics/fonttruetype.cpp +++ b/src/eepp/graphics/fonttruetype.cpp @@ -958,15 +958,16 @@ Glyph FontTrueType::loadGlyphByIndex( Uint32 index, unsigned int characterSize, Float scale = 1.f; - if ( mIsColorEmojiFont || mIsEmojiFont ) + if ( mIsColorEmojiFont || mIsEmojiFont ) { scale = eemin( 1.f, (Float)( maxWidth > 0.f ? maxWidth : characterSize ) / (Float)( maxWidth > 0.f ? width : height ) ); + } int destWidth = width; int destHeight = height; if ( maxWidth <= 0.f ) - glyph.advance *= scale; + glyph.advance = eeceil( glyph.advance * scale ); if ( scale >= 1.f ) { destWidth *= scale;