2017-03-16 50 views
0

我想將自定義字體應用於Visualforce頁面,並且正在運行到磚牆中。我創建了一個字體的zip文件並將其加載到Salesforce的外部資源中,但它們似乎並沒有採取任何措施。這裏是我必須嘗試並引用它們的代碼。請幫助,如果你可以...Visualforce頁面中的自定義字體

@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; 
} 
+0

yu是如何讓它工作的?我在相同的情況下 – Khaleel

+0

嗨Khaleel,我確實按照答案所示,但資源必須是本地的。下面是一個片段:@ font-face font-family:'Helvetica Neue Regular'; src:url(「{!URLFOR($ Resource.sncFonts,'/sncFonts/HelveticaNeue-Regular.ttf')}」); } – user2569499

回答

0

你可以重新檢查你的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> 
+0

接受該答案的人..是否有效? – Khaleel

相關問題