我想使用名爲Daniel的字體類型,但在Google Fonts中找不到它。 有沒有什麼辦法在我的網站上使用這種字體?如何包含Google字體中未找到的特定字體系列?
1
A
回答
4
你必須在你的css中下載字體文件和delcare字體。 你可以檢查www.w3schools.com瞭解更多詳情。這裏有一個例子:
@font-face {
font-family: Montserrat;
src: url("./fonts/Montserrat-Regular.otf");
font-weight: normal;
font-style: normal;
}@font-face {
font-family: Montserrat;
src: url("./fonts/Montserrat-Bold.otf");
font-weight: bold;
font-style: normal;
}@font-face {
font-family: Montserrat Light;
src: url("./fonts/Montserrat-Light.otf");
font-weight: normal;
font-style: normal;
}@font-face {
font-family: Montserrat Thin;
src: url("./fonts/Montserrat-Thin.otf");
font-weight: normal;
font-style: normal;
}@font-face {
font-family: Montserrat Medium;
src: url("./fonts/Montserrat-Medium.otf");
font-weight: normal;
font-style: normal;
}@font-face {
font-family: Montserrat SemiBold;
src: url("./fonts/Montserrat-SemiBold.otf");
font-weight: normal;
font-style: normal;
}
+1
請注意,您將需要多種格式作爲答案狀態以支持不同的瀏覽器。假設你沒有這些,你可以使用像[Transfonter](https://transfonter.org/)這樣的服務爲你創建它們(以及必要的CSS)。 –
+1
也你應該搜索woff格式或使用一些軟件來使它... otf和ttf不支持IE直到EDGE – Wordica
相關問題
- 1. 如何在JSFiddle中包含Google字體?
- 2. 包含字體的系統
- 3. 如何在Google Visualization API中指定自定義CSS字體/字體系列?
- 4. 如何確定哪些字體包含特定字符?
- 5. 如何檢查哪些字體包含perl的特定字符?
- 6. 如何找出PDF文檔中字體的字體系列和字體大小?
- 7. 如何判斷特定字體是否包含PDF中的特定字符:: API2
- 8. 爲什麼'matplotlib'找不到指定字體的特定字體?
- 9. css - 機器特定的字體系列
- 10. 如何使用字體系列中的特定樣式?
- 11. 如何使用+ fontWithName:size創建字體,並指定字體系列名稱和字體的特定樣式信息?
- 12. 如何查找包含某個字形的.TTF字體?
- 13. Cordova FontAwesome字體未找到
- 14. 未找到合併字典的字體
- 15. 更改Google Maps API的字體系列
- 16. 指定爲CSS字體系列值是什麼是正確的:字體,字體或字體系列?
- 17. 在Seaside中包含字體
- 18. Grails 3如何包含字體真棒字體
- 19. 如何找到包含特定子字符串的listitem
- 20. Google Charts使用哪種字體系列?
- 21. Rails:如何查找包含特定字符串的字段
- 22. 根據字體系列組織字體
- 23. 如何使用Swing訪問字體系列的所有字體
- 24. Bower + bootstrap主題 - 如何包含字體?
- 25. 如何將字體包含爲資源?
- 26. Haml:如何包含谷歌字體
- 27. 查找用於渲染字符或包含字形的字體?
- 28. 如何獲取給定字體文件的字體系列的名稱?
- 29. 如何將段落的字體更改爲特定字體CSS
- 30. 如何使用多個Icomoon字體(多種字體系列)
你試着問前研究這個? – Valentin
下載Webfont工具包並按照說明操作 https://www.fontsquirrel.com/fonts/daniel – Nehemiah