Android meets Variable Font

Android O 支援可變字型(Variable Font)啦!

在 Android O 上,Android 團隊放置了 NotoSansKhmer-VF.ttf 這個字型檔。牠是高棉語 Noto Sans——Noto Sans Khmer 的可變字型(Variable Font)版本(檔名中的 VF 就是可變字型(Variable Font)的縮寫),也是 Android 上搭載的第一個可變字型。

目前,Android 團隊尚未向 AOSP 釋出 Android O,因此這個特性的實現細節暫時無從得知。

Android 團隊在 fonts.xml 裏對 NotoSansKhmer-VF.ttf 的 code 如下:

<family lang="und-Khmr" variant="elegant">n <font weight="100" stylex="normal">NotoSansKhmer-VF.ttfn <axis tag="wdth" stylevalue="100.0" />n <axis tag="wght" stylevalue="26.0" />n </font>n <font weight="200" stylex="normal">NotoSansKhmer-VF.ttfn <axis tag="wdth" stylevalue="100.0" />n <axis tag="wght" stylevalue="39.0" />n </font>n <font weight="300" stylex="normal">NotoSansKhmer-VF.ttfn <axis tag="wdth" stylevalue="100.0" />n <axis tag="wght" stylevalue="58.0" />n </font>n <font weight="400" stylex="normal">NotoSansKhmer-VF.ttfn <axis tag="wdth" stylevalue="100.0" />n <axis tag="wght" stylevalue="90.0" />n </font>n <font weight="500" stylex="normal">NotoSansKhmer-VF.ttfn <axis tag="wdth" stylevalue="100.0" />n <axis tag="wght" stylevalue="108.0" />n </font>n <font weight="600" stylex="normal">NotoSansKhmer-VF.ttfn <axis tag="wdth" stylevalue="100.0" />n <axis tag="wght" stylevalue="128.0" />n </font>n <font weight="700" stylex="normal">NotoSansKhmer-VF.ttfn <axis tag="wdth" stylevalue="100.0" />n <axis tag="wght" stylevalue="151.0" />n </font>n <font weight="800" stylex="normal">NotoSansKhmer-VF.ttfn <axis tag="wdth" stylevalue="100.0" />n <axis tag="wght" stylevalue="169.0" />n </font>n <font weight="900" stylex="normal">NotoSansKhmer-VF.ttfn <axis tag="wdth" stylevalue="100.0" />n <axis tag="wght" stylevalue="190.0" />n </font>n </family>n

即是說,僅用一個 TTF 字型檔,透過調整 width (wdth) 和 weight (wght) 軸,就實現了從 100 至 900 的字重顯示需求(即便是 Android 的「系統字型」Roboto,也不支援 200、600 和 800 的字重)。

Android O 已進入 DP 3 (Final APIs) 測試階段,可變字型相關的 API 文件亦可以在 Android Developer 中參考。

延伸閱讀

Type is Beautiful ? 參數化設計與字體戰爭:從 OpenType 1.8 說起typeisbeautiful.com/201OpenType Font Variations Overview

Introducing OpenType Font Variations | Google Open Source Blog

The Typekit Blog | Variable fonts, a new kind of font for flexible design

Variable Fonts: the Future of (Web) Type?—?Typographica

Introducing OpenType Variable Fonts?—?John Hudson
推薦閱讀:

寫英語時有沒有必要將t i 等字母的一橫和點最後在寫?
全形西文字元是對中西文混排的優秀解決方案嗎?
iMac上Safari的默認的字體大小看起來有鋸齒,有些彆扭?
哥特體怎麼入門?
英文字體設計只需要設計 26 個字母而中文字體設計要設計一個巨大字符集的字對嗎?

TAG:字体排印 | Android | 字体 |