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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +70 -0
  3. data/.github/workflows/links.yml +100 -0
  4. data/.gitignore +2 -1
  5. data/docs/.vitepress/config.ts +153 -32
  6. data/docs/.vitepress/data/cli-commands.json +461 -0
  7. data/docs/.vitepress/data/exit-codes.json +21 -0
  8. data/docs/.vitepress/data/features.json +44 -0
  9. data/docs/.vitepress/theme/components/HeroCodeBlock.vue +98 -0
  10. data/docs/.vitepress/theme/components/WithinHero.vue +30 -0
  11. data/docs/.vitepress/theme/index.ts +12 -0
  12. data/docs/.vitepress/theme/style.css +152 -0
  13. data/docs/api/errors.md +211 -0
  14. data/docs/api/font.md +101 -0
  15. data/docs/api/fontconfig.md +82 -0
  16. data/docs/api/formula.md +103 -0
  17. data/docs/api/index.md +49 -0
  18. data/docs/api/manifest.md +209 -0
  19. data/docs/cli/cache.md +100 -0
  20. data/docs/cli/config.md +123 -0
  21. data/docs/cli/create-formula.md +65 -0
  22. data/docs/cli/exit-codes.md +73 -0
  23. data/docs/cli/fontconfig.md +85 -0
  24. data/docs/cli/import.md +136 -0
  25. data/docs/cli/index-cmd.md +37 -0
  26. data/docs/cli/index.md +80 -0
  27. data/docs/cli/install.md +52 -0
  28. data/docs/cli/list.md +39 -0
  29. data/docs/cli/manifest.md +110 -0
  30. data/docs/cli/repo.md +142 -0
  31. data/docs/cli/status.md +39 -0
  32. data/docs/cli/uninstall.md +34 -0
  33. data/docs/cli/update.md +31 -0
  34. data/docs/cli/version.md +38 -0
  35. data/docs/components/CliCommand.vue +77 -0
  36. data/docs/components/CliExamples.vue +17 -0
  37. data/docs/components/CliOptions.vue +26 -0
  38. data/docs/components/ExitCodes.vue +18 -0
  39. data/docs/guide/ci.md +4 -0
  40. data/docs/guide/concepts/fonts.md +158 -0
  41. data/docs/guide/concepts/formats.md +234 -0
  42. data/docs/guide/concepts/index.md +109 -0
  43. data/docs/guide/concepts/licenses.md +236 -0
  44. data/docs/guide/concepts/requirements.md +388 -0
  45. data/docs/guide/concepts/variable-fonts.md +212 -0
  46. data/docs/guide/formulas.md +192 -0
  47. data/docs/guide/how-it-works.md +428 -0
  48. data/docs/guide/index.md +26 -47
  49. data/docs/guide/installation.md +105 -0
  50. data/docs/guide/manifests.md +132 -0
  51. data/docs/guide/quick-start.md +76 -0
  52. data/docs/guide/why.md +4 -0
  53. data/docs/index.md +55 -23
  54. data/docs/lychee.toml +33 -0
  55. data/docs/package-lock.json +9 -114
  56. data/docs/package.json +3 -5
  57. data/docs/public/apple-touch-icon.png +0 -0
  58. data/docs/public/favicon-96x96.png +0 -0
  59. data/docs/public/favicon.ico +0 -0
  60. data/docs/public/favicon.svg +1 -0
  61. data/docs/public/logo-full.svg +1 -0
  62. data/docs/public/logo.svg +1 -0
  63. data/docs/public/site.webmanifest +21 -0
  64. data/docs/public/web-app-manifest-192x192.png +0 -0
  65. data/docs/public/web-app-manifest-512x512.png +0 -0
  66. data/lib/fontist/cli.rb +0 -1
  67. data/lib/fontist/version.rb +1 -1
  68. metadata +58 -8
  69. data/.github/workflows/deploy-pages.yml +0 -54
  70. data/.github/workflows/release.yml.orig +0 -36
  71. data/docs/guide/api-ruby.md +0 -189
  72. data/docs/public/hero.png +0 -0
  73. data/docs/public/logo.png +0 -0
  74. data/docs/reference/index.md +0 -143
@@ -0,0 +1,212 @@
1
+ ---
2
+ title: Variable Fonts
3
+ ---
4
+
5
+ # Variable Fonts
6
+
7
+ **Variable Fonts** (OpenType 1.8+) contain multiple styles in a single file through named **axes**. Instead of separate files for each weight, one file can contain all variations.
8
+
9
+ ## Why Variable Fonts?
10
+
11
+ ### Before: Static Fonts
12
+
13
+ ```
14
+ fonts/
15
+ ├── Roboto-Thin.ttf (100)
16
+ ├── Roboto-Light.ttf (300)
17
+ ├── Roboto-Regular.ttf (400)
18
+ ├── Roboto-Medium.ttf (500)
19
+ ├── Roboto-Bold.ttf (700)
20
+ └── Roboto-Black.ttf (900)
21
+
22
+ Total: 6 files, ~1.2MB
23
+ ```
24
+
25
+ ### After: Variable Font
26
+
27
+ ```
28
+ fonts/
29
+ └── RobotoFlex-VF.ttf
30
+
31
+ Total: 1 file, ~800KB
32
+ ```
33
+
34
+ ---
35
+
36
+ ## Standard Axes
37
+
38
+ Variable fonts use **axes** to define adjustable properties:
39
+
40
+ | Axis Tag | Name | Description | Range |
41
+ |----------|------|-------------|-------|
42
+ | `wght` | Weight | Stroke thickness | 100-900 |
43
+ | `wdth` | Width | Horizontal compression | 25%-200% |
44
+ | `slnt` | Slant | Oblique angle | -15° to 0° |
45
+ | `ital` | Italic | Italic variation | 0 or 1 |
46
+ | `opsz` | Optical Size | Size optimization | 8pt-144pt |
47
+
48
+ ### Weight Axis (`wght`)
49
+
50
+ The most common axis, replacing multiple static weights:
51
+
52
+ ```css
53
+ /* CSS usage */
54
+ font-weight: 400; /* Regular */
55
+ font-weight: 700; /* Bold */
56
+ font-weight: 543; /* Any value in range */
57
+ ```
58
+
59
+ ### Width Axis (`wdth`)
60
+
61
+ Controls horizontal compression/extension:
62
+
63
+ ```css
64
+ font-stretch: 100%; /* Normal */
65
+ font-stretch: 75%; /* Condensed */
66
+ font-stretch: 125%; /* Extended */
67
+ ```
68
+
69
+ ### Optical Size Axis (`opsz`)
70
+
71
+ Optimizes glyphs for different sizes:
72
+
73
+ ```css
74
+ font-optical-sizing: auto;
75
+ /* or manually: */
76
+ font-variation-settings: 'opsz' 12;
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Custom Axes
82
+
83
+ Fonts can define custom axes beyond the standard five:
84
+
85
+ | Axis Tag | Name | Description |
86
+ |----------|------|-------------|
87
+ | `GRAD` | Grade | Weight change without width adjustment |
88
+ | `XTRA` | X-height | Adjust x-height |
89
+ | `XOPQ` | X Optical | Horizontal stroke adjustment |
90
+ | `YOPQ` | Y Optical | Vertical stroke adjustment |
91
+ | `ROTL` | Rotation | Glyph rotation |
92
+ | `CASL` | Casual | Formal to casual variation |
93
+
94
+ ### Example: Roboto Flex
95
+
96
+ Roboto Flex is a highly customizable variable font:
97
+
98
+ ```
99
+ RobotoFlex-VF.ttf
100
+ ├── wght axis: 100 → 900 (weight)
101
+ ├── wdth axis: 25% → 151% (width)
102
+ ├── GRAD axis: -200 → 150 (grade)
103
+ ├── XTRA axis: 323 → 608 (x-height)
104
+ ├── XOPQ axis: 27 → 175 (x optical)
105
+ ├── YOPQ axis: 25 → 135 (y optical)
106
+ ├── YTFI axis: 560 → 788 (y-fit)
107
+ ├── YTLC axis: 416 → 570 (lowercase)
108
+ ├── YTUC axis: 528 → 760 (uppercase)
109
+ └── YTAS axis: 649 → 854 (ascender)
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Using Variable Fonts
115
+
116
+ ### In Fontist
117
+
118
+ ```bash
119
+ # Variable fonts install like any other font
120
+ fontist install "Roboto Flex"
121
+
122
+ # The single VF file replaces multiple static files
123
+ fontist status "Roboto Flex"
124
+ ```
125
+
126
+ ### In CSS
127
+
128
+ ```css
129
+ /* Basic usage */
130
+ .element {
131
+ font-family: "Roboto Flex";
132
+ font-weight: 450;
133
+ }
134
+
135
+ /* Advanced control */
136
+ .element {
137
+ font-variation-settings:
138
+ 'wght' 450,
139
+ 'GRAD' 50,
140
+ 'XTRA' 500;
141
+ }
142
+ ```
143
+
144
+ ### In Fontisan
145
+
146
+ Fontisan provides variable font operations:
147
+
148
+ - **Instantiate** - Create static instances from variable fonts
149
+ - **Subset axes** - Reduce axis ranges to needed values
150
+ - **Axis analysis** - Report available axes and ranges
151
+
152
+ ```bash
153
+ # Create a static instance at weight 450
154
+ fontisan instantiate RobotoFlex-VF.ttf --wght 450
155
+
156
+ # Subset to only weight range 400-700
157
+ fontisan subset-axes RobotoFlex-VF.ttf --wght 400-700
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Named Instances
163
+
164
+ Variable fonts can define **named instances** - preset combinations of axis values:
165
+
166
+ | Instance Name | wght | wdth |
167
+ |--------------|------|------|
168
+ | Light | 300 | 100 |
169
+ | Regular | 400 | 100 |
170
+ | Bold | 700 | 100 |
171
+ | Condensed Bold | 700 | 75 |
172
+
173
+ These appear as separate fonts in some applications.
174
+
175
+ ---
176
+
177
+ ## Variable Fonts vs Static Fonts
178
+
179
+ | Aspect | Static | Variable |
180
+ |--------|--------|----------|
181
+ | Files | Multiple | Single |
182
+ | File size | Larger total | Smaller total |
183
+ | Weight options | Fixed set | Continuous |
184
+ | CSS control | Limited | Fine-grained |
185
+ | Browser support | Universal | Modern browsers |
186
+ | PDF embedding | Simple | Requires care |
187
+
188
+ ---
189
+
190
+ ## Detecting Variable Fonts
191
+
192
+ ### Using Fontist
193
+
194
+ ```bash
195
+ fontist status --verbose
196
+ # Shows if installed fonts are variable
197
+ ```
198
+
199
+ ### Using Fontisan
200
+
201
+ ```bash
202
+ fontisan analyze font.ttf
203
+ # Reports axes, ranges, and named instances
204
+ ```
205
+
206
+ ---
207
+
208
+ ## See Also
209
+
210
+ - [Fonts & Styles](/guide/concepts/fonts) - Basic font concepts
211
+ - [Formats & Containers](/guide/concepts/formats) - File formats explained
212
+ - [Fontisan Documentation](https://www.fontist.org/fontisan/) - Variable font operations
@@ -0,0 +1,192 @@
1
+ ---
2
+ title: Formulas
3
+ ---
4
+
5
+ # Formulas
6
+
7
+ Formulas are YAML files that describe how to download and install fonts. Fontist uses formulas to locate fonts from various sources and install them consistently across platforms.
8
+
9
+ ## How Formulas Work
10
+
11
+ When you run `fontist install "Fira Code"`, Fontist:
12
+
13
+ 1. Searches the formula repository for a formula matching "Fira Code"
14
+ 2. Reads the formula to find the download URL and extraction instructions
15
+ 3. Downloads the font archive
16
+ 4. Extracts and installs the font files to your Fontist directory
17
+
18
+ The formula contains all the metadata needed: download URLs, checksums, file patterns, font names, and styles.
19
+
20
+ ## Formula Repository
21
+
22
+ ### Official Repository
23
+
24
+ The main formula repository is [fontist/formulas](https://github.com/fontist/formulas) on GitHub. It includes formulas for:
25
+
26
+ - Google Fonts (Roboto, Open Sans, etc.)
27
+ - SIL Fonts
28
+ - macOS system fonts
29
+ - Windows fonts
30
+ - Many other open source fonts
31
+
32
+ ### Local Storage
33
+
34
+ Fontist clones the formulas repository to your local machine:
35
+
36
+ ```
37
+ ~/.fontist/
38
+ └── versions/
39
+ └── v4/
40
+ └── formulas/ # Git clone of fontist/formulas
41
+ └── Formulas/ # YAML formula files
42
+ ├── roboto.yml
43
+ ├── open-sans.yml
44
+ ├── private/ # Custom formula repos
45
+ │ └── my-org/
46
+ │ └── custom-font.yml
47
+ └── ...
48
+ ```
49
+
50
+ ### Automatic Management
51
+
52
+ Fontist manages the formulas repository automatically:
53
+
54
+ - **Lazy initialization**: The repository is cloned on first use
55
+ - **Automatic updates**: Run `fontist update` to fetch the latest formulas
56
+ - **Shallow clone**: Only the latest commit is downloaded (depth=1) for efficiency
57
+
58
+ ```sh
59
+ # Update to latest formulas
60
+ fontist update
61
+
62
+ # This pulls the latest changes and rebuilds the index
63
+ ```
64
+
65
+ ### Formula Index
66
+
67
+ For fast lookups, Fontist builds an index mapping font names to formula files:
68
+
69
+ ```
70
+ ~/.fontist/versions/v4/
71
+ ├── formula_index.default_family.yml # Font name → formula path
72
+ ├── formula_index.preferred_family.yml # Alternative naming
73
+ └── filename_index.yml # Filename → formula path
74
+ ```
75
+
76
+ The index is rebuilt automatically when formulas are updated.
77
+
78
+ ## Viewing Available Formulas
79
+
80
+ To see all available fonts:
81
+
82
+ ```sh
83
+ fontist list
84
+ ```
85
+
86
+ Search for a specific font:
87
+
88
+ ```sh
89
+ fontist list "Roboto"
90
+ ```
91
+
92
+ The list shows both installed fonts and fonts available in formulas.
93
+
94
+ ## Formula Structure
95
+
96
+ A formula is a YAML file with this structure:
97
+
98
+ ```yaml
99
+ name: Roboto
100
+ description: Roboto is a neo-grotesque sans-serif typeface family
101
+ homepage: https://fonts.google.com/specimen/Roboto
102
+ resources:
103
+ Roboto.zip:
104
+ urls:
105
+ - https://github.com/googlefonts/Roboto/releases/download/v3.009/Roboto.zip
106
+ sha256: abc123...
107
+ fonts:
108
+ - name: Roboto
109
+ styles:
110
+ - family_name: Roboto
111
+ type: Regular
112
+ full_name: Roboto Regular
113
+ post_script_name: Roboto-Regular
114
+ filename: Roboto-Regular.ttf
115
+ ```
116
+
117
+ ## Creating Custom Formulas
118
+
119
+ If a font isn't in the main repository, you can create a custom formula:
120
+
121
+ ```sh
122
+ fontist create-formula https://example.com/fonts/myfont.zip
123
+ ```
124
+
125
+ This command:
126
+
127
+ 1. Downloads the font archive
128
+ 2. Analyzes the font files
129
+ 3. Generates a formula YAML file
130
+
131
+ You can specify options:
132
+
133
+ ```sh
134
+ fontist create-formula https://example.com/fonts/myfont.zip \
135
+ --name "My Font" \
136
+ --subdir "fonts/otf" \
137
+ --file-pattern "*.otf"
138
+ ```
139
+
140
+ ### Custom Formula Use Cases
141
+
142
+ - **Private fonts**: Create formulas for proprietary fonts your organization uses
143
+ - **New fonts**: Add support for fonts not yet in the main repository
144
+ - **Contributing**: Prepare formulas for submission to the Fontist project
145
+
146
+ ## Private Formula Repositories
147
+
148
+ Organizations can maintain private formula repositories for internal or licensed fonts.
149
+
150
+ ### Adding a Private Repository
151
+
152
+ ```sh
153
+ # Add a private formula repository
154
+ fontist repo add my-company https://github.com/mycompany/fontist-formulas
155
+
156
+ # List configured repositories
157
+ fontist repo list
158
+
159
+ # Update a specific repository
160
+ fontist repo update my-company
161
+
162
+ # Remove a repository
163
+ fontist repo remove my-company
164
+ ```
165
+
166
+ ### Private Repository Structure
167
+
168
+ Private repos are stored alongside the main formulas:
169
+
170
+ ```
171
+ ~/.fontist/versions/v4/formulas/Formulas/private/
172
+ ├── my-company/
173
+ │ ├── corporate-font.yml
174
+ │ └── licensed-font.yml
175
+ └── another-org/
176
+ └── special-font.yml
177
+ ```
178
+
179
+ ### When to Use Private Repositories
180
+
181
+ - **Licensed fonts**: Fonts your organization has licensed for internal use
182
+ - **Custom fonts**: Proprietary typefaces developed in-house
183
+ - **Preliminary formulas**: Testing formulas before contributing to the main repo
184
+
185
+ See the [repo command reference](/cli/repo) for complete command documentation.
186
+
187
+ ## Related
188
+
189
+ - [How Fontist Works](/guide/how-it-works) - Internal architecture and indexes
190
+ - [create-formula CLI reference](/cli/create-formula) - Command options and examples
191
+ - [repo CLI reference](/cli/repo) - Managing formula repositories
192
+ - [update CLI reference](/cli/update) - Updating formulas