我想覆盖MinimalDesktopTheme
默认字体(能够使用UTF-8字符),我已经像这样扩展了主题类:
public class DesktopTheme extends MinimalDesktopTheme
{
public function DesktopTheme()
{
super();
}
override protected function initializeFonts():void
{
super.initializeFonts();
trace(TextField.getBitmapFont(FontProxy.ACTION_JACKSON_NAME));
this.primaryTextFormat = new BitmapFontTextFormat(
FontProxy.ACTION_JACKSON_NAME,
30,
BaseMinimalDesktopTheme.PRIMARY_TEXT_COLOR
);
}
}
跟踪显示字体已成功注册:[object BitmapFont]
。在执行此代码之前,我在不同的地方注册它。
问题是来自feathers.core::FeathersControl/setSizeInternal
行1871
的异常,并带有以下消息[Fault] exception, information=ArgumentError: A component's height cannot be NaN.
height
参数由于某种原因不是数字。
在生成位图字体时我也在玩字体大小,我注意到,对于位图字体大小的某些值,不会发生此异常。
我做错了什么?如何正确覆盖默认主题字体?
答案 0 :(得分:0)
事实证明我的方法是正确的,问题是由于我以纯文本格式而不是XML生成位图字体。