以下のコードを使用して拡張した TextArea で使用するフォントを埋め込もうとしていますが、機能しません。以前にこのコードを TextFlow オブジェクトで使用してから、flowComposer でコンテナーを設定しましたが、TextArea で動作させることができません。
以下のコードを使用して setText でテキストを設定すると、取得できるのは Times New Roman フォントだけです。(他は正常に動作しています)
<s:TextArea ... >
...
<fx:Style>
@font-face {
src: url("./fonts/arial.ttf");
font-family: ArialEmbedded;
}
</fx:Style>
...
public function setText(text:String):void
{
var format:TextLayoutFormat = new TextLayoutFormat();
format.color = 0x000000;
format.renderingMode = RenderingMode.CFF;
format.fontLookup = FontLookup.EMBEDDED_CFF;
var config:Configuration = new Configuration();
config.textFlowInitialFormat = format;
textFlow = TextConverter.importToFlow(text, TextConverter.TEXT_LAYOUT_FORMAT, config);
textFlow.interactionManager = new EditManager();
}
</s:TextArea>