嵌入的字体将无法在Flex移动ActionBar中工作 [英] embedded font won't work in Flex mobile ActionBar
问题描述
我已经嵌入了一些字体,并在移动应用程序中使用它们,除了我尝试用于ActionBar的字体之外,它们都在工作。他们在其他地方工作,用>Comic Sans MS代替
titleCGF
将其更改为Comic Sans。那么为什么它不能用于我的自定义fontFamily?
< fx:Style>
@namespace slibrary://ns.adobe.com/flex/spark;
@ font-face {
src:url(assets / Comic_Book.ttf);
fontFamily:comic;
embedAsCFF:false;
}
/ ******************************
@ font-face {
src:url(assets / CGF_Locust_Resistance.ttf);
fontFamily:titleCGF;
embedAsCFF:false;
}
@ font-face {
src:url(assets / CGF_Locust_Resistance.ttf);
fontFamily:titleCGF;
embedAsCFF:true;
}
********************************** /
.titleStyle {
fontFamily:titleCGF;
颜色:#FFFFFF;
}
.comicMessage {
fontFamily:titleCGF;
颜色:#838689;
fontSize:14;
}
s | IconItemRenderer {
fontFamily:comic;
颜色:#FEBA03;
fontSize:18;
}
s | ActionBar {
defaultButtonAppearance:beveled;
accentColor:#FEBA03;
}
s | ActionBar #titleDisplay {
fontFamily:titleCGF;
}
< / fx:样式>
这就是我得到的:
编辑:我试图让自己的皮肤和预先编写的代码的一部分是这样的:
<! - SkinParts
name = titleGroup ,type = spark.components.Group,required = false
name = actionGroup,type = spark.components.Group,required = false
name = navigationGroup,type = spark.components.Group,required = false
name = titleDisplay,type = spark.core.IDisplayText,required = false
- >
当我尝试定义前三个元素时,< s: Group ... />
,它工作正常。但没有任何显示spark.core.IDisplayText。即< s:IDisplayText ... />
yeilds nothing ...
这里是嵌入字体两次的示例,一次embedAsCFF = false,再次使用embedAsCFF = true。在 http://查看完整说明blogs.adobe.com/jasonsj/2011/08/embedding-fonts-in-flex-mobile-projects.html 。
编辑1:固定字体文件名
$ $ p $ code $ StyleBuilderField常规* /
@ font-face {
src:url( 资产/ COMIC.TTF);
fontFamily:comic;
embedAsCFF:false;
$ b $ * StyleableTextField,bold * /
@ font-face {
src:url(assets / COMICBD.TTF);
fontFamily:comic;
fontWeight:bold;
embedAsCFF:false;
$ b $ *标签,常规* /
@ font-face {
src:url(assets / COMIC.TTF);
fontFamily:comicCFF;
embedAsCFF:true;
$ b $ * / *标签,粗体* /
@ font-face {
src:url(assets / COMICBD.TTF);
fontFamily:comicCFF;
fontWeight:bold;
embedAsCFF:true;
}
s |标签
{
fontFamily:comicCFF;
}
s | ActionBar
{
fontFamily:comic;
}
s | LabelItemRenderer
{
fontFamily:comic;
}
i've got a few fonts embedded and am using them in my mobile application, and they are all working, except for the ones i try to use for the "ActionBar". They work everywhere else, and substituting "Comic Sans MS"
for "titleCGF"
changes it to Comic Sans. So why won't it work with my custom fontFamily?
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@font-face {
src: url("assets/Comic_Book.ttf");
fontFamily: comic;
embedAsCFF: false;
}
/******************************
@font-face{
src: url("assets/CGF_Locust_Resistance.ttf");
fontFamily: titleCGF;
embedAsCFF: false;
}
@font-face{
src: url("assets/CGF_Locust_Resistance.ttf");
fontFamily: titleCGF;
embedAsCFF: true;
}
**********************************/
.titleStyle{
fontFamily: titleCGF;
color: #FFFFFF;
}
.comicMessage{
fontFamily: titleCGF;
color: #838689;
fontSize: 14;
}
s|IconItemRenderer{
fontFamily: comic;
color: #FEBA03;
fontSize:18;
}
s|ActionBar{
defaultButtonAppearance: beveled;
accentColor: #FEBA03;
}
s|ActionBar #titleDisplay{
fontFamily: "titleCGF";
}
</fx:Style>
this is what i get:
EDIT: i tried to make my own skin, and part of the pre-written code is this:
<!-- SkinParts
name=titleGroup, type=spark.components.Group, required=false
name=actionGroup, type=spark.components.Group, required=false
name=navigationGroup, type=spark.components.Group, required=false
name=titleDisplay, type=spark.core.IDisplayText, required=false
-->
when i try to define something like the first three, <s:Group .../>
, it works fine. But nothing shows up for spark.core.IDisplayText. ie, <s:IDisplayText .../>
yeilds nothing...
Here's an example of embedding fonts twice, once with embedAsCFF=false and again using embedAsCFF=true. View the full explanation at http://blogs.adobe.com/jasonsj/2011/08/embedding-fonts-in-flex-mobile-projects.html.
Edit 1: Fixed font file name
/* StyleableTextField, regular */
@font-face {
src: url("assets/COMIC.TTF");
fontFamily: "comic";
embedAsCFF: false;
}
/* StyleableTextField, bold */
@font-face {
src: url("assets/COMICBD.TTF");
fontFamily: "comic";
fontWeight: bold;
embedAsCFF: false;
}
/* Label, regular */
@font-face {
src: url("assets/COMIC.TTF");
fontFamily: "comicCFF";
embedAsCFF: true;
}
/* Label, bold */
@font-face {
src: url("assets/COMICBD.TTF");
fontFamily: "comicCFF";
fontWeight: bold;
embedAsCFF: true;
}
s|Label
{
fontFamily: "comicCFF";
}
s|ActionBar
{
fontFamily: "comic";
}
s|LabelItemRenderer
{
fontFamily: "comic";
}
这篇关于嵌入的字体将无法在Flex移动ActionBar中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!