fontist 2.1.2 → 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 (80) 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/.github/workflows/rake-metanorma.yaml +21 -3
  5. data/.github/workflows/release.yml +2 -0
  6. data/.gitignore +9 -7
  7. data/README.adoc +100 -0
  8. data/docs/.vitepress/config.ts +153 -32
  9. data/docs/.vitepress/data/cli-commands.json +461 -0
  10. data/docs/.vitepress/data/exit-codes.json +21 -0
  11. data/docs/.vitepress/data/features.json +44 -0
  12. data/docs/.vitepress/theme/components/HeroCodeBlock.vue +98 -0
  13. data/docs/.vitepress/theme/components/WithinHero.vue +30 -0
  14. data/docs/.vitepress/theme/index.ts +12 -0
  15. data/docs/.vitepress/theme/style.css +152 -0
  16. data/docs/api/errors.md +211 -0
  17. data/docs/api/font.md +101 -0
  18. data/docs/api/fontconfig.md +82 -0
  19. data/docs/api/formula.md +103 -0
  20. data/docs/api/index.md +49 -0
  21. data/docs/api/manifest.md +209 -0
  22. data/docs/cli/cache.md +100 -0
  23. data/docs/cli/config.md +123 -0
  24. data/docs/cli/create-formula.md +65 -0
  25. data/docs/cli/exit-codes.md +73 -0
  26. data/docs/cli/fontconfig.md +85 -0
  27. data/docs/cli/import.md +136 -0
  28. data/docs/cli/index-cmd.md +37 -0
  29. data/docs/cli/index.md +80 -0
  30. data/docs/cli/install.md +52 -0
  31. data/docs/cli/list.md +39 -0
  32. data/docs/cli/manifest.md +110 -0
  33. data/docs/cli/repo.md +142 -0
  34. data/docs/cli/status.md +39 -0
  35. data/docs/cli/uninstall.md +34 -0
  36. data/docs/cli/update.md +31 -0
  37. data/docs/cli/version.md +38 -0
  38. data/docs/components/CliCommand.vue +77 -0
  39. data/docs/components/CliExamples.vue +17 -0
  40. data/docs/components/CliOptions.vue +26 -0
  41. data/docs/components/ExitCodes.vue +18 -0
  42. data/docs/guide/ci.md +4 -0
  43. data/docs/guide/concepts/fonts.md +158 -0
  44. data/docs/guide/concepts/formats.md +234 -0
  45. data/docs/guide/concepts/index.md +109 -0
  46. data/docs/guide/concepts/licenses.md +236 -0
  47. data/docs/guide/concepts/requirements.md +388 -0
  48. data/docs/guide/concepts/variable-fonts.md +212 -0
  49. data/docs/guide/formulas.md +192 -0
  50. data/docs/guide/how-it-works.md +428 -0
  51. data/docs/guide/index.md +26 -47
  52. data/docs/guide/installation.md +105 -0
  53. data/docs/guide/manifests.md +132 -0
  54. data/docs/guide/quick-start.md +76 -0
  55. data/docs/guide/why.md +4 -0
  56. data/docs/index.md +55 -23
  57. data/docs/lychee.toml +33 -0
  58. data/docs/package-lock.json +1539 -770
  59. data/docs/package.json +4 -6
  60. data/docs/public/apple-touch-icon.png +0 -0
  61. data/docs/public/favicon-96x96.png +0 -0
  62. data/docs/public/favicon.ico +0 -0
  63. data/docs/public/favicon.svg +1 -0
  64. data/docs/public/logo-full.svg +1 -0
  65. data/docs/public/logo.svg +1 -0
  66. data/docs/public/site.webmanifest +21 -0
  67. data/docs/public/web-app-manifest-192x192.png +0 -0
  68. data/docs/public/web-app-manifest-512x512.png +0 -0
  69. data/lib/fontist/cli.rb +0 -1
  70. data/lib/fontist/font_file.rb +65 -14
  71. data/lib/fontist/indexes/index_mixin.rb +109 -20
  72. data/lib/fontist/system_index.rb +30 -1
  73. data/lib/fontist/version.rb +1 -1
  74. metadata +59 -8
  75. data/.github/workflows/deploy-pages.yml +0 -54
  76. data/docs/guide/api-ruby.md +0 -189
  77. data/docs/public/hero.png +0 -0
  78. data/docs/public/logo.png +0 -0
  79. data/docs/reference/index.md +0 -143
  80. /data/{docs/google-fonts-multi-format-usage.md → google-fonts-multi-format-usage.md} +0 -0
@@ -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)