Skip to content

Commit

Permalink
Merge pull request #8932 from unknownbrackets/font-minor
Browse files Browse the repository at this point in the history
Font: Draw nothing for chars before first glyph
  • Loading branch information
hrydgard authored Aug 28, 2016
2 parents ef3f369 + eacebd4 commit 22cef33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/Font/PGF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 22cef33

Please sign in to comment.