gpt4 book ai didi

css - 在 flex4.11 跨域的 CSS 中使用 @font-face 嵌入字体

转载 作者:太空宇宙 更新时间:2023-11-04 13:26:32 25 4
gpt4 key购买 nike

我正在尝试使用 flex4.11 sdk 中的@font-face 在外部 css 文件中嵌入字体。代码片段是这样的,

MyOwnFontStyle.css:

 @namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face {
src:url("font/GOTHICB.ttf");
fontFamily: myFontFamily;
embedAsCFF: true;
fontWeight: bold;
}

s|VGroup {
fontFamily: myFontFamily;
fontSize: 15;
}

构建成功,没有任何错误。但是当我启动应用程序时,它会抛出如下运行时异常,

ArgumentError:错误#1508:为参数字体指定的值无效。 在 flash.text::Font$/registerFont() 在 MyOwnFontStyle/setStyleDeclarations() 在 MethodInfo-19757() 在 flash.events::EventDispatcher/dispatchEventFunction() 在 flash.events::EventDispatcher/dispatchEvent() 在 ModuleInfoProxy/moduleEventHandler() 在 flash.events::EventDispatcher/dispatchEventFunction() 在 flash.events::EventDispatcher/dispatchEvent() 在 ModuleInfo/readyHandler() 在 flash.events::EventDispatcher/dispatchEventFunction() 在 flash.events::EventDispatcher/dispatchEvent() 在 mx.core::FlexModuleFactory/update() 在 mx.core::FlexModuleFactory/docFrameHandler() 在 mx.core::FlexModuleFactory/docFrameListener()

如果有人遇到这种情况,请分享您的想法以解决此问题。提前致谢。

最佳答案

如果有人遇到同样的问题,请在您的主应用程序中强制包含以下语句。

导入 mx.core.EmbeddedFontRegistry;

私有(private)变量 embeddedFontRegistry:EmbeddedFontRegistry;

关于css - 在 flex4.11 跨域的 CSS 中使用 @font-face 嵌入字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23675346/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com