From e629b1557c1ceafad7567041a6ceb10f5c0bc0bc Mon Sep 17 00:00:00 2001 From: Maud Date: Sat, 27 Oct 2018 20:21:29 +0200 Subject: [PATCH] Unicode correction http://community.stencyl.com/index.php?issue=1330.0 http://community.stencyl.com/index.php?issue=714.0 (tested on computer, but edited by hand on the ui, so you should test before patching it) --- com/stencyl/graphics/fonts/BitmapFont.hx | 28 +++++------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/com/stencyl/graphics/fonts/BitmapFont.hx b/com/stencyl/graphics/fonts/BitmapFont.hx index da3106fc..7bfd56bd 100644 --- a/com/stencyl/graphics/fonts/BitmapFont.hx +++ b/com/stencyl/graphics/fonts/BitmapFont.hx @@ -10,6 +10,8 @@ import openfl.geom.Matrix; import openfl.geom.Point; import openfl.geom.Rectangle; +using lime._internal.unifill.Unifill; + #if (flash) typedef PixelColor = UInt; #else @@ -455,28 +457,10 @@ class BitmapFont var glyph:FontSymbol; var glyphWidth:Int; #end - - var realCount = 0; - for (i in 0...(pText.length)) - { - if(i < realCount) - { - continue; - } - - var charCode:Int = pText.charCodeAt(i); - - //Pseudo Unicode - if(charCode == 126) - { - if(pText.charAt(i + 1) == 'x') - { - var unicodeChar = pText.substring(i + 2, i + 6); - charCode = Std.parseInt("0x" + unicodeChar); - realCount += 5; - } - } + for (c in pText.uIterator()) + { + var charCode:Int = c.toInt(); #if (!use_tilemap) glyph = pFontData[charCode]; @@ -529,8 +513,6 @@ class BitmapFont _point.x += glyphWidth * pScale + pLetterSpacing; #end } - - realCount++; } }