fontist 2.1.3 → 2.1.4
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/.github/workflows/docs.yml +70 -0
- data/.github/workflows/links.yml +100 -0
- data/.gitignore +2 -1
- data/docs/.vitepress/config.ts +153 -32
- data/docs/.vitepress/data/cli-commands.json +461 -0
- data/docs/.vitepress/data/exit-codes.json +21 -0
- data/docs/.vitepress/data/features.json +44 -0
- data/docs/.vitepress/theme/components/HeroCodeBlock.vue +98 -0
- data/docs/.vitepress/theme/components/WithinHero.vue +30 -0
- data/docs/.vitepress/theme/index.ts +12 -0
- data/docs/.vitepress/theme/style.css +152 -0
- data/docs/api/errors.md +211 -0
- data/docs/api/font.md +101 -0
- data/docs/api/fontconfig.md +82 -0
- data/docs/api/formula.md +103 -0
- data/docs/api/index.md +49 -0
- data/docs/api/manifest.md +209 -0
- data/docs/cli/cache.md +100 -0
- data/docs/cli/config.md +123 -0
- data/docs/cli/create-formula.md +65 -0
- data/docs/cli/exit-codes.md +73 -0
- data/docs/cli/fontconfig.md +85 -0
- data/docs/cli/import.md +136 -0
- data/docs/cli/index-cmd.md +37 -0
- data/docs/cli/index.md +80 -0
- data/docs/cli/install.md +52 -0
- data/docs/cli/list.md +39 -0
- data/docs/cli/manifest.md +110 -0
- data/docs/cli/repo.md +142 -0
- data/docs/cli/status.md +39 -0
- data/docs/cli/uninstall.md +34 -0
- data/docs/cli/update.md +31 -0
- data/docs/cli/version.md +38 -0
- data/docs/components/CliCommand.vue +77 -0
- data/docs/components/CliExamples.vue +17 -0
- data/docs/components/CliOptions.vue +26 -0
- data/docs/components/ExitCodes.vue +18 -0
- data/docs/guide/ci.md +4 -0
- data/docs/guide/concepts/fonts.md +158 -0
- data/docs/guide/concepts/formats.md +234 -0
- data/docs/guide/concepts/index.md +109 -0
- data/docs/guide/concepts/licenses.md +236 -0
- data/docs/guide/concepts/requirements.md +388 -0
- data/docs/guide/concepts/variable-fonts.md +212 -0
- data/docs/guide/formulas.md +192 -0
- data/docs/guide/how-it-works.md +428 -0
- data/docs/guide/index.md +26 -47
- data/docs/guide/installation.md +105 -0
- data/docs/guide/manifests.md +132 -0
- data/docs/guide/quick-start.md +76 -0
- data/docs/guide/why.md +4 -0
- data/docs/index.md +55 -23
- data/docs/lychee.toml +33 -0
- data/docs/package-lock.json +9 -114
- data/docs/package.json +3 -5
- data/docs/public/apple-touch-icon.png +0 -0
- data/docs/public/favicon-96x96.png +0 -0
- data/docs/public/favicon.ico +0 -0
- data/docs/public/favicon.svg +1 -0
- data/docs/public/logo-full.svg +1 -0
- data/docs/public/logo.svg +1 -0
- data/docs/public/site.webmanifest +21 -0
- data/docs/public/web-app-manifest-192x192.png +0 -0
- data/docs/public/web-app-manifest-512x512.png +0 -0
- data/lib/fontist/cli.rb +0 -1
- data/lib/fontist/version.rb +1 -1
- metadata +58 -8
- data/.github/workflows/deploy-pages.yml +0 -54
- data/.github/workflows/release.yml.orig +0 -36
- data/docs/guide/api-ruby.md +0 -189
- data/docs/public/hero.png +0 -0
- data/docs/public/logo.png +0 -0
- data/docs/reference/index.md +0 -143
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: How Fontist Works
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# How Fontist Works
|
|
6
|
+
|
|
7
|
+
Understanding Fontist's internal architecture helps you use it effectively and troubleshoot issues.
|
|
8
|
+
|
|
9
|
+
## Architecture Overview
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
13
|
+
│ Fontist │
|
|
14
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
15
|
+
│ │
|
|
16
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
|
17
|
+
│ │ Formulas │ │ Indexes │ │ Fonts │ │
|
|
18
|
+
│ │ (Recipes) │ │ (Catalogs) │ │ (Files) │ │
|
|
19
|
+
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
|
|
20
|
+
│ │ │ │ │
|
|
21
|
+
│ │ ┌─────────────┴─────────────┐ │ │
|
|
22
|
+
│ │ │ │ │ │
|
|
23
|
+
│ └────┤ Font Lookup ├────┘ │
|
|
24
|
+
│ │ │ │
|
|
25
|
+
│ └─────────────┬─────────────┘ │
|
|
26
|
+
│ │ │
|
|
27
|
+
│ ▼ │
|
|
28
|
+
│ ┌───────────────┐ │
|
|
29
|
+
│ │ Return Paths │ │
|
|
30
|
+
│ └───────────────┘ │
|
|
31
|
+
│ │
|
|
32
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Directory Structure
|
|
38
|
+
|
|
39
|
+
Fontist stores all its data in `~/.fontist/`:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
~/.fontist/
|
|
43
|
+
├── fonts/ # Installed font files
|
|
44
|
+
│ ├── roboto/ # Fonts organized by formula
|
|
45
|
+
│ │ ├── Roboto-Regular.ttf
|
|
46
|
+
│ │ └── Roboto-Bold.ttf
|
|
47
|
+
│ └── open-sans/
|
|
48
|
+
│ └── OpenSans-Regular.ttf
|
|
49
|
+
│
|
|
50
|
+
├── versions/
|
|
51
|
+
│ └── v4/
|
|
52
|
+
│ ├── formulas/ # Git clone of formulas repo
|
|
53
|
+
│ │ └── Formulas/
|
|
54
|
+
│ │ ├── roboto.yml
|
|
55
|
+
│ │ └── private/ # Custom formula repos
|
|
56
|
+
│ │ └── my-org/
|
|
57
|
+
│ │
|
|
58
|
+
│ ├── formula_index.default_family.yml # Formula index
|
|
59
|
+
│ ├── formula_index.preferred_family.yml # Alternative naming
|
|
60
|
+
│ └── filename_index.yml # Filename lookup
|
|
61
|
+
│
|
|
62
|
+
├── fontist_index.default_family.yml # Fontist-installed fonts
|
|
63
|
+
├── system_index.default_family.yml # OS system fonts
|
|
64
|
+
└── user_index.default_family.yml # User-installed fonts
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Font Indexes
|
|
70
|
+
|
|
71
|
+
Fontist maintains multiple indexes for fast font lookups. Each index catalogs fonts from a different source.
|
|
72
|
+
|
|
73
|
+
### Index Types
|
|
74
|
+
|
|
75
|
+
| Index | Source | Path |
|
|
76
|
+
|-------|--------|------|
|
|
77
|
+
| **Formula Index** | Formula YAML files | `~/.fontist/versions/v4/formula_index.*.yml` |
|
|
78
|
+
| **System Index** | OS-installed fonts | `~/.fontist/system_index.*.yml` |
|
|
79
|
+
| **Fontist Index** | Fonts installed by Fontist | `~/.fontist/fontist_index.*.yml` |
|
|
80
|
+
| **User Index** | User font directory | `~/.fontist/user_index.*.yml` |
|
|
81
|
+
|
|
82
|
+
### Formula Index
|
|
83
|
+
|
|
84
|
+
Maps font names to formula files for fast lookups:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
# formula_index.default_family.yml
|
|
88
|
+
roboto:
|
|
89
|
+
- roboto.yml
|
|
90
|
+
open sans:
|
|
91
|
+
- open_sans.yml
|
|
92
|
+
segoe ui:
|
|
93
|
+
- segoe_ui.yml
|
|
94
|
+
- macos/segoe_ui.yml # Can have multiple sources
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### System Font Index
|
|
98
|
+
|
|
99
|
+
Catalogs fonts already installed on your operating system:
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
# system_index.default_family.yml
|
|
103
|
+
- path: /System/Library/Fonts/Helvetica.ttc
|
|
104
|
+
full_name: Helvetica
|
|
105
|
+
family_name: Helvetica
|
|
106
|
+
subfamily: Regular
|
|
107
|
+
file_size: 1034204
|
|
108
|
+
file_mtime: 1699900000
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The system index includes smart caching:
|
|
112
|
+
- **Timestamp checks**: Skips re-indexing if directories haven't changed
|
|
113
|
+
- **File metadata**: Uses size and mtime to detect changes
|
|
114
|
+
- **30-minute threshold**: Trusts recent scans without re-checking
|
|
115
|
+
|
|
116
|
+
### Font Lookup Order
|
|
117
|
+
|
|
118
|
+
When you search for a font, Fontist checks indexes in this order:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
1. Fontist Index → ~/.fontist/fonts/
|
|
122
|
+
2. User Index → Platform user fonts + /fontist/
|
|
123
|
+
3. System Index → OS system fonts
|
|
124
|
+
4. Formula Index → Download if not found
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## System Font Detection
|
|
130
|
+
|
|
131
|
+
Fontist automatically detects fonts in OS-specific locations.
|
|
132
|
+
|
|
133
|
+
### macOS
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
/Library/Fonts/**/*.ttf
|
|
137
|
+
/System/Library/Fonts/**/*.ttf
|
|
138
|
+
~/Library/Fonts/*.ttf
|
|
139
|
+
/Applications/Microsoft*/Contents/Resources/**/*.ttf
|
|
140
|
+
/System/Library/AssetsV2/com_apple_MobileAsset_Font*/**/*.ttf
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Windows
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
C:\Windows\Fonts\**\*.ttf
|
|
147
|
+
C:\Users\{username}\AppData\Local\Microsoft\Windows\Fonts\**\*.ttf
|
|
148
|
+
C:\Program Files\Common Files\Microsoft\**\*.ttf
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Linux
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
/usr/share/fonts/**/*.ttf
|
|
155
|
+
~/.local/share/fonts/**/*.ttf
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Configuration Priority
|
|
161
|
+
|
|
162
|
+
Fontist uses a unified configuration system with a clear priority order. Settings can come from multiple sources, but higher-priority sources always override lower ones.
|
|
163
|
+
|
|
164
|
+
### Priority Order (Highest to Lowest)
|
|
165
|
+
|
|
166
|
+
| Priority | Source | Example | Scope |
|
|
167
|
+
|----------|--------|---------|-------|
|
|
168
|
+
| 1 | **Environment Variable** | `FONTIST_PATH=/custom` | Process-wide |
|
|
169
|
+
| 2 | **Config File** | `~/.fontist/config.yml` | Persistent |
|
|
170
|
+
| 3 | **CLI Option** | `--location user` | Single command |
|
|
171
|
+
| 4 | **Ruby API** | `Fontist.preferred_family = true` | Current session |
|
|
172
|
+
| 5 | **Default Value** | Built-in defaults | Fallback |
|
|
173
|
+
|
|
174
|
+
### Example: Install Location Priority
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
# Priority 1: ENV VAR wins
|
|
178
|
+
export FONTIST_INSTALL_LOCATION=user
|
|
179
|
+
fontist install "Roboto" --location system # Still uses "user"!
|
|
180
|
+
|
|
181
|
+
# To override ENV, unset it first
|
|
182
|
+
unset FONTIST_INSTALL_LOCATION
|
|
183
|
+
fontist install "Roboto" --location system # Now uses "system"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Configuration Settings
|
|
187
|
+
|
|
188
|
+
| Setting | ENV VAR | Config Key | CLI Option | Default |
|
|
189
|
+
|--------|---------|------------|------------|---------|
|
|
190
|
+
| Base path | `FONTIST_PATH` | - | - | `~/.fontist` |
|
|
191
|
+
| Fonts path | - | `fonts_path` | - | `~/.fontist/fonts` |
|
|
192
|
+
| Formulas path | `FONTIST_FORMULAS_PATH` | - | `--formulas-path` | (auto) |
|
|
193
|
+
| Install location | `FONTIST_INSTALL_LOCATION` | `fonts_install_location` | `--location` | `fontist` |
|
|
194
|
+
| User fonts path | `FONTIST_USER_FONTS_PATH` | `user_fonts_path` | - | Platform default |
|
|
195
|
+
| System fonts path | `FONTIST_SYSTEM_FONTS_PATH` | `system_fonts_path` | - | Platform default |
|
|
196
|
+
| Preferred family | - | `preferred_family` | `--preferred-family` | `false` |
|
|
197
|
+
| No cache | - | - | `--no-cache` | `false` |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Environment Variables
|
|
202
|
+
|
|
203
|
+
| Variable | Description | Default |
|
|
204
|
+
|----------|-------------|---------|
|
|
205
|
+
| `FONTIST_PATH` | Base directory for all Fontist data | `~/.fontist` |
|
|
206
|
+
| `FONTIST_FORMULAS_PATH` | Custom formulas directory | (auto) |
|
|
207
|
+
| `FONTIST_INSTALL_LOCATION` | Default install location | `fontist` |
|
|
208
|
+
| `FONTIST_USER_FONTS_PATH` | Custom user fonts path | Platform default |
|
|
209
|
+
| `FONTIST_SYSTEM_FONTS_PATH` | Custom system fonts path | Platform default |
|
|
210
|
+
| `FONTIST_IMPORT_CACHE` | Import cache directory | `~/.fontist/import_cache` |
|
|
211
|
+
| `FONTIST_NO_MIRRORS` | Disable formula index mirrors | `false` |
|
|
212
|
+
| `GOOGLE_FONTS_API_KEY` | Google Fonts API key | (none) |
|
|
213
|
+
|
|
214
|
+
### Example: Custom Fontist Path
|
|
215
|
+
|
|
216
|
+
```sh
|
|
217
|
+
# Use a different base directory
|
|
218
|
+
export FONTIST_PATH=/opt/fontist
|
|
219
|
+
fontist install "Roboto"
|
|
220
|
+
# Installs to /opt/fontist/fonts/roboto/
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Installation Locations
|
|
226
|
+
|
|
227
|
+
Fonts can be installed to different locations:
|
|
228
|
+
|
|
229
|
+
| Location | Path | Use Case |
|
|
230
|
+
|----------|------|----------|
|
|
231
|
+
| **fontist** (default) | `~/.fontist/fonts/{formula}/` | Isolated, safe, recommended |
|
|
232
|
+
| **user** | Platform-specific + `/fontist/` | Available to all apps |
|
|
233
|
+
| **system** | System fonts dir + `/fontist/` | All users (requires admin) |
|
|
234
|
+
|
|
235
|
+
### Platform-Specific User Paths
|
|
236
|
+
|
|
237
|
+
| Platform | User Font Path |
|
|
238
|
+
|----------|----------------|
|
|
239
|
+
| macOS | `~/Library/Fonts/fontist/` |
|
|
240
|
+
| Linux | `~/.local/share/fonts/fontist/` |
|
|
241
|
+
| Windows | `%LOCALAPPDATA%\Microsoft\Windows\Fonts\fontist\` |
|
|
242
|
+
|
|
243
|
+
### Specifying Location
|
|
244
|
+
|
|
245
|
+
```sh
|
|
246
|
+
# Default: install to ~/.fontist/fonts/
|
|
247
|
+
fontist install "Roboto"
|
|
248
|
+
|
|
249
|
+
# Install to user fonts directory
|
|
250
|
+
fontist install "Roboto" --location user
|
|
251
|
+
|
|
252
|
+
# Install system-wide (requires admin)
|
|
253
|
+
sudo fontist install "Roboto" --location system
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Font Lookup Flow
|
|
259
|
+
|
|
260
|
+
When you run `fontist install "Open Sans"`:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
264
|
+
│ Step 1: Check Installed Fonts │
|
|
265
|
+
│ Search Fontist Index → Found? → Return paths │
|
|
266
|
+
│ Search User Index → Found? → Return paths │
|
|
267
|
+
│ Search System Index → Found? → Return paths │
|
|
268
|
+
└─────────────────────────┬───────────────────────────────────┘
|
|
269
|
+
│ Not found
|
|
270
|
+
▼
|
|
271
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
272
|
+
│ Step 2: Search Formulas │
|
|
273
|
+
│ Look up "open sans" in Formula Index │
|
|
274
|
+
│ Found formula: open_sans.yml │
|
|
275
|
+
└─────────────────────────┬───────────────────────────────────┘
|
|
276
|
+
│
|
|
277
|
+
▼
|
|
278
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
279
|
+
│ Step 3: Download & Install │
|
|
280
|
+
│ Parse formula → Get download URL │
|
|
281
|
+
│ Download archive → Verify checksum │
|
|
282
|
+
│ Extract fonts → Install to ~/.fontist/fonts/open-sans/ │
|
|
283
|
+
│ Update Fontist Index │
|
|
284
|
+
└─────────────────────────┬───────────────────────────────────┘
|
|
285
|
+
│
|
|
286
|
+
▼
|
|
287
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
288
|
+
│ Step 4: Return Paths │
|
|
289
|
+
│ Return: ["/home/user/.fontist/fonts/open-sans/OpenSans- │
|
|
290
|
+
│ Regular.ttf", ...] │
|
|
291
|
+
└─────────────────────────────────────────────────────────────┘
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Index Management
|
|
297
|
+
|
|
298
|
+
### Automatic Rebuilding
|
|
299
|
+
|
|
300
|
+
Indexes are rebuilt automatically when:
|
|
301
|
+
- Formulas repository is updated (`fontist update`)
|
|
302
|
+
- A new formula repo is added (`fontist repo add`)
|
|
303
|
+
- Fonts are installed or uninstalled
|
|
304
|
+
|
|
305
|
+
### Manual Index Commands
|
|
306
|
+
|
|
307
|
+
```sh
|
|
308
|
+
# Rebuild all indexes from scratch
|
|
309
|
+
fontist index rebuild
|
|
310
|
+
|
|
311
|
+
# Show index file location
|
|
312
|
+
fontist index path
|
|
313
|
+
|
|
314
|
+
# List all indexed fonts
|
|
315
|
+
fontist index list
|
|
316
|
+
|
|
317
|
+
# Clear index (forces rebuild on next access)
|
|
318
|
+
fontist index clear
|
|
319
|
+
|
|
320
|
+
# Show index statistics
|
|
321
|
+
fontist index info
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Index Update Strategies
|
|
325
|
+
|
|
326
|
+
| Command | When to Use |
|
|
327
|
+
|---------|-------------|
|
|
328
|
+
| `fontist update` | Get latest formulas and rebuild indexes |
|
|
329
|
+
| `fontist index rebuild` | Full system font rescan (slow but complete) |
|
|
330
|
+
| `fontist index update` | Incremental update (fast, detects changes) |
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Configuration Priority
|
|
335
|
+
|
|
336
|
+
Fontist uses a unified configuration system with a clear priority order. Settings can come from multiple sources, but higher-priority sources always override lower ones.
|
|
337
|
+
|
|
338
|
+
### Priority Order (Highest to Lowest)
|
|
339
|
+
|
|
340
|
+
| Priority | Source | Example | Scope |
|
|
341
|
+
|----------|--------|---------|-------|
|
|
342
|
+
| 1 | **Environment Variable** | `FONTIST_PATH=/custom` | Process-wide |
|
|
343
|
+
| 2 | **Config File** | `~/.fontist/config.yml` | Persistent |
|
|
344
|
+
| 3 | **CLI Option** | `--location user` | Single command |
|
|
345
|
+
| 4 | **Ruby API** | `Fontist.preferred_family = true` | Current session |
|
|
346
|
+
| 5 | **Default Value** | Built-in defaults | Fallback |
|
|
347
|
+
|
|
348
|
+
### Example: Install Location Priority
|
|
349
|
+
|
|
350
|
+
```sh
|
|
351
|
+
# Priority 1: ENV VAR wins
|
|
352
|
+
export FONTIST_INSTALL_LOCATION=user
|
|
353
|
+
fontist install "Roboto" --location system # Still uses "user"!
|
|
354
|
+
|
|
355
|
+
# To override ENV, unset it first
|
|
356
|
+
unset FONTIST_INSTALL_LOCATION
|
|
357
|
+
fontist install "Roboto" --location system # Now uses "system"
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Configuration Settings Matrix
|
|
361
|
+
|
|
362
|
+
| Setting | ENV VAR | Config Key | CLI Option | Default |
|
|
363
|
+
|---------|---------|------------|------------|---------|
|
|
364
|
+
| Base path | `FONTIST_PATH` | - | - | `~/.fontist` |
|
|
365
|
+
| Fonts path | - | `fonts_path` | - | `~/.fontist/fonts` |
|
|
366
|
+
| Formulas path | `FONTIST_FORMULAS_PATH` | - | `--formulas-path` | (auto) |
|
|
367
|
+
| Install location | `FONTIST_INSTALL_LOCATION` | `fonts_install_location` | `--location` | `fontist` |
|
|
368
|
+
| User fonts path | `FONTIST_USER_FONTS_PATH` | `user_fonts_path` | - | Platform default |
|
|
369
|
+
| System fonts path | `FONTIST_SYSTEM_FONTS_PATH` | `system_fonts_path` | - | Platform default |
|
|
370
|
+
| Preferred family | `FONTIST_PREFERRED_FAMILY` | `preferred_family` | `--preferred-family` | `false` |
|
|
371
|
+
| Open timeout | - | `open_timeout` | - | `60` |
|
|
372
|
+
| Read timeout | - | `read_timeout` | - | `60` |
|
|
373
|
+
| Google Fonts key | `GOOGLE_FONTS_API_KEY` | `google_fonts_key` | - | `nil` |
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Environment Variables
|
|
378
|
+
|
|
379
|
+
| Variable | Description | Default |
|
|
380
|
+
|----------|-------------|---------|
|
|
381
|
+
| `FONTIST_PATH` | Base directory for all Fontist data | `~/.fontist` |
|
|
382
|
+
| `FONTIST_FORMULAS_PATH` | Custom formulas directory | (auto) |
|
|
383
|
+
| `FONTIST_INSTALL_LOCATION` | Default install location (`fontist`, `user`, `system`) | `fontist` |
|
|
384
|
+
| `FONTIST_USER_FONTS_PATH` | Custom user fonts path | Platform default |
|
|
385
|
+
| `FONTIST_SYSTEM_FONTS_PATH` | Custom system fonts path | Platform default |
|
|
386
|
+
| `FONTIST_IMPORT_CACHE` | Import cache directory | `~/.fontist/import_cache` |
|
|
387
|
+
| `FONTIST_NO_MIRRORS` | Disable formula index mirrors | `false` |
|
|
388
|
+
| `FONTIST_PREFERRED_FAMILY` | Use preferred family naming | `false` |
|
|
389
|
+
| `GOOGLE_FONTS_API_KEY` | Google Fonts API key | (none) |
|
|
390
|
+
|
|
391
|
+
### Example: Custom Fontist Path
|
|
392
|
+
|
|
393
|
+
```sh
|
|
394
|
+
# Use a different base directory
|
|
395
|
+
export FONTIST_PATH=/opt/fontist
|
|
396
|
+
fontist install "Roboto"
|
|
397
|
+
# Installs to /opt/fontist/fonts/roboto/
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## Managed vs Non-Managed Locations
|
|
403
|
+
|
|
404
|
+
### Managed Locations (Fontist controls)
|
|
405
|
+
|
|
406
|
+
When using default paths or paths with `/fontist/` subdirectory:
|
|
407
|
+
- `~/.fontist/fonts/` - Always managed
|
|
408
|
+
- `~/Library/Fonts/fontist/` - Managed subdirectory
|
|
409
|
+
- `/Library/Fonts/fontist/` - Managed subdirectory
|
|
410
|
+
|
|
411
|
+
**Behavior:** Fontist safely replaces existing fonts
|
|
412
|
+
|
|
413
|
+
### Non-Managed Locations (custom paths)
|
|
414
|
+
|
|
415
|
+
When you set custom root paths via ENV:
|
|
416
|
+
- `FONTIST_USER_FONTS_PATH=~/Library/Fonts` → installs directly to user fonts
|
|
417
|
+
- `FONTIST_SYSTEM_FONTS_PATH=/Library/Fonts` → installs directly to system fonts
|
|
418
|
+
|
|
419
|
+
**Behavior:** Fontist uses unique filenames (`-fontist` suffix) to avoid overwriting existing fonts
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## See Also
|
|
424
|
+
|
|
425
|
+
- [Formulas Guide](/guide/formulas) - How formulas work
|
|
426
|
+
- [Installation Guide](/guide/installation) - Installing Fontist
|
|
427
|
+
- [CLI Reference: index](/cli/index-cmd) - Index commands
|
|
428
|
+
- [CLI Reference: repo](/cli/repo) - Repository management
|
data/docs/guide/index.md
CHANGED
|
@@ -1,67 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
title: Getting Started
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
# Getting Started
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
gem install fontist
|
|
7
|
-
```
|
|
7
|
+
Fontist is a cross-platform font manager that installs fonts with a single command. It works consistently across macOS, Windows, and Linux, making it ideal for local development and CI/CD pipelines.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Overview
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Fontist provides a unified API for installing and managing fonts across different operating systems. Instead of manually downloading fonts and placing them in system folders, you can use `fontist install` to manage fonts programmatically.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
fontist install "Fira Code"
|
|
15
|
-
fontist install "Open Sans"
|
|
16
|
-
fontist install "Consolas"
|
|
17
|
-
```
|
|
13
|
+
Fontist uses a **formula repository** to locate and download fonts. The main repository includes Google Fonts, SIL Fonts, macOS fonts, and many others.
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
## Key Concepts
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
- **[Font Concepts](/guide/concepts/)**: Understand fonts, styles, weights, formats, containers, variable fonts, and licenses.
|
|
18
|
+
- **Formulas**: YAML files that describe where to download fonts and how to install them. Formulas are maintained in the [fontist/formulas](https://github.com/fontist/formulas) repository.
|
|
19
|
+
- **Manifests**: YAML files that specify which fonts your project needs. Manifests enable reproducible font installations across teams and CI environments.
|
|
20
|
+
- **Locations**: Fonts can be installed to Fontist's own directory, the user's fonts folder, or system-wide (with appropriate permissions).
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
## Quick Start
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
Install Fontist via RubyGems:
|
|
26
25
|
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Times New Roman:
|
|
30
|
-
Arial:
|
|
31
|
-
Courier New:
|
|
32
|
-
---
|
|
26
|
+
```sh
|
|
27
|
+
gem install fontist
|
|
33
28
|
```
|
|
34
29
|
|
|
35
|
-
|
|
30
|
+
Install your first font:
|
|
36
31
|
|
|
37
32
|
```sh
|
|
38
|
-
fontist
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
---
|
|
43
|
-
Arial:
|
|
44
|
-
Regular:
|
|
45
|
-
full_name: Arial
|
|
46
|
-
paths:
|
|
47
|
-
- "/home/octocat/.fontist/fonts/Arial.ttf"
|
|
48
|
-
Bold Italic:
|
|
49
|
-
...
|
|
33
|
+
fontist install "Fira Code"
|
|
50
34
|
```
|
|
51
35
|
|
|
52
|
-
|
|
36
|
+
Check installed fonts:
|
|
53
37
|
|
|
54
38
|
```sh
|
|
55
|
-
fontist
|
|
39
|
+
fontist status
|
|
56
40
|
```
|
|
57
41
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
paths:
|
|
64
|
-
- "/home/octocat/.fontist/fonts/Arial.ttf"
|
|
65
|
-
Bold Italic:
|
|
66
|
-
...
|
|
67
|
-
```
|
|
42
|
+
## Next Steps
|
|
43
|
+
|
|
44
|
+
- [Installation Guide](/guide/installation) - Detailed installation instructions and platform-specific notes
|
|
45
|
+
- [Quick Start Tutorial](/guide/quick-start) - A 5-minute guide to get up and running
|
|
46
|
+
- [CLI Reference](/cli/) - Complete command documentation
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Installation
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Installation
|
|
6
|
+
|
|
7
|
+
Fontist is distributed as a RubyGem and can be installed on macOS, Windows, and Linux.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- **Ruby 2.7 or higher** - Fontist requires a recent Ruby version
|
|
12
|
+
- **Git** - Used internally for fetching formulas and fonts
|
|
13
|
+
|
|
14
|
+
To check your Ruby version:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
ruby --version
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
If you don't have Ruby installed, download it from the [official Ruby website](https://www.ruby-lang.org/en/downloads/).
|
|
21
|
+
|
|
22
|
+
## Install Fontist
|
|
23
|
+
|
|
24
|
+
Install the gem using RubyGems:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
gem install fontist
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Verify the installation:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
fontist version
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Platform-Specific Notes
|
|
37
|
+
|
|
38
|
+
### macOS
|
|
39
|
+
|
|
40
|
+
macOS comes with Ruby pre-installed. If you encounter permission issues, consider using a Ruby version manager like [rbenv](https://github.com/rbenv/rbenv) or [asdf](https://github.com/asdf-vm/asdf).
|
|
41
|
+
|
|
42
|
+
### Windows
|
|
43
|
+
|
|
44
|
+
On Windows, we recommend using [RubyInstaller](https://rubyinstaller.org/) which includes the DevKit needed for native extensions.
|
|
45
|
+
|
|
46
|
+
### Linux
|
|
47
|
+
|
|
48
|
+
Most Linux distributions have Ruby available through their package managers:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
# Debian/Ubuntu
|
|
52
|
+
sudo apt install ruby ruby-dev
|
|
53
|
+
|
|
54
|
+
# Fedora
|
|
55
|
+
sudo dnf install ruby ruby-devel
|
|
56
|
+
|
|
57
|
+
# Arch Linux
|
|
58
|
+
sudo pacman -S ruby
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## CI/CD Environments
|
|
62
|
+
|
|
63
|
+
Fontist works great in CI environments. For GitHub Actions, use the [fontist/setup](https://github.com/fontist/setup) action:
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
- uses: fontist/setup@v1
|
|
67
|
+
- run: fontist install "Fira Code"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
See the [CI/CD Integration guide](/guide/ci) for more details.
|
|
71
|
+
|
|
72
|
+
## Troubleshooting
|
|
73
|
+
|
|
74
|
+
### Permission Errors
|
|
75
|
+
|
|
76
|
+
If you get permission errors during installation, you may need to use `sudo` (not recommended) or configure your Ruby environment to install gems in your user directory:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
gem install fontist --user-install
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Native Extension Errors
|
|
83
|
+
|
|
84
|
+
Fontist uses native extensions for performance. If you see errors about failed compilations, ensure you have a C compiler and development headers installed:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
# Debian/Ubuntu
|
|
88
|
+
sudo apt install build-essential ruby-dev
|
|
89
|
+
|
|
90
|
+
# Fedora
|
|
91
|
+
sudo dnf install gcc ruby-devel
|
|
92
|
+
|
|
93
|
+
# macOS (with Xcode Command Line Tools)
|
|
94
|
+
xcode-select --install
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Proxy Configuration
|
|
98
|
+
|
|
99
|
+
If you're behind a proxy, configure Git to use it:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
git config --global http.proxy http://user:pass@proxyhost:port
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
See the [Proxy Configuration guide](/guide/proxy) for detailed instructions.
|