Skip to content

Commit 22cef33

Browse files
authored
Merge pull request #8932 from unknownbrackets/font-minor
Font: Draw nothing for chars before first glyph
2 parents ef3f369 + eacebd4 commit 22cef33

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Core/Font/PGF.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,10 @@ bool PGF::GetCharGlyph(int charCode, int glyphType, Glyph &glyph) const {
555555
void PGF::DrawCharacter(const GlyphImage *image, int clipX, int clipY, int clipWidth, int clipHeight, int charCode, int altCharCode, int glyphType) const {
556556
Glyph glyph;
557557
if (!GetCharGlyph(charCode, glyphType, glyph)) {
558+
if (charCode < firstGlyph) {
559+
// Don't draw anything if the character is before the first available glyph.
560+
return;
561+
}
558562
// No Glyph available for this charCode, try to use the alternate char.
559563
charCode = altCharCode;
560564
if (!GetCharGlyph(charCode, glyphType, glyph)) {

0 commit comments

Comments
 (0)