v0.7.5b: added some error handling behaviour to new rendered text

This commit is contained in:
Evan Debenham
2019-10-12 02:09:09 -04:00
parent dc574ffc07
commit 18349b146e
2 changed files with 15 additions and 4 deletions

View File

@@ -92,6 +92,12 @@ public class RenderedText extends Image {
GlyphLayout l = new GlyphLayout( font, text);
for (char c : text.toCharArray()) {
if (font.getData().getGlyph(c) == null){
Game.reportException(new Throwable("font file " + font.toString() + " could not render " + c));
}
}
width = l.width;
//this is identical to l.height in most cases, but we force this for consistency.