Visualforce 页面中的自定义字体

Custom fonts in Visualforce pages

我正在尝试将自定义字体应用到 visualforce 页面,但 运行 遇到了麻烦。我创建了一个字体 zip 文件并将其加载到 Salesforce 的外部资源中,但它们似乎并没有发挥作用。这是我必须尝试引用它们的代码。如果可以请帮忙...

@font-face {
    font-family: 'Helvetica Neue Regular';
     src: url({!URLFOR($Resource.sncFonts, '/HelveticaNeue-Regular.ttf')});
}

.callout.std-callout{
    font-size: 12px;
    font-family: "Helvetica Neue Regular";
    color: #414141;
}

你能重新检查你的zip文件中字体文件的路径吗? 另外,您是否尝试过使用其他字体格式?

<style>
@font-face{
font-family: 'samplefont';
src: url("{!URLFOR($Resource.staticResourceName, '/Path/filename.eot')}");  /* IE9*/
src: url("{!URLFOR($Resource.staticResourceName, '/Path/filename.eot?#iefix')}") format('embedded-opentype'), /* IE6-IE8 */
url("{!URLFOR($Resource.staticResourceName, '/Path/filename.woff')}") format('woff');  /* Modern browsers*/
font-weight: 400;
font-style: normal;
}
#content { font-family: samplefont; !important }
</style>