2014-02-28 45 views
0

例如,我使用的是04B_19__字體,如果可能的話,它肯定是一個奇怪的名字,我想重命名它。這裏是我當前的代碼如何查找使用@ FONT-FAMILY實現它:@ font-family,奇怪的字體名稱 - 我可以重命名嗎?

@font-face { 
    font-family: '04B_19__'; 
    src: url('<%= font_path('04b_19__-webfont.eot') %>'); 
    src: url('<%= font_path('04b_19__-webfont.eot') %>t') format('embedded-opentype'), 
    url('<%= font_path('04b_19__-webfont.woff') %>') format('woff'), 
    url('<%= font_path('04b_19__-webfont.ttf') %>') format('truetype'), 
    url('<%= font_path('04b_19__-webfont.svg#04B_19__') %>') format('svg'); 
} 

什麼是字體重命名爲最好的辦法更通用的,如:「四四方方的字體」爲例。

+0

只要源文件與該字體相關,就可以在font-family聲明中使用所有字體。 –

回答

3

font-family只是您分配給該字體文件集合的名稱。

您只需將其更改爲:

@font-face { 
    font-family: 'boxy-font'; 
    src: url('<%= font_path('04b_19__-webfont.eot') %>'); 
    src: url('<%= font_path('04b_19__-webfont.eot') %>t') format('embedded-opentype'), 
    url('<%= font_path('04b_19__-webfont.woff') %>') format('woff'), 
    url('<%= font_path('04b_19__-webfont.ttf') %>') format('truetype'), 
    url('<%= font_path('04b_19__-webfont.svg#04B_19__') %>') format('svg'); 
} 

,一切都將正常工作。

+0

這是正確的。如果您願意,您還可以重命名文件以匹配。 –

相關問題