Fix for embedded fonts

This commit is contained in:
Joshua Granick
2015-06-01 17:03:34 -07:00
parent 95a71217cf
commit a053dfa081
2 changed files with 6 additions and 2 deletions

View File

@@ -38,8 +38,12 @@ class Font {
public function new (name:String = null) {
if (name != null) {
this.name = name;
}
if (__fontPath != null) {
__fromFile (__fontPath);

View File

@@ -711,7 +711,7 @@ class DefaultAssetLibrary extends AssetLibrary {
#end
#if openfl
::if (assets != null)::::foreach assets::::if (type == "font")::@:keep #if display private #end class __ASSET__OPENFL__::flatName:: extends openfl.text.Font { public function new () { __fontPath = "::targetPath::"; name = "::fontName::"; super (); }}
::if (assets != null)::::foreach assets::::if (type == "font")::@:keep #if display private #end class __ASSET__OPENFL__::flatName:: extends openfl.text.Font { public function new () { ::if (embed)::var font = new __ASSET__::flatName:: (); src = font.src; name = font.name;::else::__fontPath = "::targetPath::"; name = "::fontName::";::end:: super (); }}
::end::::end::::end::
#end