開始使用 Android 版 Google 字型
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android O 和 AndroidX 程式庫新增對
可下載的字型。
Google Fonts 即將在 Google Play 服務中提供字型提供者。也就是說
Android 裝置內建 Google Fonts 字型。
我可以使用哪些字型?
完整的 Google Fonts 開放原始碼系列!前往
https://fonts.google.com 即可開始瀏覽。
系統支援哪些 Android 版本?
我們的供應商支援 Jelly Bean (API 級別 16) 以上版本。代表 95%以上的
對外公開的 Android 裝置
(平台資訊主頁)。
可透過 AndroidX 程式庫中的 API 存取
(androidx.core)
或 Android O (API 級別 26)。
我該如何開始!
如要向 Google Fonts 供應器要求字型,請使用下列查詢格式:
參數 |
必填與否 |
範圍 |
資料類型 |
預設值 |
名稱 |
是 |
來自 font.google.com 的任何家庭 |
字串 |
|
寬度 |
否 |
>0 分 |
float |
100 |
重量 |
否 |
(0, 1000) 不含 |
int |
400 |
斜體 |
否 |
[0, 1] 含頭尾 |
float |
0 |
盡力 |
否 |
true/false |
布林值 |
true |
如果最佳狀況是 true,且查詢指定了有效的姓氏,
不支援要求的寬度/粗細/斜體值,系統會傳回最適當的值
在家中找到許多相符的技術舉例來說
體重為 900 的 Oswald 值將會傳回
野牛的重量為 700。
查詢範例:
name=Lobster # Lobster, 400 weight
name=Lato&weight=100 # Lato, 100 weight
name=Open Sans&weight=800&italic=1 # Open Sans, 800 weight, italic
安全性
為了安全起見,您必須指定
接收字型的供應商名稱Android Studio 會將
您的正確簽名。詳情請見
新增憑證。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-22 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-08-22 (世界標準時間)。"],[[["Android now supports downloadable fonts, including the entire Google Fonts collection, via Android O and AndroidX Library."],["Google Fonts are readily available for native Android apps through a Font Provider in Google Play Services, supporting Android Jelly Bean (API level 16) and above."],["Developers can access Google Fonts declaratively or programmatically and easily customize font attributes like width, weight, and italic style."],["A built-in \"best effort\" feature ensures the closest font match if the specific requested style is unavailable within the chosen font family."],["For security, applications utilizing the Google Fonts provider must specify the provider's signature, a process simplified within Android Studio."]]],[]]