nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2163c2d
)
gamnit: fix crash on character missing from font
author
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 14 Sep 2017 17:48:19 +0000
(13:48 -0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 25 Sep 2017 15:11:11 +0000
(11:11 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/gamnit/bmfont.nit
patch
|
blob
|
history
diff --git
a/lib/gamnit/bmfont.nit
b/lib/gamnit/bmfont.nit
index
c2c8be5
..
a7afc56
100644
(file)
--- a/
lib/gamnit/bmfont.nit
+++ b/
lib/gamnit/bmfont.nit
@@
-477,6
+477,13
@@
class BMFontAsset
var w = text[wi]
if w == '\n' or w == pld or w == plu or w.is_whitespace or (in_link and w == ']') then break
+
+ if not desc.chars.keys.has(w) then
+ var rc = replacement_char
+ if rc == null then continue
+ w = rc
+ end
+
word_len += advance(prev_w, w) * scale
prev_w = w
end