From b43d2738ee2d18a642532683e6af62241aa8a3f0 Mon Sep 17 00:00:00 2001
From: Joshua Granick
The contents are populated automatically when an application - * is compiled using the OpenFL command-line tools, based on the - * contents of the *.nmml project file.
+ * is compiled using the Lime command-line tools, based on the + * contents of the *.xml project file. * *For most platforms, the assets are included in the same directory * or package as the application, and the paths are handled @@ -190,7 +190,7 @@ class Assets { * @param id The ID or asset path for the font * @return A new Font object */ - public static function getFont (id:String, useCache:Bool = true):#if (openfl < "3.0.0") Dynamic #else Font #end { + public static function getFont (id:String, useCache:Bool = true):Font { initialize (); @@ -1002,7 +1002,7 @@ class AssetLibrary { } - public function getFont (id:String):#if (openfl < "3.0.0") Dynamic #else Font #end { + public function getFont (id:String):Font { return null; @@ -1090,7 +1090,7 @@ class AssetLibrary { } - public function loadFont (id:String, handler:#if (openfl < "3.0.0") Dynamic #else Font #end -> Void):Void { + public function loadFont (id:String, handler:Font -> Void):Void { handler (getFont (id)); @@ -1397,7 +1397,7 @@ class Assets { if (path != null && path != "") { #if html5 - Sys.command ("haxelib", [ "run", "openfl", "generate", "-font-hash", sys.FileSystem.fullPath(path) ]); + Sys.command ("haxelib", [ "run", "lime", "generate", "-font-hash", sys.FileSystem.fullPath(path) ]); path += ".hash"; #end diff --git a/lime/graphics/Font.hx b/lime/graphics/Font.hx deleted file mode 100644 index 61ff3794b..000000000 --- a/lime/graphics/Font.hx +++ /dev/null @@ -1,45 +0,0 @@ -package lime.graphics; - - -#if (openfl < "3.0.0") - - -class Font extends lime.text.Font { - - - public var fontName (get, set):String; - - - public function new (fontName:String = null) { - - super (fontName); - - } - - - - - // Get & Set Methods - - - - - private function get_fontName ():String { - - return name; - - } - - - private function set_fontName (value:String):String { - - return name = value; - - } - - - -} - - -#end \ No newline at end of file diff --git a/lime/project/HXProject.hx b/lime/project/HXProject.hx index bbc1c491f..06004bcc5 100644 --- a/lime/project/HXProject.hx +++ b/lime/project/HXProject.hx @@ -725,13 +725,6 @@ class HXProject { project.haxelibs = []; for (haxelib in haxelibs) { - - /*if (haxelib.name == "nme" && userDefines.exists ("openfl")) { - - haxelib.name = "openfl-nme-compatibility"; - haxelib.version = ""; - - }*/ project.haxelibs.push (haxelib); diff --git a/templates/haxe/DefaultAssetLibrary.hx b/templates/haxe/DefaultAssetLibrary.hx index 2392c8e67..9a4bbeaa1 100644 --- a/templates/haxe/DefaultAssetLibrary.hx +++ b/templates/haxe/DefaultAssetLibrary.hx @@ -256,27 +256,19 @@ class DefaultAssetLibrary extends AssetLibrary { } - public override function getFont (id:String):#if (openfl < "3.0.0") Dynamic #else Font #end { + public override function getFont (id:String):Font { #if flash var src = Type.createInstance (className.get (id), []); - #if (openfl < "3.0.0") - return src; - #else + var font = new Font (src.fontName); font.src = src; return font; - #end #elseif html5 - #if (openfl < "3.0.0") - var limeFont:Font = cast (Type.createInstance (className.get (id), []), Font); - return new openfl.text.Font (limeFont.name); - #else return cast (Type.createInstance (className.get (id), []), Font); - #end #else