diff --git a/lime/text/Font.hx b/lime/text/Font.hx index 72288dc16..2b8985bbb 100644 --- a/lime/text/Font.hx +++ b/lime/text/Font.hx @@ -13,6 +13,10 @@ import js.html.CanvasElement; import js.html.CanvasRenderingContext2D; #end +#if (cpp || neko || nodejs) +import haxe.io.Path; +#end + #if !macro @:build(lime.system.CFFI.build()) #end @@ -38,7 +42,9 @@ class Font { public var unitsPerEM (get, null):Int; @:noCompletion private var __fontPath:String; - + #if (cpp || neko || nodejs) + @:noCompletion private var __fontPathWithoutDirectory:String; + #end public function new (name:String = null) { @@ -356,6 +362,8 @@ class Font { #if (cpp || neko || nodejs) + __fontPathWithoutDirectory = null; + src = lime_font_load (bytes); if (src != null && name == null) { @@ -375,6 +383,8 @@ class Font { #if (cpp || neko || nodejs) + __fontPathWithoutDirectory = Path.withoutDirectory (__fontPath); + src = lime_font_load (__fontPath); if (src != null && name == null) {