From eacebd4c4106c364aeb7bd87549c3a68e8e176e8 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 27 Aug 2016 09:41:01 -0700 Subject: [PATCH] Font: Draw nothing for chars before first glyph. This matches the logic in sceFontGetCharImageRect(), and improves tests. Previously, we were drawing the alt character in these cases. --- Core/Font/PGF.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/Font/PGF.cpp b/Core/Font/PGF.cpp index 45b9998990..9113498425 100644 --- a/Core/Font/PGF.cpp +++ b/Core/Font/PGF.cpp @@ -555,6 +555,10 @@ bool PGF::GetCharGlyph(int charCode, int glyphType, Glyph &glyph) const { void PGF::DrawCharacter(const GlyphImage *image, int clipX, int clipY, int clipWidth, int clipHeight, int charCode, int altCharCode, int glyphType) const { Glyph glyph; if (!GetCharGlyph(charCode, glyphType, glyph)) { + if (charCode < firstGlyph) { + // Don't draw anything if the character is before the first available glyph. + return; + } // No Glyph available for this charCode, try to use the alternate char. charCode = altCharCode; if (!GetCharGlyph(charCode, glyphType, glyph)) {