谷歌字体模块

该模块将谷歌字体整合于 HB 框架,其允许制定多个字体及其轴范围。

赞助

成为我们的资助者或赞助商,以支持我们的工作。

本页内容

赞助商
Modulegithub.com/hbstack/google-fonts
Repository⭐ Please consider giving a star if your like it.
Stars
Version
Used by
Requirements
License
UsageSee how to use modules.

站点参数

ParameterTypeRequiredDefaultDescription
familiesarray✔️The array of font families, the first one are preferred.
families.namestring✔️Font name.
families.axisobjectFont axis.
families.axis.italarrayFont italic, range from 0 to 1.
families.axis.wghtarrayFont weight, the quantity must be the same as the families.axis.ital, range from 100 to 900 typically.

hugo.toml

 1[params]
 2  [params.hb]
 3    [params.hb.google_fonts]
 4      [[params.hb.google_fonts.families]]
 5        name = 'Roboto'
 6      [[params.hb.google_fonts.families]]
 7        name = 'Agbalumo'
 8        [params.hb.google_fonts.families.axis]
 9          ital = ['0', '1']
10          wght = ['600', '600..900']

hugo.yaml

 1params:
 2  hb:
 3    google_fonts:
 4      families:
 5      - name: Roboto
 6      - axis:
 7          ital:
 8          - "0"
 9          - "1"
10          wght:
11          - "600"
12          - 600..900
13        name: Agbalumo

hugo.json

 1{
 2   "params": {
 3      "hb": {
 4         "google_fonts": {
 5            "families": [
 6               {
 7                  "name": "Roboto"
 8               },
 9               {
10                  "axis": {
11                     "ital": [
12                        "0",
13                        "1"
14                     ],
15                     "wght": [
16                        "600",
17                        "600..900"
18                     ]
19                  },
20                  "name": "Agbalumo"
21               }
22            ]
23         }
24      }
25   }
26}

参考文档

razonyang
2024年11月21日星期四 2023年11月15日星期三