fontist 1.13.1 → 1.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f376e0b45e530b28be9d60c132b3840d4485103995fc435c0512b07bf6e20435
4
- data.tar.gz: b8c8aa1f3de0b627bcaffe09b45398dd60a0ba2a3a2163599263461acb179292
3
+ metadata.gz: bc5e7576ced5478fb9dc9752a5aa7f514491f112d5bb66b12f86f82b3d8a2f99
4
+ data.tar.gz: 123b39db27bb75fcbd120caae26adb60a7f9f39e9eabd06613ee50c98adde004
5
5
  SHA512:
6
- metadata.gz: 157c06d56119a5e94a7a15b33b7b1e65695eb94af595f618bbbcf382f8d201d8db7f1a51ed2e3b20cf56d0339a7bd33dc2be82900de1851e29ee31225d2f8054
7
- data.tar.gz: 3fabd78041974540dc3504c293e335cfd39d241c5cd80da8fd0eef2b6b0a0e6a49701baf4c13e4c151ff397c8aaa6d9d542b37a45b52610ca404bb0abcef004a
6
+ metadata.gz: '08091fefee390b3b349d6f7ccd7ac7bb921274c778f91452e05d19f56eac0399604db310aba1ea59fcfa7eafb1c1945aaa6d5454c1141850a7931fa6c44fd9b2'
7
+ data.tar.gz: d086b630b7d5e32435215d2498b023a3de3238f69c143436e09d0112860c14112167e9dcaa11e8fc1870affb5b63a53b46b9d5a236d00394ec7eeeb6b587e8af
@@ -13,7 +13,7 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby: [ '2.5', '2.6', '2.7', '3.0' ]
16
+ ruby: [ '2.6', '2.7', '3.0' ]
17
17
  os: [ ubuntu-latest, windows-latest, macos-latest ]
18
18
  experimental: [ true ]
19
19
  steps:
@@ -32,4 +32,6 @@ jobs:
32
32
  ruby-version: ${{ matrix.ruby }}
33
33
  bundler-cache: true
34
34
 
35
+ - uses: metanorma/metanorma-build-scripts/inkscape-setup-action@main
36
+
35
37
  - run: bundle exec rake
data/README.adoc CHANGED
@@ -51,71 +51,70 @@ has the following requirements:
51
51
 
52
52
  These dependencies are generally present on all systems.
53
53
 
54
- === Upgrading Fontist
55
-
56
- ==== To v1.10+
57
-
58
- Fontist versions beyond v1.10 utilize a new formula format.
59
- After the upgrade, please run `fontist update` to fetch the latest formulas.
60
-
61
- Starting from v1.10, Fontist uses the "`default family`" instead of the "`preferred family`"
62
- when grouping styles.
63
-
64
- For example, a request for the "`Lato`" font prior to v1.10 will return all
65
- styles: "`Black`", "`Black Italic`", "`Bold`", and 15 other styles.
66
-
67
- From v1.10 onwards, Fontist will return _only_ the 4 default styles:
68
- "`Regular`", "`Italic`", "`Bold`" and "`Bold Italic`".
69
-
70
- In order to fetch other styles, you have to specify the exact font
71
- "`subfamily`", such as "`Lato Black`", or "`Lato Heavy`", or use
72
- the `--preferred-family` option with CLI and `Fontist.preferred_family = true`
73
- with the Ruby library.
74
-
75
- NOTE: Prior to v1.10 there was a bug with the "`Courier`" font formula, which
76
- allowed the font to be installed when requesting the font name "`Courier`", but
77
- its font location was only obtainable using the full "`Courier New`" font name.
78
- From v1.10 onwards the behavior has been made consistent -- only the proper
79
- "`Courier New`" name should be used.
80
54
 
55
+ == Usage of the Fontist command-line interface
81
56
 
82
- == Usage of the `fontist` command
83
-
84
- === Fontist command-line interface
57
+ === The `fontist` command
85
58
 
86
59
  These commands makes possible to operate with fonts via command line.
87
60
 
88
61
  The CLI properly supports exit status, so in a case of error it returns a status
89
- code higher or equal than 1.
62
+ code higher or equal than `1`.
63
+
64
+ Searches are case-insensitive for ease of use.
90
65
 
91
- All searches are case-insensitive for ease of use.
66
+ All commands support the following global options:
92
67
 
93
- === Global options
68
+ `--preferred-family`:: Search using the "`preferred family`" name of a font.
69
+ (instead of the "`default family`" name, the default prior to Fontist v1.10.)
94
70
 
95
- All commands support the following options:
71
+ NOTE: See <<preferred-family-change>> for the differences between
72
+ "`preferred family`" and "`default family`".
96
73
 
97
- * `--preferred-family` Use the preferred family names when searching for fonts. This format was used prior to v1.10.
98
74
 
99
- === Install fonts
75
+ === Install fonts: `fontist install`
100
76
 
101
77
  Fontist checks whether this font is already installed, and if not, then installs
102
78
  the font and returns its installed paths.
103
79
 
104
- The font name is the only argument to be supplied (the font family name).
80
+ The font name is the only argument to be supplied.
105
81
 
106
82
  [source,sh]
107
83
  ----
108
84
  $ fontist install "segoe ui"
109
85
  These fonts are found or installed:
110
- /Users/user/.fontist/fonts/SEGOEUI.TTF
111
- /Users/user/.fontist/fonts/SEGOEUIB.TTF
112
- /Users/user/.fontist/fonts/SEGOEUII.TTF
113
- /Users/user/.fontist/fonts/SEGOEUIZ.TTF
86
+ - /Users/user/.fontist/fonts/SEGOEUI.TTF
87
+ - /Users/user/.fontist/fonts/SEGOEUIB.TTF
88
+ - /Users/user/.fontist/fonts/SEGOEUII.TTF
89
+ - /Users/user/.fontist/fonts/SEGOEUIZ.TTF
114
90
  ----
115
91
 
116
- NOTE: Specifying the formula's name or the font's filename is not supported.
92
+ By default, all matching styles (according to the font's "`default family`" name)
93
+ are installed.
117
94
 
118
- NOTE: The `install` command is similar to the `Font.install` library call.
95
+ NOTE: Prior to v1.10, the font's "`preferred family`" name is used to match
96
+ styles for search. See <<preferred-family-change>> for details of that change.
97
+
98
+ To install all fonts specified in a Fontist formula, use the `-F, --formula`
99
+ option.
100
+
101
+ [source,sh]
102
+ ----
103
+ $ fontist install --formula 'courier_prime'
104
+ Downloading font ...
105
+ Installing font "courier_prime".
106
+ Fonts installed at:
107
+ - /Users/user/.fontist/fonts/Courier Prime Bold Italic.ttf
108
+ - /Users/user/.fontist/fonts/Courier Prime Bold.ttf
109
+ - /Users/user/.fontist/fonts/Courier Prime Italic.ttf
110
+ - /Users/user/.fontist/fonts/Courier Prime.ttf
111
+ ----
112
+
113
+ Here, `courier_prime` is the filename of the formula located at the public
114
+ Fontist Formula repository
115
+ (https://github.com/fontist/formulas/blob/v3/Formulas/courier_prime.yml[`courier_prime.yml`]).
116
+
117
+ NOTE: Specifying the formula's name or the font's filename is not supported.
119
118
 
120
119
  If there are several formulas with a requested font, then `fontist` searches
121
120
  for the newest version of the font among formulas with size below a limit
@@ -126,17 +125,23 @@ available formulas would be installed.
126
125
 
127
126
  Supported options:
128
127
 
129
- -f, [--force]:: Install even if it's already installed in system
130
- -a, [--accept-all-licenses]:: Accept all license agreements
131
- -h, [--hide-licenses]:: Hide license texts
132
- -p, [--no-progress]:: Hide download progress
133
- -V, [--version=VERSION]:: Install particular version of a font
134
- -s, [--smallest]:: Install the smallest formula
135
- -n, [--newest]:: Install the newest version of a font
136
- -S, [--size-limit=N]:: Specify size limit for a formula to be installed
128
+ `-f, [--force]`:: Install even if already installed in system
129
+ `-F, [--formula]`:: Install whole formula instead of a font
130
+ `-a, [--accept-all-licenses]`:: Accept all license agreements
131
+ `-h, [--hide-licenses]`:: Hide license texts
132
+ `-p, [--no-progress]`:: Hide download progress
133
+ `-V, [--version=VERSION]`:: Install particular version of a font
134
+ `-s, [--smallest]`:: Install the smallest font by file size if several
135
+ `-n, [--newest]`:: Install the newest version of a font if several
136
+ `-S, [--size-limit=N]`:: Specify upper limit for file size of a formula to be installed
137
137
  (default is 300 MB)
138
+ `-u, [--update-fontconfig]`:: Update Fontconfig
139
+
140
+
141
+ NOTE: The `install` command is similar to the `Font.install` library call.
138
142
 
139
- === Uninstall fonts
143
+
144
+ === Uninstall fonts: `fontist uninstall`
140
145
 
141
146
  Uninstalls any font supported by Fontist.
142
147
 
@@ -153,22 +158,21 @@ These fonts are removed:
153
158
  /Users/user/.fontist/fonts/SEGOEUI.TTF
154
159
  ----
155
160
 
156
- === Status
161
+ === Status: `fontist status`
157
162
 
158
- Prints installed font paths grouped by formula and font.
163
+ Prints installed font paths with a corresponding formula.
159
164
 
160
165
  [source,sh]
161
166
  ----
162
167
  $ fontist status "segoe ui"
163
- segoe_ui
164
- Segoe UI
165
- Regular (/Users/user/.fontist/fonts/SEGOEUI.TTF)
166
- Bold (/Users/user/.fontist/fonts/SEGOEUIB.TTF)
167
- Italic (/Users/user/.fontist/fonts/SEGOEUII.TTF)
168
- Bold Italic (/Users/user/.fontist/fonts/SEGOEUIZ.TTF)
168
+ Fonts found at:
169
+ - /Users/user/.fontist/fonts/SEGOEUII.TTF (from segoe_ui formula)
170
+ - /Users/user/.fontist/fonts/SEGOEUIZ.TTF (from segoe_ui formula)
171
+ - /Users/user/.fontist/fonts/SEGOEUIB.TTF (from segoe_ui formula)
172
+ - /Users/user/.fontist/fonts/SEGOEUI.TTF (from segoe_ui formula)
169
173
  ----
170
174
 
171
- === List
175
+ === List: `fontist list`
172
176
 
173
177
  Lists installation status of fonts supported by Fontist.
174
178
 
@@ -192,7 +196,7 @@ google/roboto_mono
192
196
  Italic (uninstalled)
193
197
  ----
194
198
 
195
- === List installed font paths
199
+ === List installed font paths: `fontist manifest-locations`
196
200
 
197
201
  Returns locations of fonts specified in a YAML file as an input.
198
202
 
@@ -237,13 +241,23 @@ Segoe UI:
237
241
  - "/Users/user/.fontist/fonts/SEGOEUIB.TTF"
238
242
  Roboto Mono:
239
243
  Regular:
240
- full_name:
241
- paths: []
244
+ full_name: Roboto Mono Regular
245
+ paths:
246
+ - "/Users/user/.fontist/fonts/RobotoMono-VariableFont_wght.ttf"
242
247
  ----
243
248
 
244
- Since "`Segoe UI`" is installed, but "`Roboto Mono`" is not.
249
+ If one or more of requested fonts are missing, the "3" error code would be
250
+ returned, and a message printed:
245
251
 
246
- === Install fonts from manifest
252
+ [source,sh]
253
+ ----
254
+ $ fontist manifest-locations manifest.yml
255
+ 'Roboto Mono' 'Regular' font is missing, please run `fontist install 'Roboto Mono'` to download the font.
256
+ $ echo $?
257
+ 3
258
+ ----
259
+
260
+ === Install fonts from manifest: `fontist manifest-install`
247
261
 
248
262
  Install fonts from a YAML Fontist manifest:
249
263
 
@@ -273,7 +287,31 @@ Roboto Mono:
273
287
  - "/Users/user/.fontist/fonts/RobotoMono-VariableFont_wght.ttf"
274
288
  ----
275
289
 
276
- === Help
290
+ === Work with Fontconfig: `fontist fontconfig`
291
+
292
+ Fontconfig is a software designed to provide fonts to other programs. It is
293
+ typically used on Linux, but also available on macOS and Windows. Fontconfig is
294
+ used by LibreOffice, GIMP, and many other programs.
295
+
296
+ It order to find fontist fonts, Fontconfig should be updated to include fontist
297
+ paths. It can be done with the `--update-fontconfig` option of the `install`
298
+ command, or by calling a special one:
299
+
300
+ [source,sh]
301
+ ----
302
+ $ fontist fontconfig update
303
+ ----
304
+
305
+ It would create a config in `~/.config/fontconfig/conf.d/10-fontist.conf`.
306
+
307
+ To remove it, please use:
308
+
309
+ [source,sh]
310
+ ----
311
+ $ fontist fontconfig remove
312
+ ----
313
+
314
+ === Help: `fontist help`
277
315
 
278
316
  List of all commands could be seen by:
279
317
 
@@ -371,7 +409,7 @@ Fontist::Formula.find("Calibri")
371
409
  ----
372
410
 
373
411
  This method will search and return a Fontist formula for the provided keyword
374
- which allows for further processing, such as licence checks or proceeding with
412
+ which allows for further processing, such as license checks or proceeding with
375
413
  installation of the font in your system.
376
414
 
377
415
  ==== List font styles supported by a formula
@@ -516,7 +554,36 @@ Fontist::Manifest::Locations.from_file("manifest.yml")
516
554
  Fontist::Manifest::Install.from_file("manifest.yml", confirmation: "yes")
517
555
  ----
518
556
 
519
- == Using Fontist with proxies
557
+ === `Fontist::Fontconfig`
558
+
559
+ Fontist supports work with Fontconfig via the Ruby interface:
560
+
561
+ [source,ruby]
562
+ ----
563
+ Fontist::Fontconfig.update # let detect fontist fonts
564
+ Fontist::Fontconfig.remove # disable detection
565
+ Fontist::Fontconfig.remove(force: true) # do not fail if no config exists
566
+ ----
567
+
568
+ == Installing macOS-specific add-on fonts
569
+
570
+ The purpose of Fontist allowing macOS-specific add-on fonts is to allow CI jobs
571
+ on macOS environments to use these specially licensed fonts that are not
572
+ available on other platforms.
573
+
574
+ The "Canela" font is a commercial font that comes free with macOS.
575
+
576
+ Run this command to install Canela on macOS.
577
+
578
+ [source,sh]
579
+ ----
580
+ $ fontist install Canela
581
+ ----
582
+
583
+ WARNING: Fontist does not allow installing macOS-specific fonts on non-macOS
584
+ platforms due to font licensing of those fonts.
585
+
586
+ == Using Fontist with proxy servers
520
587
 
521
588
  Fontist uses Git internally for fetching formulas and fonts.
522
589
 
@@ -575,38 +642,124 @@ https://github.com/evantoli[evantoli]).
575
642
 
576
643
  == Authoring Fontist formulas
577
644
 
578
- === Creating a Fontist formula from a font archive
645
+ === Private Fontist formulas and font repositories
579
646
 
580
- A formula could be generated from a fonts archive. Just specify a URL to the
581
- archive:
647
+ Fontist supports installing private fonts via private Fontist repositories.
648
+
649
+ A Fontist repository is a Git repo which contains YAML Formula files.
650
+ Formulas can be created manually
651
+ (see https://github.com/fontist/formulas/tree/master/Formulas[examples]),
652
+ or <<create-formula,auto-generated from an archive>>.
653
+
654
+ A repository can be either a HTTPS or SSH Git repo. In case of SSH, a
655
+ corresponding SSH key should be setup with `ssh-agent` in order to access this
656
+ private repository.
657
+
658
+ The `fontist repo setup` command fetches a repository's formulas, and saves the
659
+ repository's name and URL for later use.
660
+
661
+ Internally, all repositories are stored at
662
+ `~/.fontist/formulas/Formulas/private`.
582
663
 
583
664
  [source,sh]
584
665
  ----
585
- fontist create-formula https://www.latofonts.com/download/lato2ofl-zip/
586
- cp lato.yml ~/.fontist/formulas/Formulas/
666
+ fontist repo setup NAME URL
667
+ ----
668
+
669
+ E.g.
670
+
671
+ [source,sh]
672
+ ----
673
+ fontist repo setup acme https://example.com/acme/formulas.git
674
+ # or
675
+ fontist repo setup acme git@example.com:acme/formulas.git
587
676
  ----
588
677
 
589
- Though indexes are auto-generated now, maintainers should rebuild indexes in the
590
- main repo for backward compatibility with Fontist versinos prior to 1.9.x.
678
+ Then you can just install fonts from this repo:
591
679
 
592
- A formula index should be rebuilt when a new formula is generated or an existing
593
- one changed:
680
+ [source,sh]
681
+ ----
682
+ fontist install "private font"
683
+ ----
684
+
685
+ If the private Fontist formula repository is updated, you can fetch the updates
686
+ with the `repo update` command:
594
687
 
595
688
  [source,sh]
596
689
  ----
597
- fontist rebuild-index --main-repo
690
+ fontist repo update acme
598
691
  ----
599
692
 
600
- Then, both the formula and the updated indexes should be committed and pushed to
601
- the formula repository:
693
+ If there is a need to avoid using private formulas, the repo can be removed
694
+ with:
695
+
696
+ [source,sh]
697
+ ----
698
+ fontist repo remove acme
699
+ ----
700
+
701
+ [[create-formula]]
702
+ === Auto-generate a Fontist formula from a font archive
703
+
704
+ A formula could be generated from a fonts archive. Just specify a URL to the
705
+ archive:
602
706
 
603
707
  [source,sh]
604
708
  ----
605
- cd ~/.fontist/formulas
606
- git add Formulas/lato.yml index.yml filename_index.yml
607
- git commit -m "Add Lato formula"
709
+ fontist create-formula https://www.latofonts.com/download/lato2ofl-zip/
710
+ cp lato.yml ~/.fontist/formulas/Formulas/
711
+ ----
712
+
713
+ === Authentication for private formulas or private formula repositories
714
+
715
+ Authorization of private archives in private formulas can be implemented with
716
+ headers.
717
+
718
+ Here is an example which works with Github releases:
719
+
720
+ [source,yaml]
721
+ ----
722
+ resources:
723
+ fonts.zip:
724
+ urls:
725
+ - url: https://example.com/repos/acme/formulas/releases/assets/38777461
726
+ headers:
727
+ Accept: application/octet-stream
728
+ Authorization: token ghp_1234567890abcdefghi
608
729
  ----
609
730
 
731
+ A token can be obtained on the
732
+ https://github.com/settings/tokens[GitHub Settings > Tokens page].
733
+ This token should have at least the `repo` scope for access to these assets.
734
+
735
+
736
+ === Upgrading Fontist
737
+
738
+ [[preferred-family-change]]
739
+ ==== To v1.10+
740
+
741
+ Fontist versions beyond v1.10 utilize a new formula format.
742
+ After the upgrade, please run `fontist update` to fetch the latest formulas.
743
+
744
+ Starting from v1.10, Fontist uses the "`default family`" instead of the
745
+ "`preferred family`" when grouping styles.
746
+
747
+ For example, a request for the "`Lato`" font prior to v1.10 will return all
748
+ styles: "`Black`", "`Black Italic`", "`Bold`", and 15 other styles.
749
+
750
+ From v1.10 onwards, Fontist will return _only_ the 4 default styles:
751
+ "`Regular`", "`Italic`", "`Bold`" and "`Bold Italic`".
752
+
753
+ In order to fetch other styles, you have to specify the exact font
754
+ "`subfamily`", such as "`Lato Black`", or "`Lato Heavy`", or use
755
+ the `--preferred-family` option with CLI and `Fontist.preferred_family = true`
756
+ with the Ruby library.
757
+
758
+ NOTE: Prior to v1.10 there was a bug with the "`Courier`" font formula, which
759
+ allowed the font to be installed when requesting the font name "`Courier`", but
760
+ its font location was only obtainable using the full "`Courier New`" font name.
761
+ From v1.10 onwards the behavior has been made consistent -- only the proper
762
+ "`Courier New`" name should be used.
610
763
 
611
764
 
612
765
 
@@ -619,29 +772,13 @@ WARNING: This section is only for Fontist maintainers.
619
772
  https://fonts.google.com[Google Fonts] provides probably the largest collection
620
773
  of widely-used, freely and openly licensed fonts.
621
774
 
622
- Fontist's https://github.com/fonitist/formula[formula library] includes support
775
+ Fontist's https://github.com/fontist/formulas[formula library] includes support
623
776
  for all openly-licensed fonts provided through Google Fonts, and maintains
624
777
  Fontist formulas for all such fonts.
625
778
 
626
- A GHA workflow checks for updated fonts on Google Fonts daily.
627
-
628
- In case an update is found, it could be fetched to the library by:
629
-
630
- [source,sh]
631
- ----
632
- bin/fontist google import
633
- ----
634
-
635
- The script would update formulas which should be committed to a separate
636
- repository https://github.com/fontist/formulas[formulas]:
637
-
638
- [source,sh]
639
- ----
640
- cd ~/.fontist/versions/{last_version}/formulas
641
- git add Formulas/google
642
- git commit -m "Google Fonts update"
643
- git push
644
- ----
779
+ https://github.com/fontist/formulas/blob/v3/.github/workflows/google.yml[A GHA
780
+ workflow] checks for updated fonts on Google Fonts daily. In case an update is
781
+ found, it's added to the repo by the workflow.
645
782
 
646
783
  === Dynamically importing formulas from SIL
647
784
 
@@ -658,7 +795,7 @@ They can be updated with:
658
795
 
659
796
  [source,sh]
660
797
  ----
661
- fontist import-sil
798
+ fontist import sil
662
799
  cd ~/.fontist/versions/{last_version}/formulas
663
800
  git add Formulas/sil
664
801
  git commit -m "SIL fonts update"
@@ -668,35 +805,19 @@ git push
668
805
  === Dynamically importing formulas from macOS
669
806
 
670
807
  macOS provides https://support.apple.com/en-om/HT211240#download[fonts] which
671
- can be manually downloaded with the Font Book app. When such font is requested,
672
- fontist prints information on how to install it.
808
+ can be manually downloaded with `Font Book.app`.
673
809
 
674
- In order to know which fonts are available in a current version of macOS,
675
- for each version there is a formula containing all supported fonts.
676
-
677
- A new formula can be generated with:
810
+ To update macOS formulas:
678
811
 
679
812
  [source,sh]
680
813
  ----
681
- fontist import macos --name "Big Sur" --fonts-link "https://support.apple.com/en-om/HT211240#download"
814
+ fontist import macos
682
815
  cd ~/.fontist/versions/{last_version}/formulas
683
816
  git add Formulas/macos
684
- git commit -m "Add Big Sur macOS formula"
817
+ git commit -m "Update macOS formulas"
685
818
  git push
686
819
  ----
687
820
 
688
- Here `--fonts-link` is a link to a page containing a list of available fonts
689
- in the Font Book app.
690
-
691
- If the import is run on a different version of macOS, then a proper version
692
- should be set in the `platforms` attribute of the generated formula:
693
-
694
- [source,yaml]
695
- ----
696
- platforms:
697
- - macos-20
698
- ----
699
-
700
821
 
701
822
  == Development
702
823
 
@@ -731,82 +852,6 @@ https://github.com/fontist/formulas[formulas] repository.
731
852
  If you'd like to add a new formula repository or change settings for an existing
732
853
  one, please refer to its documentation.
733
854
 
734
- === Private Fontist formulas and font repositories
735
-
736
- There is an ability to use private fonts via private Fontist repositories.
737
-
738
- A Fontist repository is a Git repo which contains YAML formula files. Formulas can be created
739
- manually (see https://github.com/fontist/formulas/tree/master/Formulas[examples]),
740
- or xref:Authoring Fontist formulas[auto-generated from an archive].
741
-
742
- A repository can be either a HTTPS or SSH Git repo. In case of SSH, a
743
- corresponding SSH key should be setup with `ssh-agent` in order to access this
744
- private repository.
745
-
746
- The `fontist repo setup` command fetches a repository's formulas, and saves the
747
- repository's name and URL for later use.
748
-
749
- Internally, all repositories are stored at
750
- `~/.fontist/formulas/Formulas/private`.
751
-
752
- [source,sh]
753
- ----
754
- fontist repo setup NAME URL
755
- ----
756
-
757
- E.g.
758
-
759
- [source,sh]
760
- ----
761
- fontist repo setup acme https://example.com/acme/formulas.git
762
- # or
763
- fontist repo setup acme git@example.com:acme/formulas.git
764
- ----
765
-
766
- Then you can just install fonts from this repo:
767
-
768
- [source,sh]
769
- ----
770
- fontist install "private font"
771
- ----
772
-
773
- If the private Fontist formula repository is updated, you can fetch the updates
774
- with the `repo update` command:
775
-
776
- [source,sh]
777
- ----
778
- fontist repo update acme
779
- ----
780
-
781
- If there is a need to avoid using private formulas, the repo can be removed
782
- with:
783
-
784
- [source,sh]
785
- ----
786
- fontist repo remove acme
787
- ----
788
-
789
- === Private formulas
790
-
791
- Authorization of private archives in private formulas can be implemented with
792
- headers.
793
-
794
- Here is an example which works with Github releases:
795
-
796
- [source,yaml]
797
- ----
798
- resources:
799
- fonts.zip:
800
- urls:
801
- - url: https://example.com/repos/acme/formulas/releases/assets/38777461
802
- headers:
803
- Accept: application/octet-stream
804
- Authorization: token ghp_1234567890abcdefghi
805
- ----
806
-
807
- A token can be obtained on the
808
- https://github.com/settings/tokens[GitHub Settings > Tokens page].
809
- This token should have at least the `repo` scope for access to these assets.
810
855
 
811
856
  === Releasing
812
857
 
data/fontist.gemspec CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_runtime_dependency "down", "~> 5.0"
31
31
  spec.add_runtime_dependency "extract_ttc", "~> 0.1"
32
32
  spec.add_runtime_dependency "nokogiri", "~> 1.0"
33
+ spec.add_runtime_dependency "mime-types", "~> 3.0"
33
34
  spec.add_runtime_dependency "sys-uname", "~> 1.2"
34
35
  spec.add_runtime_dependency "thor", "~> 1.0.1"
35
36
  spec.add_runtime_dependency "git", "~> 1.0"
@@ -0,0 +1,14 @@
1
+ module Fontist
2
+ class CLI < Thor
3
+ module ClassOptions
4
+ def handle_class_options(options)
5
+ Fontist.preferred_family = options[:preferred_family]
6
+ Fontist.log_level = options[:quiet] ? :fatal : :info
7
+
8
+ if options[:formulas_path]
9
+ Fontist.formulas_path = Pathname.new(options[:formulas_path])
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end