fontist 2.1.4 → 2.1.5
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/docs/.vitepress/config.ts +17 -0
- data/docs/cli/create-formula.md +6 -0
- data/docs/cli/import.md +4 -0
- data/docs/guide/formulas.md +73 -0
- data/docs/guide/installation.md +62 -0
- data/docs/guide/maintainer/import.md +372 -0
- data/docs/guide/maintainer/index.md +37 -0
- data/docs/guide/platforms/index.md +72 -0
- data/docs/guide/platforms/macos.md +151 -0
- data/docs/guide/platforms/windows.md +220 -0
- data/fontist.gemspec +0 -1
- data/lib/fontist/cache/manager.rb +0 -2
- data/lib/fontist/cache.rb +6 -0
- data/lib/fontist/cli/thor_ext.rb +0 -2
- data/lib/fontist/cli.rb +0 -9
- data/lib/fontist/collection_file.rb +0 -3
- data/lib/fontist/font.rb +0 -6
- data/lib/fontist/font_collection.rb +0 -1
- data/lib/fontist/font_file.rb +0 -1
- data/lib/fontist/font_installer.rb +0 -5
- data/lib/fontist/font_model.rb +0 -1
- data/lib/fontist/font_path.rb +0 -2
- data/lib/fontist/formula.rb +0 -13
- data/lib/fontist/formula_picker.rb +0 -2
- data/lib/fontist/google_import_source.rb +0 -2
- data/lib/fontist/import/convert_formulas.rb +0 -2
- data/lib/fontist/import/create_formula.rb +0 -4
- data/lib/fontist/import/files/collection_file.rb +0 -1
- data/lib/fontist/import/files.rb +8 -0
- data/lib/fontist/import/font_metadata_extractor.rb +0 -1
- data/lib/fontist/import/formula_builder.rb +0 -6
- data/lib/fontist/import/google/api.rb +0 -9
- data/lib/fontist/import/google/data_sources/base.rb +0 -1
- data/lib/fontist/import/google/data_sources/github.rb +0 -3
- data/lib/fontist/import/google/data_sources/ttf.rb +0 -2
- data/lib/fontist/import/google/data_sources/vf.rb +0 -2
- data/lib/fontist/import/google/data_sources/woff2.rb +0 -2
- data/lib/fontist/import/google/data_sources.rb +13 -0
- data/lib/fontist/import/google/font_database.rb +0 -10
- data/lib/fontist/import/google/metadata_adapter.rb +0 -1
- data/lib/fontist/import/google/models/font_family.rb +0 -1
- data/lib/fontist/import/google/models/metadata.rb +1 -9
- data/lib/fontist/import/google/models/source_metadata.rb +0 -1
- data/lib/fontist/import/google/models.rb +16 -0
- data/lib/fontist/import/google.rb +7 -2
- data/lib/fontist/import/google_fonts_importer.rb +0 -5
- data/lib/fontist/import/google_import.rb +1 -8
- data/lib/fontist/import/helpers.rb +8 -0
- data/lib/fontist/import/macos.rb +0 -6
- data/lib/fontist/import/manual_formula_builder.rb +0 -2
- data/lib/fontist/import/models.rb +7 -0
- data/lib/fontist/import/otf/font_file.rb +0 -2
- data/lib/fontist/import/otf.rb +7 -0
- data/lib/fontist/import/recursive_extraction.rb +0 -5
- data/lib/fontist/import/sil_import.rb +0 -3
- data/lib/fontist/import/upgrade_formulas.rb +1 -11
- data/lib/fontist/import.rb +23 -0
- data/lib/fontist/import_cli.rb +0 -9
- data/lib/fontist/index.rb +0 -4
- data/lib/fontist/index_cli.rb +0 -2
- data/lib/fontist/indexes/base_font_collection_index.rb +0 -1
- data/lib/fontist/indexes/default_family_font_index.rb +0 -2
- data/lib/fontist/indexes/directory_snapshot.rb +0 -2
- data/lib/fontist/indexes/filename_index.rb +0 -2
- data/lib/fontist/indexes/font_index.rb +0 -3
- data/lib/fontist/indexes/fontist_index.rb +0 -2
- data/lib/fontist/indexes/incremental_index_updater.rb +0 -4
- data/lib/fontist/indexes/preferred_family_font_index.rb +0 -2
- data/lib/fontist/indexes/system_index.rb +0 -2
- data/lib/fontist/indexes/user_index.rb +0 -2
- data/lib/fontist/indexes.rb +18 -0
- data/lib/fontist/install_location.rb +0 -4
- data/lib/fontist/install_locations/fontist_location.rb +0 -2
- data/lib/fontist/install_locations/system_location.rb +0 -2
- data/lib/fontist/install_locations/user_location.rb +0 -2
- data/lib/fontist/install_locations.rb +8 -0
- data/lib/fontist/macos/catalog/asset.rb +0 -2
- data/lib/fontist/macos/catalog/base_parser.rb +0 -1
- data/lib/fontist/macos/catalog/catalog_manager.rb +0 -6
- data/lib/fontist/macos/catalog/font3_parser.rb +0 -2
- data/lib/fontist/macos/catalog/font4_parser.rb +0 -2
- data/lib/fontist/macos/catalog/font5_parser.rb +0 -2
- data/lib/fontist/macos/catalog/font6_parser.rb +0 -2
- data/lib/fontist/macos/catalog/font7_parser.rb +0 -2
- data/lib/fontist/macos/catalog/font8_parser.rb +0 -2
- data/lib/fontist/macos/catalog.rb +15 -0
- data/lib/fontist/macos.rb +5 -0
- data/lib/fontist/macos_import_source.rb +0 -2
- data/lib/fontist/manifest_request.rb +0 -1
- data/lib/fontist/manifest_response.rb +0 -1
- data/lib/fontist/resources.rb +7 -0
- data/lib/fontist/sil_import_source.rb +0 -2
- data/lib/fontist/system_font.rb +0 -2
- data/lib/fontist/system_index.rb +0 -4
- data/lib/fontist/utils/cache.rb +0 -2
- data/lib/fontist/utils/downloader.rb +0 -4
- data/lib/fontist/utils.rb +10 -8
- data/lib/fontist/validate_cli.rb +0 -4
- data/lib/fontist/validator.rb +0 -2
- data/lib/fontist/version.rb +1 -1
- data/lib/fontist.rb +82 -36
- metadata +19 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0625c7b3933a74de8462f617558b73b8c4a27112e42a4066209dd66f805df21d
|
|
4
|
+
data.tar.gz: 7fb21a4892763ed22113cec7950af17a6c716d00f3dc8b569a636c3de013a594
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8446fbdb79e95e818298e6ed0f487789299992afc598676f5bd7f376e8c3dbedc267d46ffcf9acf6cf67c5bb66d96d34338677ce7f9818d0c167729e6db1770e
|
|
7
|
+
data.tar.gz: 9ca12d1d2a163a289fe0ed5cef1bee92f0f5d6e48b3b79c30c9a9eb86da189802fce19c66393736038d925822524357066d91bed1c54699509a5b26b119cac11
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/docs/.vitepress/config.ts
CHANGED
|
@@ -125,6 +125,23 @@ export default defineConfig({
|
|
|
125
125
|
},
|
|
126
126
|
],
|
|
127
127
|
},
|
|
128
|
+
{
|
|
129
|
+
text: "Platforms",
|
|
130
|
+
collapsed: true,
|
|
131
|
+
items: [
|
|
132
|
+
{ text: "Overview", link: "/guide/platforms/" },
|
|
133
|
+
{ text: "macOS", link: "/guide/platforms/macos" },
|
|
134
|
+
{ text: "Windows", link: "/guide/platforms/windows" },
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
text: "Maintainer Docs",
|
|
139
|
+
collapsed: true,
|
|
140
|
+
items: [
|
|
141
|
+
{ text: "Overview", link: "/guide/maintainer/" },
|
|
142
|
+
{ text: "Importing Fonts", link: "/guide/maintainer/import" },
|
|
143
|
+
],
|
|
144
|
+
},
|
|
128
145
|
],
|
|
129
146
|
"/cli/": [
|
|
130
147
|
{
|
data/docs/cli/create-formula.md
CHANGED
|
@@ -41,6 +41,12 @@ fontist create-formula https://example.com/fonts/myfont.zip --file-pattern "*.ot
|
|
|
41
41
|
|
|
42
42
|
# Add mirror URLs
|
|
43
43
|
fontist create-formula https://example.com/fonts/myfont.zip --mirror https://mirror.example.com/fonts/myfont.zip
|
|
44
|
+
|
|
45
|
+
# Create formula with name prefix (for compatibility fonts)
|
|
46
|
+
fontist create-formula https://dl.winehq.org/wine/source/10.x/wine-10.18.tar.xz \
|
|
47
|
+
--subdir fonts \
|
|
48
|
+
--file-pattern "*.ttf" \
|
|
49
|
+
--name-prefix "Wine "
|
|
44
50
|
```
|
|
45
51
|
|
|
46
52
|
## How It Works
|
data/docs/cli/import.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Import fonts from external sources and create Fontist formulas.
|
|
4
4
|
|
|
5
|
+
::: warning Maintainer Only
|
|
6
|
+
These commands are for Fontist formula maintainers only. End users should use [`fontist install`](/cli/install) to install fonts from the official repository.
|
|
7
|
+
:::
|
|
8
|
+
|
|
5
9
|
## Subcommands
|
|
6
10
|
|
|
7
11
|
| Command | Description |
|
data/docs/guide/formulas.md
CHANGED
|
@@ -184,6 +184,79 @@ Private repos are stored alongside the main formulas:
|
|
|
184
184
|
|
|
185
185
|
See the [repo command reference](/cli/repo) for complete command documentation.
|
|
186
186
|
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Advanced Formula Features
|
|
190
|
+
|
|
191
|
+
### Overriding Font Metadata
|
|
192
|
+
|
|
193
|
+
Some fonts (especially older ones) contain inconsistent or imperfect metadata. For example, some fonts apply different OTF `Family` values for different font styles, which prevents all styles from being registered under the same family.
|
|
194
|
+
|
|
195
|
+
The `override:` key allows you to correct metadata without modifying the font files:
|
|
196
|
+
|
|
197
|
+
```yaml
|
|
198
|
+
fonts:
|
|
199
|
+
- name: Frutiger 45 Light
|
|
200
|
+
styles:
|
|
201
|
+
- family_name: Frutiger 45 Light
|
|
202
|
+
type: Regular
|
|
203
|
+
full_name: Frutiger-Light
|
|
204
|
+
post_script_name: Frutiger-Light
|
|
205
|
+
override:
|
|
206
|
+
preferred_family_name: Frutiger
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
This override:
|
|
210
|
+
- Does not modify the actual font file
|
|
211
|
+
- Only affects Fontist's internal indexing
|
|
212
|
+
- Allows all Frutiger fonts to be installed together:
|
|
213
|
+
|
|
214
|
+
```sh
|
|
215
|
+
fontist install "Frutiger" --preferred-family
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### HTTP Authentication
|
|
219
|
+
|
|
220
|
+
Private formula repositories may require authentication. Configure this when setting up the repository:
|
|
221
|
+
|
|
222
|
+
```sh
|
|
223
|
+
# GitLab example with private token
|
|
224
|
+
fontist repo setup company-fonts \
|
|
225
|
+
"https://user:${PRIVATE_TOKEN}@gitlab.com/company/font-formulas.git"
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Authorization Headers
|
|
229
|
+
|
|
230
|
+
For private archives (e.g., GitHub releases), add authorization headers to the formula:
|
|
231
|
+
|
|
232
|
+
```yaml
|
|
233
|
+
resources:
|
|
234
|
+
fonts.zip:
|
|
235
|
+
urls:
|
|
236
|
+
- url: https://github.com/company/fonts/releases/assets/12345
|
|
237
|
+
headers:
|
|
238
|
+
Accept: application/octet-stream
|
|
239
|
+
Authorization: token ghp_your_token_here
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
::: warning Token Scopes
|
|
243
|
+
GitHub tokens need at least the `repo` scope for access to release assets. Generate tokens at [GitHub Settings > Tokens](https://github.com/settings/tokens).
|
|
244
|
+
:::
|
|
245
|
+
|
|
246
|
+
### Name Prefix Option
|
|
247
|
+
|
|
248
|
+
When creating formulas for compatibility or replacement fonts, use `--name-prefix` to distinguish them:
|
|
249
|
+
|
|
250
|
+
```sh
|
|
251
|
+
# Create formula for Wine compatibility fonts
|
|
252
|
+
fontist create-formula https://dl.winehq.org/wine/source/10.x/wine-10.18.tar.xz \
|
|
253
|
+
--subdir fonts \
|
|
254
|
+
--file-pattern '*.ttf' \
|
|
255
|
+
--name-prefix 'Wine '
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
This generates a formula where all fonts have names prefixed with "Wine ", making it clear these are Wine compatibility fonts rather than the original Microsoft fonts.
|
|
259
|
+
|
|
187
260
|
## Related
|
|
188
261
|
|
|
189
262
|
- [How Fontist Works](/guide/how-it-works) - Internal architecture and indexes
|
data/docs/guide/installation.md
CHANGED
|
@@ -43,6 +43,34 @@ macOS comes with Ruby pre-installed. If you encounter permission issues, conside
|
|
|
43
43
|
|
|
44
44
|
On Windows, we recommend using [RubyInstaller](https://rubyinstaller.org/) which includes the DevKit needed for native extensions.
|
|
45
45
|
|
|
46
|
+
#### Windows Installation Steps
|
|
47
|
+
|
|
48
|
+
1. **Download RubyInstaller** from [rubyinstaller.org](https://rubyinstaller.org/downloads/)
|
|
49
|
+
- Select the **"Ruby+Devkit"** version (not the plain Ruby version)
|
|
50
|
+
- Example: `Ruby+Devkit 3.2.X (x64)`
|
|
51
|
+
|
|
52
|
+
2. **Run the installer**
|
|
53
|
+
- Check "Add Ruby executables to your PATH"
|
|
54
|
+
- Check "Associate .rb files with this Ruby installation"
|
|
55
|
+
|
|
56
|
+
3. **Set up MSYS2** (required for native extensions):
|
|
57
|
+
```powershell
|
|
58
|
+
ridk install
|
|
59
|
+
```
|
|
60
|
+
Select option **3** (MSYS2 and MINGW development toolchain) when prompted.
|
|
61
|
+
|
|
62
|
+
4. **Install Git for Windows** from [git-scm.com](https://git-scm.com/download/win)
|
|
63
|
+
- Required for `fontist update` and `fontist repo` commands
|
|
64
|
+
|
|
65
|
+
5. **Verify installation**:
|
|
66
|
+
```powershell
|
|
67
|
+
ruby --version
|
|
68
|
+
gem install fontist
|
|
69
|
+
fontist version
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
See the [Windows Platform Guide](/guide/platforms/windows) for Windows-specific considerations.
|
|
73
|
+
|
|
46
74
|
### Linux
|
|
47
75
|
|
|
48
76
|
Most Linux distributions have Ruby available through their package managers:
|
|
@@ -94,6 +122,40 @@ sudo dnf install gcc ruby-devel
|
|
|
94
122
|
xcode-select --install
|
|
95
123
|
```
|
|
96
124
|
|
|
125
|
+
## Native Dependencies
|
|
126
|
+
|
|
127
|
+
Fontist depends on several gems with native C/C++ extensions. The following table shows what's required:
|
|
128
|
+
|
|
129
|
+
| Gem | Compiler | Purpose |
|
|
130
|
+
|-----|----------|---------|
|
|
131
|
+
| `json` | gcc | JSON parsing |
|
|
132
|
+
| `brotli` (via fontisan) | gcc | WOFF2 font decompression |
|
|
133
|
+
| `seven-zip` (via excavate) | g++ | 7z archive extraction |
|
|
134
|
+
| `libmspack` (via excavate) | gcc | CAB/CHM archive extraction |
|
|
135
|
+
| `ffi-libarchive-binary` (via excavate) | gcc | Archive extraction (zip, tar, etc.) |
|
|
136
|
+
|
|
137
|
+
::: note Prebuilt Binaries
|
|
138
|
+
Some gems like `nokogiri` and `ffi` provide prebuilt binaries for common platforms, so they typically don't require compilation.
|
|
139
|
+
:::
|
|
140
|
+
|
|
141
|
+
### Windows DevKit Setup
|
|
142
|
+
|
|
143
|
+
On Windows, native extensions require the RubyInstaller DevKit:
|
|
144
|
+
|
|
145
|
+
1. Download [RubyInstaller](https://rubyinstaller.org/downloads/) with DevKit (select "Ruby+Devkit" version)
|
|
146
|
+
|
|
147
|
+
2. Run the installer, checking "Add Ruby executables to your PATH"
|
|
148
|
+
|
|
149
|
+
3. After installation, run the following in a command prompt:
|
|
150
|
+
|
|
151
|
+
```cmd
|
|
152
|
+
ridk install
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
4. Select option **3** (MSYS2 and MINGW development toolchain) when prompted
|
|
156
|
+
|
|
157
|
+
5. Install [Git for Windows](https://git-scm.com/download/win) for `fontist update` and `fontist repo` commands
|
|
158
|
+
|
|
97
159
|
### Proxy Configuration
|
|
98
160
|
|
|
99
161
|
If you're behind a proxy, configure Git to use it:
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Importing Fonts from External Sources
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Importing Fonts from External Sources
|
|
6
|
+
|
|
7
|
+
::: warning Maintainer Only
|
|
8
|
+
The documentation is for Fontist formula maintainers only. End users should use `fontist install` to install fonts from the official repository.
|
|
9
|
+
:::
|
|
10
|
+
|
|
11
|
+
Fontist can automatically generate formulas from external font sources including Google Fonts, macOS supplementary fonts, and SIL International fonts.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Google Fonts Import
|
|
16
|
+
|
|
17
|
+
### Overview
|
|
18
|
+
|
|
19
|
+
[Google Fonts](https://fonts.google.com) provides the largest collection of freely licensed fonts. Fontist maintains formulas for all Google Fonts and supports importing them.
|
|
20
|
+
|
|
21
|
+
### Data Sources
|
|
22
|
+
|
|
23
|
+
The Google Fonts importer uses multiple data sources:
|
|
24
|
+
|
|
25
|
+
#### Four Equal Data Sources
|
|
26
|
+
|
|
27
|
+
| Source | Provides |
|
|
28
|
+
|--------|----------|
|
|
29
|
+
| **Ttf** (API) | TTF download URLs |
|
|
30
|
+
| **Vf** (API) | Variable font URLs + axes information |
|
|
31
|
+
| **Woff2** (API) | WOFF2 web font URLs |
|
|
32
|
+
| **Github** (Repo) | Font metadata (designer, license, category) |
|
|
33
|
+
|
|
34
|
+
### Architecture
|
|
35
|
+
|
|
36
|
+
The importer uses a layered architecture.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
┌──────────────────────────┐
|
|
40
|
+
│ FontDatabase │
|
|
41
|
+
│ (Single Entry Point) │
|
|
42
|
+
└───────────┬──────────────┘
|
|
43
|
+
│
|
|
44
|
+
┌─────────────┼─────────────┬─────────────┐
|
|
45
|
+
│ │ │ │
|
|
46
|
+
▼ ▼ ▼ ▼
|
|
47
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
48
|
+
│ Ttf │ │ Vf │ │ Woff2 │ │ Github │
|
|
49
|
+
│ (API) │ │ (API) │ │ (API) │ │ (Repo) │
|
|
50
|
+
└──────────┘ └──────────┘ └──────────┘ └──────────┘
|
|
51
|
+
|
|
52
|
+
All 4 Data Sources Are Equal
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Prerequisites
|
|
56
|
+
|
|
57
|
+
1. **Local checkout** of the [google/fonts](https://github.com/google/fonts) repository
|
|
58
|
+
|
|
59
|
+
2. **Google Fonts API key** (get one from [Google Cloud Console](https://console.cloud.google.com/))
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
export GOOGLE_FONTS_API_KEY="your_api_key_here"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Import Command
|
|
66
|
+
|
|
67
|
+
Import all Google Fonts.
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
fontist import google \
|
|
71
|
+
--source-path /path/to/google/fonts \
|
|
72
|
+
--output-path Formulas/google \
|
|
73
|
+
--verbose \
|
|
74
|
+
--import-cache /tmp/fontist-google-cache
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Import a single font family.
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
fontist import google \
|
|
81
|
+
--font-family "Roboto" \
|
|
82
|
+
--source-path /path/to/google/fonts \
|
|
83
|
+
--verbose
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Options
|
|
87
|
+
|
|
88
|
+
| Option | Description |
|
|
89
|
+
|--------|-------------|
|
|
90
|
+
| `--source-path` | Path to checked-out google/fonts repository |
|
|
91
|
+
| `--output-path` | Output directory for generated formulas (default: `./Formulas/google`) |
|
|
92
|
+
| `--font-family` | Import specific font family by name |
|
|
93
|
+
| `--force` | Overwrite existing formulas |
|
|
94
|
+
| `--verbose` | Enable detailed progress output |
|
|
95
|
+
| `--import-cache` | Directory for caching downloaded archives |
|
|
96
|
+
|
|
97
|
+
### Ruby API
|
|
98
|
+
|
|
99
|
+
```ruby
|
|
100
|
+
require 'fontist/import/google/font_database'
|
|
101
|
+
|
|
102
|
+
# Build database from all 4 sources
|
|
103
|
+
db = Fontist::Import::Google::FontDatabase.build(
|
|
104
|
+
api_key: ENV['GOOGLE_FONTS_API_KEY'],
|
|
105
|
+
source_path: '/path/to/google/fonts'
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
# Query merged data
|
|
109
|
+
roboto = db.font_by_name('Roboto')
|
|
110
|
+
puts roboto.designer # From Github repository
|
|
111
|
+
puts roboto.axes.count # From API (VF endpoint)
|
|
112
|
+
|
|
113
|
+
# Generate formulas
|
|
114
|
+
db.save_formulas('./formulas') # All fonts
|
|
115
|
+
db.save_formulas('./formulas', family_name: 'Roboto') # Single font
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Automated Updates
|
|
119
|
+
|
|
120
|
+
Fontist uses a [GitHub Actions workflow](https://github.com/fontist/formulas/blob/v4/.github/workflows/google.yml) to check for updated fonts on Google Fonts daily.
|
|
121
|
+
|
|
122
|
+
New, updated, or removed fonts are automatically committed to the [Fontist formula repository](https://github.com/fontist/formulas).
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## SIL Fonts Import
|
|
127
|
+
|
|
128
|
+
### Overview
|
|
129
|
+
|
|
130
|
+
[SIL International](https://www.sil.org) is an organization that serves language communities worldwide. SIL provides unique fonts supporting smaller language communities with Unicode support often not available in mainstream fonts.
|
|
131
|
+
|
|
132
|
+
### Import Command
|
|
133
|
+
|
|
134
|
+
Import all SIL fonts.
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
fontist import sil \
|
|
138
|
+
--output-path Formulas/sil \
|
|
139
|
+
--verbose \
|
|
140
|
+
--import-cache /tmp/sil-import-cache
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Import a single SIL font.
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
fontist import sil \
|
|
147
|
+
--font-name "Andika" \
|
|
148
|
+
--output-path Formulas/sil \
|
|
149
|
+
--verbose \
|
|
150
|
+
--import-cache /tmp/sil-import-cache
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Options
|
|
154
|
+
|
|
155
|
+
| Option | Description |
|
|
156
|
+
|--------|-------------|
|
|
157
|
+
| `--output-path` | Output directory for generated formulas |
|
|
158
|
+
| `--font-name` | Import specific font by name |
|
|
159
|
+
| `--force` | Overwrite existing formulas |
|
|
160
|
+
| `--verbose` | Enable detailed progress output |
|
|
161
|
+
| `--import-cache` | Directory for caching downloaded archives |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## macOS Supplementary Fonts Import
|
|
166
|
+
|
|
167
|
+
### Overview
|
|
168
|
+
|
|
169
|
+
macOS supplementary fonts use multi-dimensional versioning with framework versions, catalog posted dates, and asset build IDs.
|
|
170
|
+
|
|
171
|
+
### Import Command
|
|
172
|
+
|
|
173
|
+
Import from macOS font catalogs.
|
|
174
|
+
|
|
175
|
+
```sh
|
|
176
|
+
fontist import macos \
|
|
177
|
+
--plist com_apple_MobileAsset_Font7.xml \
|
|
178
|
+
--output-path Formulas/macos/font7 \
|
|
179
|
+
--verbose \
|
|
180
|
+
--import-cache /tmp/fontist-macos-cache \
|
|
181
|
+
--force
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Import a single macOS font.
|
|
185
|
+
|
|
186
|
+
```sh
|
|
187
|
+
fontist import macos \
|
|
188
|
+
--plist com_apple_MobileAsset_Font7.xml \
|
|
189
|
+
--font-name "Hiragino" \
|
|
190
|
+
--output-path Formulas/macos/font7 \
|
|
191
|
+
--verbose
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Finding Catalog Files
|
|
195
|
+
|
|
196
|
+
Run `fontist macos-catalogs` to list available font catalogs on your system.
|
|
197
|
+
|
|
198
|
+
### Catalog URLs
|
|
199
|
+
|
|
200
|
+
Catalogs are also available from Apple's Mobile Asset Server.
|
|
201
|
+
|
|
202
|
+
| Version | URL |
|
|
203
|
+
|---------|-----|
|
|
204
|
+
| Font 3 | `https://mesu.apple.com/assets/macos/com_apple_MobileAsset_Font3/com_apple_MobileAsset_Font3.xml` |
|
|
205
|
+
| Font 4 | `https://mesu.apple.com/assets/macos/com_apple_MobileAsset_Font4/com_apple_MobileAsset_Font4.xml` |
|
|
206
|
+
| Font 5 | `https://mesu.apple.com/assets/macos/com_apple_MobileAsset_Font5/com_apple_MobileAsset_Font5.xml` |
|
|
207
|
+
| Font 6 | `https://mesu.apple.com/assets/macos/com_apple_MobileAsset_Font6/com_apple_MobileAsset_Font6.xml` |
|
|
208
|
+
| Font 7 | `https://mesu.apple.com/assets/macos/com_apple_MobileAsset_Font7/com_apple_MobileAsset_Font7.xml` |
|
|
209
|
+
| Font 8 | `https://mesu.apple.com/assets/macos/com_apple_MobileAsset_Font8/com_apple_MobileAsset_Font8.xml` |
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Import Source Architecture
|
|
214
|
+
|
|
215
|
+
### Import Source Attribute
|
|
216
|
+
|
|
217
|
+
Formulas with import sources track metadata about their origin.
|
|
218
|
+
|
|
219
|
+
#### macOS Import Source
|
|
220
|
+
|
|
221
|
+
```yaml
|
|
222
|
+
import_source:
|
|
223
|
+
type: macos
|
|
224
|
+
framework_version: 7
|
|
225
|
+
posted_date: "2024-08-13T18:11:00Z"
|
|
226
|
+
asset_id: "10m1360"
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### Google Fonts Import Source
|
|
230
|
+
|
|
231
|
+
```yaml
|
|
232
|
+
import_source:
|
|
233
|
+
type: google
|
|
234
|
+
commit_id: "abc123def456"
|
|
235
|
+
api_version: "v1"
|
|
236
|
+
last_modified: "2024-01-01T12:00:00Z"
|
|
237
|
+
family_id: "roboto"
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
#### SIL Import Source
|
|
241
|
+
|
|
242
|
+
```yaml
|
|
243
|
+
import_source:
|
|
244
|
+
type: sil
|
|
245
|
+
version: "1.0.0"
|
|
246
|
+
release_date: "2024-01-01"
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Versioned Filenames
|
|
250
|
+
|
|
251
|
+
Import source type determines filename format.
|
|
252
|
+
|
|
253
|
+
| Source | Format | Example |
|
|
254
|
+
|--------|--------|---------|
|
|
255
|
+
| macOS | `{name}_{asset_id}.yml` | `al_bayan_10m1360.yml` |
|
|
256
|
+
| Google | `{name}.yml` | `roboto.yml` (no versioning) |
|
|
257
|
+
| SIL | `{name}_{version}.yml` | `charis_sil_6.200.yml` |
|
|
258
|
+
|
|
259
|
+
### Why Different Strategies?
|
|
260
|
+
|
|
261
|
+
- **macOS**: Multiple versions coexist for different macOS versions
|
|
262
|
+
- **Google**: Live service always points to latest; commit tracked for metadata only
|
|
263
|
+
- **SIL**: Versioned releases need coexistence
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Import Cache Management
|
|
268
|
+
|
|
269
|
+
### Overview
|
|
270
|
+
|
|
271
|
+
During formula imports, Fontist downloads font archives for analysis. The import cache optimizes performance and avoids redundant downloads.
|
|
272
|
+
|
|
273
|
+
Default location: `~/.fontist/import_cache`
|
|
274
|
+
|
|
275
|
+
### Configuration Methods
|
|
276
|
+
|
|
277
|
+
#### CLI Option
|
|
278
|
+
|
|
279
|
+
```sh
|
|
280
|
+
fontist import google --import-cache /custom/path ...
|
|
281
|
+
fontist import macos --import-cache /custom/path ...
|
|
282
|
+
fontist import sil --import-cache /custom/path ...
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### Ruby API
|
|
286
|
+
|
|
287
|
+
```ruby
|
|
288
|
+
# Global setting
|
|
289
|
+
Fontist.import_cache_path = "/custom/import/cache"
|
|
290
|
+
|
|
291
|
+
# Per-import setting
|
|
292
|
+
Fontist::Import::Macos.new(
|
|
293
|
+
plist_path,
|
|
294
|
+
import_cache: "/custom/cache"
|
|
295
|
+
).call
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### Environment Variable
|
|
299
|
+
|
|
300
|
+
```sh
|
|
301
|
+
export FONTIST_IMPORT_CACHE=/custom/import/cache
|
|
302
|
+
fontist import macos ...
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Cache Management
|
|
306
|
+
|
|
307
|
+
Clear the import cache.
|
|
308
|
+
|
|
309
|
+
```sh
|
|
310
|
+
fontist cache clear-import
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
View cache information.
|
|
314
|
+
|
|
315
|
+
```sh
|
|
316
|
+
fontist cache info
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Verbose Output
|
|
322
|
+
|
|
323
|
+
Enable `--verbose` for detailed progress tracking.
|
|
324
|
+
|
|
325
|
+
```sh
|
|
326
|
+
fontist import macos --plist catalog.xml --verbose
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Output includes.
|
|
330
|
+
|
|
331
|
+
- Paint-colored headers with Unicode box characters
|
|
332
|
+
- Import cache location
|
|
333
|
+
- Download URLs and cache status
|
|
334
|
+
- Extraction directory paths
|
|
335
|
+
- Real-time progress with percentages
|
|
336
|
+
- Per-font status indicators
|
|
337
|
+
- Detailed summary statistics
|
|
338
|
+
|
|
339
|
+
### Example Output
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
════════════════════════════════════════════════════════════════════
|
|
343
|
+
📦 macOS Supplementary Fonts Import
|
|
344
|
+
════════════════════════════════════════════════════════════════════
|
|
345
|
+
|
|
346
|
+
📦 Import cache: /Users/user/.fontist/import_cache
|
|
347
|
+
📁 Output path: /Users/user/.fontist/versions/v4/formulas/Formulas/macos/font7
|
|
348
|
+
|
|
349
|
+
(1/3) 33.3% | Hiragino Sans (2 fonts)
|
|
350
|
+
Downloading from: https://updates.cdn-apple.com/.../font.zip
|
|
351
|
+
Cache location: /Users/user/.fontist/import_cache
|
|
352
|
+
Extracting to: /var/folders/.../temp
|
|
353
|
+
Extraction cache cleared
|
|
354
|
+
✓ Formula created: hiragino_sans_10m1044.yml (3.98s)
|
|
355
|
+
|
|
356
|
+
════════════════════════════════════════════════════════════════════
|
|
357
|
+
📊 Import Summary
|
|
358
|
+
════════════════════════════════════════════════════════════════════
|
|
359
|
+
|
|
360
|
+
Total packages: 3
|
|
361
|
+
✓ Successful: 3 (100.0%)
|
|
362
|
+
|
|
363
|
+
🎉 Great success! 3 formulas created!
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## See Also
|
|
369
|
+
|
|
370
|
+
- [Formulas Guide](/guide/formulas) - How formulas work
|
|
371
|
+
- [repo Command](/cli/repo) - Managing formula repositories
|
|
372
|
+
- [cache Command](/cli/cache) - Cache management
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Maintainer Documentation
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Maintainer Documentation
|
|
6
|
+
|
|
7
|
+
::: warning For Fontist Maintainers Only
|
|
8
|
+
This section contains documentation for Fontist formula maintainers. End users typically do not need these commands.
|
|
9
|
+
:::
|
|
10
|
+
|
|
11
|
+
## Topics
|
|
12
|
+
|
|
13
|
+
### [Import Commands](/guide/maintainer/import)
|
|
14
|
+
|
|
15
|
+
Import fonts from external sources to create Fontist formulas:
|
|
16
|
+
- Google Fonts
|
|
17
|
+
- macOS supplementary fonts
|
|
18
|
+
- SIL International fonts
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Who Should Use These Commands?
|
|
23
|
+
|
|
24
|
+
You should use these commands if you are:
|
|
25
|
+
|
|
26
|
+
- A **Fontist formula maintainer** updating the official formula repository
|
|
27
|
+
- Creating formulas from **large font collections** (Google Fonts, macOS, SIL)
|
|
28
|
+
- Contributing new formulas to the **fontist/formulas** repository
|
|
29
|
+
|
|
30
|
+
## Regular Users
|
|
31
|
+
|
|
32
|
+
If you just want to install fonts, you don't need these commands. Instead:
|
|
33
|
+
|
|
34
|
+
- Use `fontist install "Font Name"` to install fonts
|
|
35
|
+
- Use `fontist create-formula <url>` to create a single formula from a font archive
|
|
36
|
+
|
|
37
|
+
See the [Getting Started Guide](/guide/) for regular usage.
|