Use true font names and automatically register font names on native platforms

This commit is contained in:
Joshua Granick
2014-11-01 09:44:59 -07:00
parent facc1a20c1
commit fe17a43f72
7 changed files with 169 additions and 83 deletions

View File

@@ -6,6 +6,7 @@ import haxe.Unserializer;
import lime.app.Preloader;
import lime.audio.openal.AL;
import lime.audio.AudioBuffer;
import lime.graphics.Font;
import lime.graphics.Image;
import lime.utils.ByteArray;
import lime.utils.UInt8Array;
@@ -58,6 +59,12 @@ class DefaultAssetLibrary extends AssetLibrary {
#else
#if openfl
::if (assets != null)::
::foreach assets::::if (type == "font")::openfl.text.Font.registerFont (__ASSET__::flatName::);::end::
::end::::end::
#end
#if (windows || mac || linux)
/*var useManifest = false;
@@ -650,6 +657,10 @@ class DefaultAssetLibrary extends AssetLibrary {
#elseif (windows || mac || linux)
::if (assets != null)::
#if openfl
::foreach assets::::if (type == "font")::class __ASSET__::flatName:: extends openfl.text.Font { public function new () { super (); __fontPath = "::targetPath::"; fontName = "::fontName::"; }}
::end::::end::
#end
//::foreach assets::::if (embed)::::if (type == "image")::@:bitmap("::sourcePath::") class __ASSET__::flatName:: extends openfl.display.BitmapData {}
//::elseif (type == "sound")::@:sound("::sourcePath::") class __ASSET__::flatName:: extends openfl.media.Sound {}
//::elseif (type == "music")::@:sound("::sourcePath::") class __ASSET__::flatName:: extends openfl.media.Sound {}