From cb2cb91a703c2a247aa5c53497c817aef9c70534 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Wed, 2 Sep 2015 19:23:13 -0700 Subject: [PATCH] Font embed fix --- lime/Assets.hx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lime/Assets.hx b/lime/Assets.hx index 2daaceabf..bc3759802 100644 --- a/lime/Assets.hx +++ b/lime/Assets.hx @@ -1432,6 +1432,22 @@ class Assets { var position = Context.currentPos(); var fields = Context.getBuildFields(); + if (Context.defined ("openfl")) { + + var searchTypes = classType; + + while (searchTypes.superClass != null) { + + if (searchTypes.pack.length == 2 && searchTypes.pack[0] == "openfl" && searchTypes.pack[1] == "text" && searchTypes.name == "Font") { + + return fields; + + } + + } + + } + var path = ""; var glyphs = "32-255"; @@ -1446,8 +1462,11 @@ class Assets { case EConst(CString(filePath)): path = filePath; + if (!sys.FileSystem.exists(filePath)) { + path = Context.resolvePath (filePath); + } default: