|
@@ -3,7 +3,9 @@ package hxd.res;
|
|
class Font extends Resource {
|
|
class Font extends Resource {
|
|
|
|
|
|
public function build( size : Int, ?options ) : h2d.Font {
|
|
public function build( size : Int, ?options ) : h2d.Font {
|
|
- #if flash
|
|
|
|
|
|
+ #if lime
|
|
|
|
+ return FontBuilder.getFont(name, size, options);
|
|
|
|
+ #elseif flash
|
|
var fontClass : Class<flash.text.Font> = cast Type.resolveClass("_R_" + ~/[^A-Za-z0-9_]/g.replace(entry.path, "_"));
|
|
var fontClass : Class<flash.text.Font> = cast Type.resolveClass("_R_" + ~/[^A-Za-z0-9_]/g.replace(entry.path, "_"));
|
|
if( fontClass == null ) throw "Embeded font not found " + entry.path;
|
|
if( fontClass == null ) throw "Embeded font not found " + entry.path;
|
|
var font = Type.createInstance(fontClass, []);
|
|
var font = Type.createInstance(fontClass, []);
|
|
@@ -11,8 +13,6 @@ class Font extends Resource {
|
|
#elseif js
|
|
#elseif js
|
|
var name = "R_" + ~/[^A-Za-z0-9_]/g.replace(entry.path, "_");
|
|
var name = "R_" + ~/[^A-Za-z0-9_]/g.replace(entry.path, "_");
|
|
return FontBuilder.getFont(name, size, options);
|
|
return FontBuilder.getFont(name, size, options);
|
|
- #elseif lime
|
|
|
|
- return FontBuilder.getFont(name, size, options);
|
|
|
|
#else
|
|
#else
|
|
throw "Not implemented for this platform";
|
|
throw "Not implemented for this platform";
|
|
return null;
|
|
return null;
|