集成字体

Her*_*zog 2 css fonts jsf-2

我正在将css集成到我的JSF2应用程序中,并且有些东西不能使用这些字体.这是我尝试的方式:

字体在WebContent/resources/fonts中(在Eclipse上.)在同一目录中我有一个stylesheet.css文件,我声明了这样的字体:

@font-face {
font-family: 'TitilliumText22LRegular';
src: url('titilliumtext22lregular-webfont.eot');
src: url('titilliumtext22lregular-webfont.eot?#iefix') format('embedded-opentype'),
     url('titilliumtext22lregular-webfont.woff') format('woff'),
     url('titilliumtext22lregular-webfont.ttf') format('truetype'),
     url('titilliumtext22lregular-webfont.svg#TitilliumText22LRegular') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)

我在我的应用程序的header.xhtml中连接到样式表:

<h:outputStylesheet library="fonts" name="stylesheet.css"/>
Run Code Online (Sandbox Code Playgroud)

尝试连接到此的css类元素位于resources/css中,称为style.css.班级本身:

.time {
    font: 19px 'TitilliumText22LRegular';
    text-transform: uppercase;
    line-height: 1.8;
    white-space: nowrap;
}
Run Code Online (Sandbox Code Playgroud)

总之,我可以说这应该工作.但事实并非如此.我究竟做错了什么?

hch*_*rge 6

你有没有尝试过使用速记字体?尝试使用font-family: 'TitilliumText22LRegular';,看看会发生什么?