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
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontist
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-06 00:00:00.000000000 Z
11
+ date: 2026-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: down
@@ -268,14 +268,14 @@ executables:
268
268
  extensions: []
269
269
  extra_rdoc_files: []
270
270
  files:
271
- - ".github/workflows/deploy-pages.yml"
272
271
  - ".github/workflows/discover-fonts.yml"
272
+ - ".github/workflows/docs.yml"
273
273
  - ".github/workflows/formulas-auto-update-test.yml"
274
+ - ".github/workflows/links.yml"
274
275
  - ".github/workflows/post-rake.yml"
275
276
  - ".github/workflows/rake-metanorma.yaml"
276
277
  - ".github/workflows/rake.yml"
277
278
  - ".github/workflows/release.yml"
278
- - ".github/workflows/release.yml.orig"
279
279
  - ".github/workflows/tebako-pack.yml"
280
280
  - ".gitignore"
281
281
  - ".gitmodules"
@@ -289,18 +289,68 @@ files:
289
289
  - Rakefile
290
290
  - docs/.gitignore
291
291
  - docs/.vitepress/config.ts
292
- - docs/guide/api-ruby.md
292
+ - docs/.vitepress/data/cli-commands.json
293
+ - docs/.vitepress/data/exit-codes.json
294
+ - docs/.vitepress/data/features.json
295
+ - docs/.vitepress/theme/components/HeroCodeBlock.vue
296
+ - docs/.vitepress/theme/components/WithinHero.vue
297
+ - docs/.vitepress/theme/index.ts
298
+ - docs/.vitepress/theme/style.css
299
+ - docs/api/errors.md
300
+ - docs/api/font.md
301
+ - docs/api/fontconfig.md
302
+ - docs/api/formula.md
303
+ - docs/api/index.md
304
+ - docs/api/manifest.md
305
+ - docs/cli/cache.md
306
+ - docs/cli/config.md
307
+ - docs/cli/create-formula.md
308
+ - docs/cli/exit-codes.md
309
+ - docs/cli/fontconfig.md
310
+ - docs/cli/import.md
311
+ - docs/cli/index-cmd.md
312
+ - docs/cli/index.md
313
+ - docs/cli/install.md
314
+ - docs/cli/list.md
315
+ - docs/cli/manifest.md
316
+ - docs/cli/repo.md
317
+ - docs/cli/status.md
318
+ - docs/cli/uninstall.md
319
+ - docs/cli/update.md
320
+ - docs/cli/version.md
321
+ - docs/components/CliCommand.vue
322
+ - docs/components/CliExamples.vue
323
+ - docs/components/CliOptions.vue
324
+ - docs/components/ExitCodes.vue
293
325
  - docs/guide/ci.md
326
+ - docs/guide/concepts/fonts.md
327
+ - docs/guide/concepts/formats.md
328
+ - docs/guide/concepts/index.md
329
+ - docs/guide/concepts/licenses.md
330
+ - docs/guide/concepts/requirements.md
331
+ - docs/guide/concepts/variable-fonts.md
294
332
  - docs/guide/fontconfig.md
333
+ - docs/guide/formulas.md
334
+ - docs/guide/how-it-works.md
295
335
  - docs/guide/index.md
336
+ - docs/guide/installation.md
337
+ - docs/guide/manifests.md
296
338
  - docs/guide/proxy.md
339
+ - docs/guide/quick-start.md
297
340
  - docs/guide/why.md
298
341
  - docs/index.md
342
+ - docs/lychee.toml
299
343
  - docs/package-lock.json
300
344
  - docs/package.json
301
- - docs/public/hero.png
302
- - docs/public/logo.png
303
- - docs/reference/index.md
345
+ - docs/public/apple-touch-icon.png
346
+ - docs/public/favicon-96x96.png
347
+ - docs/public/favicon.ico
348
+ - docs/public/favicon.svg
349
+ - docs/public/logo-full.svg
350
+ - docs/public/logo.svg
351
+ - docs/public/site.webmanifest
352
+ - docs/public/web-app-manifest-192x192.png
353
+ - docs/public/web-app-manifest-512x512.png
304
354
  - exe/fontist
305
355
  - fontist.gemspec
306
356
  - formula_filename_index.yml
@@ -1,54 +0,0 @@
1
- name: deploy-pages
2
-
3
- permissions:
4
- contents: read
5
-
6
- on:
7
- push:
8
- branches: "main"
9
- paths-ignore:
10
- - README.md
11
- - CONTRIBUTING.md
12
- - LICENSE
13
- - .gitignore
14
- - .github/**
15
- - "!.github/workflows/deploy-pages.yml"
16
- workflow_dispatch:
17
-
18
- concurrency:
19
- group: ${{ github.workflow }}
20
- cancel-in-progress: true
21
-
22
- jobs:
23
- deploy-pages:
24
- environment:
25
- name: github-pages
26
- url: ${{ steps.deploy-pages.outputs.page_url }}
27
- permissions:
28
- pages: write
29
- id-token: write
30
- runs-on: ubuntu-latest
31
- steps:
32
- - uses: actions/checkout@v4
33
- - uses: actions/setup-node@v4
34
- with:
35
- node-version: latest
36
- # Lockfile is in subfolder
37
- # cache: npm
38
- - uses: ruby/setup-ruby@v1
39
- with:
40
- ruby-version: ruby
41
- - run: rdoc -x docs
42
- - run: npm install
43
- working-directory: docs
44
- - id: configure-pages
45
- uses: actions/configure-pages@v4
46
- - run: npm run build
47
- working-directory: docs
48
- env:
49
- BASE_PATH: ${{ steps.configure-pages.outputs.base_path }}/
50
- - run: mv docs/.vitepress/dist _site
51
- - run: mv doc _site/reference/api-ruby
52
- - uses: actions/upload-pages-artifact@v3
53
- - id: deploy-pages
54
- uses: actions/deploy-pages@v4
@@ -1,36 +0,0 @@
1
- name: release
2
-
3
- on:
4
- workflow_dispatch:
5
- inputs:
6
- next_version:
7
- description: |
8
- Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
9
- Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
10
- required: true
11
- default: 'skip'
12
- repository_dispatch:
13
- types: [ do-release ]
14
-
15
- permissions:
16
- contents: read
17
- <<<<<<< HEAD
18
- =======
19
- packages: write
20
- <<<<<<< Updated upstream
21
- =======
22
- id-token: write
23
- >>>>>>> Stashed changes
24
- >>>>>>> 35f3c7d (fix: release gha)
25
-
26
- jobs:
27
- release:
28
- permissions:
29
- contents: write
30
- packages: write
31
- id-token: write
32
- uses: fontist/support/.github/workflows/release.yml@main
33
- with:
34
- next_version: ${{ github.event.inputs.next_version }}
35
- secrets:
36
- rubygems-api-key: ${{ secrets.FONTIST_CI_RUBYGEMS_API_KEY }}
@@ -1,189 +0,0 @@
1
- # Fontist Ruby library
2
-
3
- In addition to the command-line interface, Fontist can be used as a Ruby library.
4
-
5
- ## Fontist::Font
6
-
7
- The `Fontist::Font` is your go-to place to deal with any font using Fontist.
8
-
9
- This interface allows you to find a font or install a font.
10
-
11
- ### Finding a font
12
-
13
- The `Fontist::Font.find` interface can be used to find a font in your system.
14
-
15
- It will look into the operating system specific font directories, and also the fontist specific `~/.fontist` directory.
16
-
17
- ```ruby
18
- Fontist::Font.find(name)
19
- ```
20
-
21
- - If Fontist finds a font, then it will return the paths.
22
- - Otherwise, it will either raise an unsupported font error, or trigger display of installation instructions for that specific font.
23
-
24
- ### Install a font
25
-
26
- The `Fontist::Font.install` interface can be used to install any supported font.
27
-
28
- This interface first checks if you already have that font installed or not and if you do, then it will return the paths.
29
-
30
- If you don't have a font but that font is supported by Fontist, then it will download the font and copy it to `~/.fontist` directory and also return the paths.
31
-
32
- ```ruby
33
- Fontist::Font.install(name, confirmation: "no")
34
- ```
35
-
36
- If there are issues detected with the provided font, such as the font is not supported, those errors would be raised.
37
-
38
- ### List all fonts
39
-
40
- The `Fontist::Font` interface exposes an interface to list all supported fonts.
41
-
42
- This might be useful if you want to know the name of the font or the available styles. You can do that by using:
43
-
44
- ```ruby
45
- Fontist::Font.all
46
- ```
47
-
48
- The return values are model objects, so you can easily access their properties and perform operations on them.
49
-
50
- ## Fontist::Formula
51
-
52
- The `fontist` gem internally uses the `Fontist::Formula` interface to find a registered formula or fonts supported by any formula. Unless you need to do anything with that, you shouldn't need to work with this interface directly. But if you do, then these are the public interfaces it offers.
53
-
54
- ### Find a formula
55
-
56
- The `Fontist::Formula.find` interface allows you to find any of the registered formulas. This interface takes a font name as an argument and it looks through each of the registered formulas that offer this font installation. Usages:
57
-
58
- ```ruby
59
- Fontist::Formula.find("Calibri")
60
- ```
61
-
62
- This method will search and return a Fontist formula for the provided keyword which allows for further processing, such as license checks or proceeding with the installation of the font in your system.
63
-
64
- ### List font styles supported by a formula
65
-
66
- Normally, each font name can be associated with multiple styles or collections, for example, the `Calibri` font might contain `regular`, `bold`, or `italic` styles fonts and if you want an interface that can return the complete list then this is your friend.
67
-
68
- You can use it as following:
69
-
70
- ```ruby
71
- Fontist::Formula.find_fonts("Calibri")
72
- ```
73
-
74
- ### List all formulas
75
-
76
- The `Fontist::Formula` interface exposes an interface to list all registered font formulas. This might be useful if you want to know the name of the formula or what type of fonts can be installed using that formula. Usages:
77
-
78
- ```ruby
79
- Fontist::Formula.all
80
- ```
81
-
82
- The return values are model objects, so you can easily access their properties and perform operations on them.
83
-
84
- ## Fontist::Manifest
85
-
86
- ### Global options
87
-
88
- Fontist can be switched to use the preferred family names. This format was used prior to v1.10.
89
-
90
- ```ruby
91
- Fontist.preferred_family = true
92
- ```
93
-
94
- ### Manifest from YAML file or Hash
95
-
96
- Fontist lets you find font locations from a defined manifest Hash in the following format:
97
-
98
- ```ruby
99
- {
100
- "Segoe UI"=>["Regular", "Bold"],
101
- "Roboto Mono"=>["Regular"]
102
- }
103
- ```
104
-
105
- Calling the following code returns a nested Hash with font paths and names. Font name is useful to choose a specific font in a font collection file (TTC).
106
-
107
- ```ruby
108
- Fontist::Manifest.from_yaml(manifest)
109
- Fontist::Manifest.from_hash(manifest)
110
- ```
111
-
112
- ```ruby
113
- {
114
- "Segoe UI"=> {
115
- "Regular"=>{
116
- "full_name"=>"Segoe UI",
117
- "paths"=>["/Users/user/.fontist/fonts/SEGOEUI.TTF"]
118
- },
119
- "Bold"=>{
120
- "full_name"=>"Segoe UI Bold",
121
- "paths"=>["/Users/user/.fontist/fonts/SEGOEUIB.TTF"]
122
- }
123
- },
124
- "Roboto Mono"=> {
125
- "Regular"=>{
126
- "full_name"=>nil,
127
- "paths"=>[]
128
- }
129
- }
130
- }
131
- ```
132
-
133
- Fontist lets you not only obtain font locations but also install fonts from the manifest:
134
-
135
- ```ruby
136
- manifest.install(confirmation: "yes")
137
- ```
138
-
139
- It will install fonts and return their locations:
140
-
141
- ```ruby
142
- {
143
- "Segoe UI"=> {
144
- "Regular"=>{
145
- "full_name"=>"Segoe UI",
146
- "paths"=>["/Users/user/.fontist/fonts/SEGOEUI.TTF"]},
147
- "Bold"=>{
148
- "full_name"=>"Segoe UI Bold",
149
- "paths"=>["/Users/user/.fontist/fonts/SEGOEUIB.TTF"]
150
- }
151
- },
152
- "Roboto Mono"=> {
153
- "Regular"=>{
154
- "full_name"=>"Roboto Mono Regular",
155
- "paths"=>["/Users/user/.fontist/fonts/RobotoMono-VariableFont_wght.ttf"]
156
- }
157
- }
158
- }
159
- ```
160
-
161
- #### Support of YAML format
162
-
163
- Both commands support a YAML file as an input with a `from_file` method. For example, if there is a `manifest.yml` file containing:
164
-
165
- ```yaml
166
- ---
167
- Segoe UI:
168
- - Regular
169
- - Bold
170
- Roboto Mono:
171
- - Regular
172
- ```
173
-
174
- Then the following calls would return font names and paths, as from the `from_hash` method (see Fontist::Manifest).
175
-
176
- ```ruby
177
- manifest = Fontist::Manifest.from_file("manifest.yml")
178
- manifest.install(confirmation: "yes")
179
- ```
180
-
181
- ## Fontist::Fontconfig
182
-
183
- Fontist supports work with Fontconfig via the Ruby interface:
184
-
185
- ```ruby
186
- Fontist::Fontconfig.update # let detect fontist fonts
187
- Fontist::Fontconfig.remove # disable detection
188
- Fontist::Fontconfig.remove(force: true) # do not fail if no config exists
189
- ```
data/docs/public/hero.png DELETED
Binary file
data/docs/public/logo.png DELETED
Binary file
@@ -1,143 +0,0 @@
1
- # Fontist CLI reference
2
-
3
- <!-- This can be converted to a folder & multiple pages at any time. -->
4
-
5
- ## `fontist cache`
6
-
7
- The only subcommand available on `fontist cache` is `fontist cache clear`. It clears the `~/.fontist` cache.
8
-
9
- ```sh
10
- fontist cache clear
11
- ```
12
-
13
- ```
14
- Cache has been successfully removed.
15
- ```
16
-
17
- ## `fontist config`
18
-
19
- `fontist config` lets you edit the Fontist config file from the command line instead of opening an editor. There are four subcommands available:
20
-
21
- - `fontist config delete <key>`
22
- - `fontist config keys`
23
- - `fontist config set <key> <value>`
24
- - `fontist config show`
25
-
26
- Here's an example of these commands being used to edit the config file:
27
-
28
- ```sh
29
- fontist config keys
30
- fontist config set font_path /var/myfonts
31
- fontist config delete font_path
32
- fontist config show
33
- ```
34
-
35
- ```
36
- $ fontist config keys
37
- Available keys:
38
- fonts_path (default: /home/octocat/.fontist/fonts)
39
- open_timeout (default: 60)
40
- read_timeout (default: 60)
41
-
42
- $ fontist config set fonts_path /var/myfonts
43
- 'fonts_path' set to '/var/myfonts'.
44
-
45
- $ fontist config delete fonts_path
46
- 'fonts_path' reset to default ('/home/octocat/.fontist/fonts').
47
-
48
- $ fontist config show
49
- Config is empty.
50
- ```
51
-
52
- ### Config reference
53
-
54
- <!-- Move this into its own '/reference/config' page if this grows a lot. -->
55
-
56
- - **`fonts_path`:** Where to put the `.ttf` files. Defaults to `~/.fontist/fonts`
57
-
58
- - **`open_timeout`:** Defaults to 60.
59
-
60
- - **`read_timeout`:** Defaults to 60.
61
-
62
- ## `fontist status [font-name]`
63
-
64
- Prints the paths to a particular installed font or all fonts if the `font-name` is omitted. This searches **all fonts available on your system** even those not managed by Fontist.
65
-
66
- ```sh
67
- fontist status
68
- ```
69
-
70
- ```
71
- Fonts found at:
72
- - /usr/share/fonts/truetype/ubuntu/UbuntuMono-B.ttf
73
- - /usr/share/fonts/truetype/ubuntu/UbuntuMono-BI.ttf
74
- - /usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf
75
- - /usr/share/fonts/truetype/ubuntu/UbuntuMono-RI.ttf
76
- - /home/octocat/.fontist/fonts/Arial.ttf (from ms_truetype formula)
77
- - /home/octocat/.fontist/fonts/ArialBI.ttf (from ms_truetype formula)
78
- - /home/octocat/.fontist/fonts/ArialBd.ttf (from ms_truetype formula)
79
- - /home/octocat/.fontist/fonts/ArialI.ttf (from ms_truetype formula)
80
- ```
81
-
82
- Here's an example narrowed to a specific font:
83
-
84
- ```sh
85
- fontist status "Open Sans"
86
- ```
87
-
88
- ```
89
- Fonts found at:
90
- - /home/octocat/.fontist/fonts/OpenSans-Bold.ttf (from open_sans formula)
91
- - /home/octocat/.fontist/fonts/OpenSans-BoldItalic.ttf (from open_sans formula)
92
- - /home/octocat/.fontist/fonts/OpenSans-Italic.ttf (from open_sans formula)
93
- - /home/octocat/.fontist/fonts/OpenSans-Regular.ttf (from open_sans formula)
94
- ```
95
-
96
- ## `fontist list [font-name]`
97
-
98
- Lists the installation status of `font-name` or all fonts if no font name provided.
99
-
100
- ```sh
101
- fontist status
102
- ```
103
-
104
- ```
105
- Fonts found at:
106
- - /usr/share/fonts/truetype/ubuntu/UbuntuMono-B.ttf
107
- - /usr/share/fonts/truetype/ubuntu/UbuntuMono-BI.ttf
108
- - /usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf
109
- - /usr/share/fonts/truetype/ubuntu/UbuntuMono-RI.ttf
110
- - /home/octocat/.fontist/fonts/Arial.ttf (from ms_truetype formula)
111
- - /home/octocat/.fontist/fonts/ArialBI.ttf (from ms_truetype formula)
112
- - /home/octocat/.fontist/fonts/ArialBd.ttf (from ms_truetype formula)
113
- - /home/octocat/.fontist/fonts/ArialI.ttf (from ms_truetype formula)
114
- ```
115
-
116
- Here's an example getting the status of a specific font:
117
-
118
- ```sh
119
- fontist status "Fira Mono"
120
- ```
121
-
122
- ```
123
- Font "Fira Mono" not found locally.
124
- 'Fira Mono' font is missing, please run `fontist install 'Fira Mono'` to download the font.
125
- ```
126
-
127
- ## Environment variables
128
-
129
- ### `FONTIST_PATH`
130
-
131
- By default Fontist uses the `~/.fontist` directory to store fonts and its files. It can be changed with the `FONTIST_PATH` environment variable.
132
-
133
- ```sh
134
- FONTIST_PATH=/var/fontist2 fontist update
135
- ```
136
-
137
- ## Excluded fonts
138
-
139
- `fontist` excludes some fonts from usage when they break other software:
140
-
141
- - `NISC18030.ttf` (GB18030 Bitmap) - macOS [fontist/fontist#344](https://github.com/fontist/fontist/issues/344)
142
-
143
- [📑 View the up-to-date list of known problematic fonts on GitHub](https://github.com/fontist/fontist/blob/main/lib/fontist/exclude.yml)