Preserve font properties in AssetLibrary.loadFont
This commit is contained in:
committed by
Joshua Granick
parent
e376fd206e
commit
e084ef7c70
@@ -21,6 +21,8 @@ import flash.media.Sound;
|
||||
@:noDebug
|
||||
#end
|
||||
|
||||
@:access(lime.text.Font)
|
||||
|
||||
|
||||
class AssetLibrary {
|
||||
|
||||
@@ -560,7 +562,9 @@ class AssetLibrary {
|
||||
var font:Font = Type.createInstance (classTypes.get (id), []);
|
||||
|
||||
#if (js && html5)
|
||||
return Font.loadFromName (font.name);
|
||||
// font might have properties set via its classType constructor.
|
||||
// Use __loadFromName to preserve these properties in the loaded font.
|
||||
return font.__loadFromName (font.name);
|
||||
#else
|
||||
return Future.withValue (font);
|
||||
#end
|
||||
|
||||
Reference in New Issue
Block a user