From ddf2e289018b5d21fe497accbb7d5cbd9cc3fcd1 Mon Sep 17 00:00:00 2001 From: Song Minjae Date: Thu, 23 Mar 2017 21:15:40 +0900 Subject: [PATCH] removing old hacks --- Slick2d/GameFontBase.kt | 11 +++++------ .../net/torvald/terrarum/imagefont/GameFontBase.kt | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Slick2d/GameFontBase.kt b/Slick2d/GameFontBase.kt index b25058d..902d590 100644 --- a/Slick2d/GameFontBase.kt +++ b/Slick2d/GameFontBase.kt @@ -132,15 +132,14 @@ open class GameFontBase : Font { val chr = s[i] val ctype = getSheetType(s[i]) - if (chr.toInt() == 0x21B) // Romanian t; HAX! - len += 6 - else if (variableWidthSheets.contains(ctype)) { - try { - len += asciiWidths[chr.toInt()]!! + if (variableWidthSheets.contains(ctype)) { + len += try { + asciiWidths[chr.toInt()]!! } catch (e: kotlin.KotlinNullPointerException) { println("KotlinNullPointerException on glyph number ${Integer.toHexString(chr.toInt()).toUpperCase()}") - System.exit(1) + //System.exit(1) + W_LATIN_WIDE // failsafe } } else if (zeroWidthSheets.contains(ctype)) diff --git a/demo/src/net/torvald/terrarum/imagefont/GameFontBase.kt b/demo/src/net/torvald/terrarum/imagefont/GameFontBase.kt index b25058d..902d590 100644 --- a/demo/src/net/torvald/terrarum/imagefont/GameFontBase.kt +++ b/demo/src/net/torvald/terrarum/imagefont/GameFontBase.kt @@ -132,15 +132,14 @@ open class GameFontBase : Font { val chr = s[i] val ctype = getSheetType(s[i]) - if (chr.toInt() == 0x21B) // Romanian t; HAX! - len += 6 - else if (variableWidthSheets.contains(ctype)) { - try { - len += asciiWidths[chr.toInt()]!! + if (variableWidthSheets.contains(ctype)) { + len += try { + asciiWidths[chr.toInt()]!! } catch (e: kotlin.KotlinNullPointerException) { println("KotlinNullPointerException on glyph number ${Integer.toHexString(chr.toInt()).toUpperCase()}") - System.exit(1) + //System.exit(1) + W_LATIN_WIDE // failsafe } } else if (zeroWidthSheets.contains(ctype))