嵌入式字体看起来与预期的有所不同 [英] Embedded font looks different than supposed to
问题描述
当标签使用嵌入式字体时,它看起来是正确的,但是当组合框使用相同的字体时,所选项目的字体看起来与下拉菜单和标签字体不同.
When an embedded font is used for a label it looks correct, but when the same font is used for a combobox, the selected item font looks different from the dropdown and label font.
@font-face
{
src:url("/assets/fonts/Helvetica.TTF");
fontFamily: "Helvetica Neue Bold Condensed";
fontStyle: normal;
fontWeight: normal;
}
.comboBox
{
fontFamily: "Helvetica Neue Bold Condensed";
fontSize: 11;
color: #666666;
}
.label
{
fontFamily: "Helvetica Neue Bold Condensed";
fontSize: 12;
color: #CCCCCC;
}
为什么这些看起来不同(除了大小和颜色)?
Why would these look different (besides the size and color)?
推荐答案
您要嵌入字体,并指定在fontWeight正常时应使用该字体.这就是fontWeight: normal
样式的含义.
You are embedding a font and specifying that it should be used whenever the fontWeight is normal. This is what the fontWeight: normal
style means.
但是,组合框中的标签默认情况下为粗体(这是由Flex框架完成的),因此它们将不使用嵌入字体.
However, the labels in combo boxes are bold by default (this is done by the Flex framework), so they will not use the embedded font.
要修复:请创建您的@font-face
声明的另一副本并使其成为fontWeight: bold
,或者在.comboBox
规则上指定fontWeight: normal
.
To fix: Either create another copy of your @font-face
declaration and make that one fontWeight: bold
, or specify fontWeight: normal
on your .comboBox
rule.
这篇关于嵌入式字体看起来与预期的有所不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!