Preserve font properties in AssetLibrary.loadFont

This commit is contained in:
Kostas Chatzikokolakis
2018-01-17 20:07:28 +01:00
committed by Joshua Granick
parent e376fd206e
commit e084ef7c70

View File

@@ -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