mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-14 13:15:14 +03:00
Ceil advance in scaled bitmap glyphs
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user