@dataimago/css 0.1.0-alpha.20 → 0.1.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -0
- package/dist/bin/dataimago-figures.mjs +703 -0
- package/dist/bin/dataimago-sync.mjs +281 -19
- package/dist/dataimago.css +9 -3
- package/dist/dataimago.min.css +1 -1
- package/dist/dataviz/dataimago-dataviz.css +1 -1
- package/dist/dataviz/dataimago-dataviz.json +2 -2
- package/dist/dataviz/dataimago-dataviz.tex +1 -1
- package/dist/dataviz/dataimago_dataviz.R +1 -1
- package/dist/figures/NotoSans-Bold.otf +0 -0
- package/dist/figures/NotoSans-BoldItalic.otf +0 -0
- package/dist/figures/NotoSans-Italic.otf +0 -0
- package/dist/figures/NotoSans-Regular.otf +0 -0
- package/dist/figures/NotoSansMath-Regular.ttf +0 -0
- package/dist/figures/OFL-NotoSans.txt +93 -0
- package/dist/figures/OFL-NotoSansMath.txt +93 -0
- package/dist/figures/dataimago-figure.sty +105 -0
- package/dist/figures/dataimago-tokens.sty +134 -0
- package/dist/fonts/cyrillic/OFL-NotoSans.txt +93 -0
- package/dist/fonts/cyrillic/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/cyrillic/fonts.css +27 -0
- package/dist/fonts/cyrillic/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/cyrillic/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/cyrillic/noto-sans.woff2 +0 -0
- package/dist/fonts/cyrillic-ext/OFL-NotoSans.txt +93 -0
- package/dist/fonts/cyrillic-ext/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/cyrillic-ext/fonts.css +27 -0
- package/dist/fonts/cyrillic-ext/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/cyrillic-ext/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/cyrillic-ext/noto-sans.woff2 +0 -0
- package/dist/fonts/greek/OFL-NotoSans.txt +93 -0
- package/dist/fonts/greek/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/greek/fonts.css +27 -0
- package/dist/fonts/greek/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/greek/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/greek/noto-sans.woff2 +0 -0
- package/dist/fonts/greek-ext/OFL-NotoSans.txt +93 -0
- package/dist/fonts/greek-ext/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/greek-ext/fonts.css +27 -0
- package/dist/fonts/greek-ext/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/greek-ext/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/greek-ext/noto-sans.woff2 +0 -0
- package/dist/fonts/josefin/OFL-JosefinSans.txt +93 -0
- package/dist/fonts/josefin/fonts.css +8 -0
- package/dist/fonts/josefin/josefin-sans.woff2 +0 -0
- package/dist/fonts/lang.css +181 -0
- package/dist/fonts/latin/OFL-NotoSans.txt +93 -0
- package/dist/fonts/latin/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/latin/fonts.css +27 -0
- package/dist/fonts/latin/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/latin/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/latin/noto-sans.woff2 +0 -0
- package/dist/fonts/latin-ext/OFL-NotoSans.txt +93 -0
- package/dist/fonts/latin-ext/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/latin-ext/fonts.css +27 -0
- package/dist/fonts/latin-ext/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/latin-ext/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/latin-ext/noto-sans.woff2 +0 -0
- package/dist/fonts/math/OFL-NotoSansMath.txt +93 -0
- package/dist/fonts/math/fonts.css +8 -0
- package/dist/fonts/math/noto-sans-math.woff2 +0 -0
- package/dist/fonts/pkg/GFL.txt +29 -0
- package/dist/fonts/pkg/README-lm.txt +27 -0
- package/dist/fonts/pkg/fonts.css +8 -0
- package/dist/fonts/pkg/lmsans10-regular.woff2 +0 -0
- package/dist/fonts/vietnamese/OFL-NotoSans.txt +93 -0
- package/dist/fonts/vietnamese/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/vietnamese/fonts.css +27 -0
- package/dist/fonts/vietnamese/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/vietnamese/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/vietnamese/noto-sans.woff2 +0 -0
- package/dist/latex/dataimago-tokens.sty +14 -2
- package/dist/latex/dataimago.sty +6 -1
- package/dist/outputs.json +105 -21
- package/dist/quarto/_extensions/dataimago/monograph/_extension.yml +35 -0
- package/dist/quarto/_extensions/dataimago/monograph/dataimago-base.sty +275 -0
- package/dist/quarto/_extensions/dataimago/monograph/dataimago-monograph.sty +270 -0
- package/dist/quarto/_extensions/dataimago/monograph/dataimago-tokens.sty +134 -0
- package/dist/quarto/_extensions/dataimago/monograph/filters/figure-plate.lua +52 -0
- package/dist/quarto/_extensions/dataimago/monograph/filters/matter.lua +170 -0
- package/dist/quarto/_extensions/dataimago/monograph/filters/pkg-name.lua +17 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/GFL.txt +29 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/JosefinSans-VF.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/NotoSans-Italic-VF.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/NotoSans-VF.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/NotoSansMath-Regular.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/NotoSansMono-VF.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/OFL-JosefinSans.txt +93 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/OFL-NotoSans.txt +93 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/OFL-NotoSansMath.txt +93 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/OFL-NotoSansMono.txt +93 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/README-lm.txt +27 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/lmsans10-regular.otf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/partials/before-body.tex +16 -0
- package/dist/quarto/_extensions/dataimago/monograph/partials/title.tex +27 -0
- package/dist/quarto/components.scss +14 -1
- package/dist/quarto/dataimago-dark.scss +23 -6
- package/dist/quarto/dataimago-light.scss +17 -6
- package/dist/tailwind-preset.js +4 -4
- package/dist/templates/KNOWLEDGE-explorer.md +1 -1
- package/dist/templates/KNOWLEDGE-framework.md +1 -1
- package/dist/templates/KNOWLEDGE-research.md +1 -1
- package/dist/templates/quarto_website/README.md +1 -1
- package/dist/templates/quarto_website/_quarto.yml.template +4 -2
- package/dist/templates/quarto_website/about.qmd.template +1 -1
- package/dist/templates/quarto_website/assets/css/lang.css +181 -0
- package/dist/templates/quarto_website/assets/js/custom-anchors.js +1 -1
- package/dist/templates/quarto_website/assets/js/logo-switch.js +1 -1
- package/dist/templates/quarto_website/assets/js/scroll.js +1 -1
- package/dist/templates/quarto_website/ethics.qmd.template +1 -1
- package/dist/templates/quarto_website/index.qmd.template +1 -1
- package/dist/tokens.css +3 -3
- package/dist/tokens.scss +3 -3
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ Depends on [`@dataimago/tokens`](../tokens) for the canonical house identity.
|
|
|
13
13
|
- `dist/latex/dataimago-tokens.sty` + `dataimago.sty` — the generated `di-*` colour layer and the LaTeX macro layer.
|
|
14
14
|
- `dist/dataviz/` — the Okabe-Ito data-viz palette as CSS, TeX (PSTricks/TikZ), JSON and R.
|
|
15
15
|
- `dist/templates/` — the project templates (`KNOWLEDGE-*.md`, the Quarto website scaffold) as stamped copies, synced into a project with `dataimago-sync` like the other outputs (house only).
|
|
16
|
+
- `dist/fonts/` — the token fonts as WOFF2 subsets with `fonts.css` per script, and `lang.css` (see Fonts).
|
|
17
|
+
- `dist/quarto/_extensions/dataimago/monograph/`, `dist/figures/`, `dist/fonts/pkg/` — the PDF format, the figure toolkit and the package-name face, with the `dataimago-figures` bin (see PDF).
|
|
16
18
|
- `dist/outputs.json` and the `dataimago-sync` bin — pinned sync for non-JS consumers (below).
|
|
17
19
|
|
|
18
20
|
Use [`@dataimago/css-neutral`](../css-neutral) instead when an externally-owned Level-3 app or future third-party hub needs the neutral identity.
|
|
@@ -63,6 +65,175 @@ in CI: it fails on any drift. The shipped outputs are listed in `dist/outputs.js
|
|
|
63
65
|
(e.g. `https://unpkg.com/@dataimago/css@<version>/dist/outputs.json`). See
|
|
64
66
|
[`wiki/patterns/new-consumer-checklist.md`](../../wiki/patterns/new-consumer-checklist.md).
|
|
65
67
|
|
|
68
|
+
## PDF
|
|
69
|
+
|
|
70
|
+
`@dataimago/css` (house only; `css-neutral` ships none of this) carries the PDF format: a Quarto extension, a figure toolkit and the package-name face. See `wiki/decisions/pdf-format.md` and `src/latex/README.md`.
|
|
71
|
+
|
|
72
|
+
- `dist/quarto/_extensions/dataimago/monograph/`: the `dataimago/monograph-pdf` leaf (`_extension.yml`, filters, partials, `dataimago-base.sty`, `dataimago-monograph.sty`, `dataimago-tokens.sty`, `fonts/`).
|
|
73
|
+
- `dist/figures/`: `dataimago-figure.sty`, the tokens, the static Noto fonts and licences, for the `dataimago-figures` bin.
|
|
74
|
+
- `dist/fonts/pkg/`: Latin Modern Sans (WOFF2, `fonts.css`, `GFL.txt`, `README-lm.txt`) for the `.pkg` span in HTML.
|
|
75
|
+
|
|
76
|
+
**design.json mappings** (directory keys end in `/`):
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{ "package": "@dataimago/css", "version": "<exact version>",
|
|
80
|
+
"outputs": { "quarto/_extensions/dataimago/monograph/": "_extensions/dataimago/monograph/",
|
|
81
|
+
"figures/": "figures/",
|
|
82
|
+
"fonts/pkg/": "assets/fonts/pkg/",
|
|
83
|
+
"quarto/dataimago-light.scss": "styles/", "quarto/dataimago-dark.scss": "styles/",
|
|
84
|
+
"quarto/components.scss": "styles/" } }
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**The paired `_quarto.yml`.** The extension is PDF only; the work keeps its own HTML format with the synced theme pair:
|
|
88
|
+
|
|
89
|
+
```yaml
|
|
90
|
+
format:
|
|
91
|
+
html:
|
|
92
|
+
theme:
|
|
93
|
+
light: [cosmo, styles/dataimago-light.scss, styles/components.scss]
|
|
94
|
+
dark: [cosmo, styles/dataimago-dark.scss, styles/components.scss]
|
|
95
|
+
html-math-method: mathml
|
|
96
|
+
css: [assets/fonts/pkg/fonts.css]
|
|
97
|
+
dataimago/monograph-pdf: default
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Metadata.** `title`, `subtitle`, `author` (with `affiliations`), `version`, `date`, `license` (`text`, `url`), `epigraph` (`text`, `attribution`), `toc`, `abstract` (set as a front-matter chapter), `dataimago-logo` (reserved, default `false`; Quarto owns `logo`) and `license-badge` (reserved, default `false`; `true` warns and the licence prints as text).
|
|
101
|
+
|
|
102
|
+
**Matter classes.** Put `{.frontmatter}`, `{.backmatter}` or `{.appendix}` on a level-1 heading. On a deeper heading the render stops and names it. In HTML these are ordinary sections. Write no raw LaTeX in the `.qmd`.
|
|
103
|
+
|
|
104
|
+
**Figures.** `{.box}` images get the figure plate and frame (`#f7f7f6` plate, light frame, in both modes). Build PSTricks sources with `npx -p @dataimago/css@<version> dataimago-figures build <dir>`: each source compiles once into `.pdf`, `.svg` (fonts as paths) and RGBA `.png`. Run it from a checkout of the work with `figures/` synced.
|
|
105
|
+
|
|
106
|
+
**TeX requirements.** LuaLaTeX (TeX Live 2026 or later) for documents, with memoir, fontspec, unicode-math, lua-ul and luacolor; XeLaTeX, PSTricks, `dvisvgm` and poppler's `pdftocairo` for figures. The fonts come with the extension, so nothing is installed system-wide. Quarto copies the leaf's `fonts/` (about 6 MB) next to each rendered `.tex`, so add a `.gitignore` rule for it. The repository checks the format with `pnpm run validate:pdf` and the `PDF` CI job.
|
|
107
|
+
|
|
108
|
+
**Copies Quarto leaves behind.** Quarto copies the leaf's `fonts/` (about 6 MB) and the three `dataimago-*.sty` files beside the source directory of every document it renders (the project root, and each subdirectory that holds a rendered `.qmd`), and leaves them there. They are build output, so ignore them in the work's own repository, scoped to the directories that hold rendered documents:
|
|
109
|
+
|
|
110
|
+
```gitignore
|
|
111
|
+
/fonts/
|
|
112
|
+
/chapters/fonts/
|
|
113
|
+
dataimago-*.sty
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Use `**/fonts/` only if no directory of the work has a `fonts/` of its own: a work that keeps its own fonts under `fonts/` must list the copies by directory as above, or ignore `dataimago-*.sty` and the leaf's font file names instead.
|
|
117
|
+
|
|
118
|
+
## Fonts
|
|
119
|
+
|
|
120
|
+
The package ships the token fonts as WOFF2 files, so a site or document does not depend on Google's CDN. Everything is under `dist/fonts/`, one directory per script, each with a `fonts.css` of `@font-face` rules and the licence text:
|
|
121
|
+
|
|
122
|
+
- Noto Sans, upright and italic, variable in weight (100 to 900), width pinned at 100.
|
|
123
|
+
- Noto Sans Mono, upright only, variable in weight (100 to 900).
|
|
124
|
+
- Noto Sans Math, one static weight (400), for equations.
|
|
125
|
+
- Josefin Sans, upright only, variable in weight (100 to 700), for house headings. It is the upstream file wrapped as WOFF2, never subset (its licence reserves the font name).
|
|
126
|
+
|
|
127
|
+
Directories: latin, latin-ext, greek, greek-ext, cyrillic, cyrillic-ext, vietnamese, josefin, math. Each `@font-face` uses `font-display: swap`, a weight range read from the font file, and a `unicode-range` on the subset files, so a browser downloads only the scripts a page renders. There is no `local()` source and no preload. Subsets keep every layout feature the kept text uses; `lnum` and `tnum` work in Noto Sans. Noto Sans Mono's digits are monospaced and lining by design, and it has no figure features. Josefin Sans has no `lnum` or `tnum` feature; its digits are lining and proportional. `dist/fonts/lang.css` holds the language rules (below). The licence is OFL-1.1; `dist/fonts/` carries each licence file.
|
|
128
|
+
|
|
129
|
+
Combining marks: the `latin` and `latin-ext` files also carry the whole combining-diacritics block (U+0300-036F), a documented addition to Google's ranges, so decomposed accents (for example e + U+0301, or o + U+031B) draw from the same file as their base letter.
|
|
130
|
+
|
|
131
|
+
### Using them
|
|
132
|
+
|
|
133
|
+
`dist/fonts/**` is listed in `dist/outputs.json`, so `dataimago-sync` copies it. A key ending in `/` maps a whole directory to a destination ending in `/`.
|
|
134
|
+
|
|
135
|
+
**A web page.** Map every script you ship and `fonts/lang.css`, then link the CSS files. The browser fetches only what the page renders.
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{ "package": "@dataimago/css", "version": "<exact version>",
|
|
139
|
+
"outputs": { "fonts/latin/": "assets/fonts/latin/", "fonts/latin-ext/": "assets/fonts/latin-ext/",
|
|
140
|
+
"fonts/greek/": "assets/fonts/greek/", "fonts/greek-ext/": "assets/fonts/greek-ext/",
|
|
141
|
+
"fonts/cyrillic/": "assets/fonts/cyrillic/", "fonts/cyrillic-ext/": "assets/fonts/cyrillic-ext/",
|
|
142
|
+
"fonts/vietnamese/": "assets/fonts/vietnamese/",
|
|
143
|
+
"fonts/josefin/": "assets/fonts/josefin/",
|
|
144
|
+
"fonts/math/": "assets/fonts/math/", "fonts/lang.css": "assets/fonts/" } }
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**A self-contained Quarto output** (`embed-resources: true`). Map only the scripts the work's language needs, for example `fonts/latin/` and `fonts/latin-ext/` (add `fonts/vietnamese/` for Vietnamese text), plus `fonts/math/` if the work has equations and `fonts/lang.css`. Add `fonts/josefin/` for the house headings. List each CSS file under `css:` in `_quarto.yml` and set `html-math-method: mathml`. Quarto then embeds just the files those rules reach.
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
format:
|
|
151
|
+
html:
|
|
152
|
+
embed-resources: true
|
|
153
|
+
html-math-method: mathml
|
|
154
|
+
css:
|
|
155
|
+
- assets/fonts/latin/fonts.css
|
|
156
|
+
- assets/fonts/latin-ext/fonts.css
|
|
157
|
+
- assets/fonts/vietnamese/fonts.css
|
|
158
|
+
- assets/fonts/josefin/fonts.css
|
|
159
|
+
- assets/fonts/math/fonts.css
|
|
160
|
+
- assets/fonts/lang.css
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**A translated work in a script the package does not ship** (Arabic, Hebrew, Devanagari, and so on). `lang.css` already names the family. Load it from Google Fonts on the web, or make the files yourself (see "Making a script the package does not ship") and keep them in the work's own repository.
|
|
164
|
+
|
|
165
|
+
### Numeric figures
|
|
166
|
+
|
|
167
|
+
Josefin Sans has no figure features: its digits are lining and proportional, so they do not line up in columns.
|
|
168
|
+
|
|
169
|
+
- `.di-numeric-display` keeps Josefin and the light weight, for hero numbers (a statistic callout, a year).
|
|
170
|
+
- `.di-numeric-tabular` uses Noto Sans with tabular lining figures, for tables, ledgers and anything stacked that must align.
|
|
171
|
+
|
|
172
|
+
```html
|
|
173
|
+
<span class="di-numeric-display">2026</span>
|
|
174
|
+
<td class="di-numeric-tabular">1,234.50</td>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Other languages
|
|
178
|
+
|
|
179
|
+
Text in another language must carry a `lang` attribute, or the browser applies its own fallback. In Quarto write `[text]{lang=ar}` for a span, a fenced div `::: {lang=ar}` for a block, or `lang: ar` in the front matter for a whole work. `lang.css` maps each language to a family by `:lang()` and rebinds the display variables on headings and navigation only; the brand mark, code and maths are left alone. The tags `zh-CN`, `zh-SG` and bare `zh` map to Noto Sans SC (bare `zh` is treated as Simplified); `zh-TW`, `zh-HK` and `zh-MO` map to Noto Sans TC. Tag Traditional text `zh-Hant` or a Traditional region.
|
|
180
|
+
|
|
181
|
+
### Maths
|
|
182
|
+
|
|
183
|
+
Equations use native MathML in `Noto Sans Math` (`font.family.math` is `Noto Sans Math, math`, so a reader without the font gets the browser's maths face). Set `html-math-method: mathml`. MathJax and KaTeX bring their own fonts, and with `embed-resources` Quarto fetches them from the network unless `self-contained-math` is set. A property that chooses one of them is outside this contract.
|
|
184
|
+
|
|
185
|
+
### Synthesised oblique
|
|
186
|
+
|
|
187
|
+
Noto Sans Mono and Josefin Sans ship upright only. Italic text in them is the browser's synthesised oblique. Noto Sans has a true italic.
|
|
188
|
+
|
|
189
|
+
### Preloading
|
|
190
|
+
|
|
191
|
+
Preloading is yours to opt into; the package does not. For the Latin body file, in the page head:
|
|
192
|
+
|
|
193
|
+
```html
|
|
194
|
+
<link rel="preload" as="font" type="font/woff2" href="/assets/fonts/latin/noto-sans.woff2" crossorigin>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
`crossorigin` is required even for a same-origin font, or the browser fetches it twice.
|
|
198
|
+
|
|
199
|
+
### Caching
|
|
200
|
+
|
|
201
|
+
File names are stable and change only when a family changes, so serve them with revalidation. That is the default on the hosts these properties use (confirmed 2026-10-31): GitHub Pages sends `cache-control: max-age=600` with an ETag, and Vercel serves static files with `public, max-age=0, must-revalidate`. Do not set a long immutable lifetime.
|
|
202
|
+
|
|
203
|
+
### The Google alternative
|
|
204
|
+
|
|
205
|
+
A project that does not sync files can link Google's CDN instead. This is the query matching what the package ships:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@100..700&family=Noto+Sans:ital,wdth,wght@0,100,100..900;1,100,100..900&family=Noto+Sans+Math&family=Noto+Sans+Mono:wght@100..900&display=swap
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Add `lang.css` as well. This loads full variable files from Google rather than the subsets, so a self-contained Quarto output becomes much larger. The Google route serves Google's own ranges, so decomposed accents using U+0302, U+0306 or U+031B fall back there (and on sites built from the Quarto website template, which uses that route); the shipped files carry the combining marks in the Latin files.
|
|
212
|
+
|
|
213
|
+
### Making a script the package does not ship
|
|
214
|
+
|
|
215
|
+
`subset.mjs` in the dataimago-design repository has an out mode that fetches a pinned upstream file, checks its digest, subsets it and writes `<script>/<family>.woff2`, `<script>/fonts.css` and the licence into a directory outside `packages/`. It refuses a family whose licence reserves the font name.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
node tools/fonts/subset.mjs --out ../my-work/fonts \
|
|
219
|
+
--upstream <url pinned to a tag or commit> --sha256 <hex> --script arabic \
|
|
220
|
+
[--unicode-range "U+0600-06FF, U+200C-200E"] [--style normal|italic] \
|
|
221
|
+
--licence-url <url> --licence-sha256 <hex> \
|
|
222
|
+
[--member <path in archive> --member-sha256 <hex>] \
|
|
223
|
+
[--licence-member <path> --licence-member-sha256 <hex>]
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Without the tool, fontTools (the repository pins Python 3.13 and `tools/fonts/requirements.txt`) does the same in two steps. Pin the width axis if the font has one, then subset keeping every layout feature:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
fonttools varLib.instancer NotoSansArabic[wdth,wght].ttf wdth=100 --no-recalc-timestamp -o instanced.ttf
|
|
230
|
+
pyftsubset instanced.ttf --unicodes="U+0600-06FF,U+200C-200E" --layout-features='*' \
|
|
231
|
+
--name-IDs='*' --name-languages='*' --notdef-outline --no-recalc-timestamp \
|
|
232
|
+
--flavor=woff2 --output-file=noto-sans-arabic.woff2
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
To wrap a file as WOFF2 without subsetting: `fonttools ttLib.woff2 compress -o out.woff2 in.ttf`. (The repository's tool also turns off table transforms so the tables stay byte-identical; the command line does not, so the bytes can differ while the font is the same.) Write the `@font-face` rule with `font-display: swap`, the font's own weight range and `unicode-range`, and no `local()`.
|
|
236
|
+
|
|
66
237
|
## Building
|
|
67
238
|
|
|
68
239
|
```bash
|