输入字段中嵌入字体的问题
我正在尝试通过 CSS 在我的 Flex 项目中嵌入使用 css 的字体:
@font-face {
src: url("/slimCurves.ttf");
fontFamily: SlimCurves;
embedAsCFF: true;
font-weight:normal;
}
.slimCurves
{
fontFamily: SlimCurves;
fontLookup: embeddedCFF;
fontSize: 15px;
}
当我尝试将样式应用于文本输入字段时,输入字段会丢失其现有样式,但似乎不会继承自定义样式。
<s:TextInput width="100%" fontSize="33" text="test" styleName="slimCurves"/>
如果我将相同的样式应用于标签,标签将按预期显示自定义字体的文本。有什么想法吗?
I'm trying to embed a font using css on in my flex project via CSS:
@font-face {
src: url("/slimCurves.ttf");
fontFamily: SlimCurves;
embedAsCFF: true;
font-weight:normal;
}
.slimCurves
{
fontFamily: SlimCurves;
fontLookup: embeddedCFF;
fontSize: 15px;
}
When I try to apply the style to a text input field the input field looses its existing style, but doesn't seem to inherit the custom one.
<s:TextInput width="100%" fontSize="33" text="test" styleName="slimCurves"/>
If I apply the same style to a label, the label shows the text in the custom font as would be expected. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来这与所选主题有关。选择不同的模板似乎已经解决了这个问题。
Looks like this had something to do with the selected theme. Selecting a different template seems to have resolved this issue.
我认为问题是由于按钮文本默认为粗体。
您仅创建普通字体,而不创建粗体字体。
我通常使用这个代码:
亲切的问候,
克劳迪奥
I think the problems is due to the fact that Buttons Text is by default in BOLD.
You are creating only the normal Font and not the bold one.
I usually use this code:
Kind regards,
Claudio