【发布时间】:2012-03-30 19:35:47
【问题描述】:
我想使用外部字体WebSymbols
我把它放在我的 stylesheet.css 声明中
@font-face{
font-family: 'WebSymbolsRegular';
src: url('websymbols-regular-webfont.eot');
src: url('websymbols-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('websymbols-regular-webfont.woff') format('woff'),
url('websymbols-regular-webfont.ttf') format('truetype'),
url('websymbols-regular-webfont.svg#WebSymbolsRegular') format('svg');
}
.fakeImage {
font-family: 'WebSymbolsRegular';
font-size: 12px;
text-decoration: none;
}
我的 stylesheet.css 位于 META-INF/resources/css/stylesheet.css 文件中。我将字体文件(eot、svg 等)放在同一个目录 - META-INF/resources/css。在我的 jsf 页面的标题中,我引用了这个样式表:
<h:outputStylesheet library="css" name="stylesheet.css" />
但我得到的是常规文本,而不是字体中的特殊符号。所有其他 css 样式都可以正常工作。知道如何使用自定义字体吗?
【问题讨论】:
-
是的,这在 oracle java ee 6 教程中进行了描述,因为我想参考页面中的图像,例如
-
好吧不知道。删除了我的评论。