fontist 1.13.2 → 1.14.2

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: 2e0bff9ea15b251c5c03206705574e12cfc9fc4bc779d197d73d20a05977e745
4
- data.tar.gz: 33a6538507cc014c1fd4a0b1b11fa908560ae8319e9de13d33120c02a86953b4
3
+ metadata.gz: 0abf896ec5729e97a87970e63ada78682dfcf659275db957a61ee7330dc0330a
4
+ data.tar.gz: c9318ca81a41ea2431ab31fa99c19c75ca5b37664afb2e622865ff0ad9696131
5
5
  SHA512:
6
- metadata.gz: bf17d3b2dd7a687f97db3bd24200d0bd07821bab47ac0c0ce8eeb1156ec1fc95b39660dfb75e6eb13e00080968de1168c83cca7d54caee0c09139d0a167651d6
7
- data.tar.gz: 18b6c0294686dcf739b2d1654b8c3e8488d823cb2de1d62659f834c7f8ca443615170d29f3f3bb2b705b27b07cb8a79d80ca6a185d09979c8c0f2f37f8af547f
6
+ metadata.gz: 4f2d4ccfda0cca24dd812bc4f7a2146f0a6a98ab9d8296743f9a79e67fae4b362d283862bf3b79167a90469ea8d4114bd45cceeb10b63f0e4ea6ffdae5c686a6
7
+ data.tar.gz: 9d024da7976bb5cf3a14ad46869b623ba0c74f2d53b6b12b9abb17cc2958e9cb7885fc2a3234cba371771192c7d902214c2a001453b0f32be837583bc342526f
@@ -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:
@@ -27,9 +27,19 @@ jobs:
27
27
 
28
28
  - run: 'echo ''gem "fontist", path: "./fontist"'' > Gemfile.devel'
29
29
 
30
- - uses: ruby/setup-ruby@v1
30
+ - if: matrix.ruby == '3.0'
31
+ uses: ruby/setup-ruby@v1
31
32
  with:
32
33
  ruby-version: ${{ matrix.ruby }}
33
34
  bundler-cache: true
35
+ rubygems: latest
36
+
37
+ - if: matrix.ruby != '3.0'
38
+ uses: ruby/setup-ruby@v1
39
+ with:
40
+ ruby-version: ${{ matrix.ruby }}
41
+ bundler-cache: true
42
+
43
+ - uses: metanorma/metanorma-build-scripts/inkscape-setup-action@main
34
44
 
35
45
  - 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,18 +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
- -F, [--formula]:: Install by formula instead of font
131
- -a, [--accept-all-licenses]:: Accept all license agreements
132
- -h, [--hide-licenses]:: Hide license texts
133
- -p, [--no-progress]:: Hide download progress
134
- -V, [--version=VERSION]:: Install particular version of a font
135
- -s, [--smallest]:: Install the smallest formula
136
- -n, [--newest]:: Install the newest version of a font
137
- -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
138
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.
139
142
 
140
- === Uninstall fonts
143
+
144
+ === Uninstall fonts: `fontist uninstall`
141
145
 
142
146
  Uninstalls any font supported by Fontist.
143
147
 
@@ -154,22 +158,21 @@ These fonts are removed:
154
158
  /Users/user/.fontist/fonts/SEGOEUI.TTF
155
159
  ----
156
160
 
157
- === Status
161
+ === Status: `fontist status`
158
162
 
159
- Prints installed font paths grouped by formula and font.
163
+ Prints installed font paths with a corresponding formula.
160
164
 
161
165
  [source,sh]
162
166
  ----
163
167
  $ fontist status "segoe ui"
164
- segoe_ui
165
- Segoe UI
166
- Regular (/Users/user/.fontist/fonts/SEGOEUI.TTF)
167
- Bold (/Users/user/.fontist/fonts/SEGOEUIB.TTF)
168
- Italic (/Users/user/.fontist/fonts/SEGOEUII.TTF)
169
- 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)
170
173
  ----
171
174
 
172
- === List
175
+ === List: `fontist list`
173
176
 
174
177
  Lists installation status of fonts supported by Fontist.
175
178
 
@@ -193,7 +196,7 @@ google/roboto_mono
193
196
  Italic (uninstalled)
194
197
  ----
195
198
 
196
- === List installed font paths
199
+ === List installed font paths: `fontist manifest-locations`
197
200
 
198
201
  Returns locations of fonts specified in a YAML file as an input.
199
202
 
@@ -238,13 +241,23 @@ Segoe UI:
238
241
  - "/Users/user/.fontist/fonts/SEGOEUIB.TTF"
239
242
  Roboto Mono:
240
243
  Regular:
241
- full_name:
242
- paths: []
244
+ full_name: Roboto Mono Regular
245
+ paths:
246
+ - "/Users/user/.fontist/fonts/RobotoMono-VariableFont_wght.ttf"
243
247
  ----
244
248
 
245
- 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:
246
251
 
247
- === 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`
248
261
 
249
262
  Install fonts from a YAML Fontist manifest:
250
263
 
@@ -274,7 +287,31 @@ Roboto Mono:
274
287
  - "/Users/user/.fontist/fonts/RobotoMono-VariableFont_wght.ttf"
275
288
  ----
276
289
 
277
- === 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`
278
315
 
279
316
  List of all commands could be seen by:
280
317
 
@@ -372,7 +409,7 @@ Fontist::Formula.find("Calibri")
372
409
  ----
373
410
 
374
411
  This method will search and return a Fontist formula for the provided keyword
375
- 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
376
413
  installation of the font in your system.
377
414
 
378
415
  ==== List font styles supported by a formula
@@ -517,7 +554,36 @@ Fontist::Manifest::Locations.from_file("manifest.yml")
517
554
  Fontist::Manifest::Install.from_file("manifest.yml", confirmation: "yes")
518
555
  ----
519
556
 
520
- == 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
521
587
 
522
588
  Fontist uses Git internally for fetching formulas and fonts.
523
589
 
@@ -576,38 +642,124 @@ https://github.com/evantoli[evantoli]).
576
642
 
577
643
  == Authoring Fontist formulas
578
644
 
579
- === Creating a Fontist formula from a font archive
645
+ === Private Fontist formulas and font repositories
580
646
 
581
- A formula could be generated from a fonts archive. Just specify a URL to the
582
- 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`.
583
663
 
584
664
  [source,sh]
585
665
  ----
586
- fontist create-formula https://www.latofonts.com/download/lato2ofl-zip/
587
- 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
588
676
  ----
589
677
 
590
- Though indexes are auto-generated now, maintainers should rebuild indexes in the
591
- main repo for backward compatibility with Fontist versinos prior to 1.9.x.
678
+ Then you can just install fonts from this repo:
592
679
 
593
- A formula index should be rebuilt when a new formula is generated or an existing
594
- 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:
595
687
 
596
688
  [source,sh]
597
689
  ----
598
- fontist rebuild-index --main-repo
690
+ fontist repo update acme
599
691
  ----
600
692
 
601
- Then, both the formula and the updated indexes should be committed and pushed to
602
- 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:
603
706
 
604
707
  [source,sh]
605
708
  ----
606
- cd ~/.fontist/formulas
607
- git add Formulas/lato.yml index.yml filename_index.yml
608
- 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
609
729
  ----
610
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.
611
763
 
612
764
 
613
765
 
@@ -620,29 +772,13 @@ WARNING: This section is only for Fontist maintainers.
620
772
  https://fonts.google.com[Google Fonts] provides probably the largest collection
621
773
  of widely-used, freely and openly licensed fonts.
622
774
 
623
- Fontist's https://github.com/fonitist/formula[formula library] includes support
775
+ Fontist's https://github.com/fontist/formulas[formula library] includes support
624
776
  for all openly-licensed fonts provided through Google Fonts, and maintains
625
777
  Fontist formulas for all such fonts.
626
778
 
627
- A GHA workflow checks for updated fonts on Google Fonts daily.
628
-
629
- In case an update is found, it could be fetched to the library by:
630
-
631
- [source,sh]
632
- ----
633
- bin/fontist google import
634
- ----
635
-
636
- The script would update formulas which should be committed to a separate
637
- repository https://github.com/fontist/formulas[formulas]:
638
-
639
- [source,sh]
640
- ----
641
- cd ~/.fontist/versions/{last_version}/formulas
642
- git add Formulas/google
643
- git commit -m "Google Fonts update"
644
- git push
645
- ----
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.
646
782
 
647
783
  === Dynamically importing formulas from SIL
648
784
 
@@ -659,7 +795,7 @@ They can be updated with:
659
795
 
660
796
  [source,sh]
661
797
  ----
662
- fontist import-sil
798
+ fontist import sil
663
799
  cd ~/.fontist/versions/{last_version}/formulas
664
800
  git add Formulas/sil
665
801
  git commit -m "SIL fonts update"
@@ -669,35 +805,19 @@ git push
669
805
  === Dynamically importing formulas from macOS
670
806
 
671
807
  macOS provides https://support.apple.com/en-om/HT211240#download[fonts] which
672
- can be manually downloaded with the Font Book app. When such font is requested,
673
- fontist prints information on how to install it.
808
+ can be manually downloaded with `Font Book.app`.
674
809
 
675
- In order to know which fonts are available in a current version of macOS,
676
- for each version there is a formula containing all supported fonts.
677
-
678
- A new formula can be generated with:
810
+ To update macOS formulas:
679
811
 
680
812
  [source,sh]
681
813
  ----
682
- fontist import macos --name "Big Sur" --fonts-link "https://support.apple.com/en-om/HT211240#download"
814
+ fontist import macos
683
815
  cd ~/.fontist/versions/{last_version}/formulas
684
816
  git add Formulas/macos
685
- git commit -m "Add Big Sur macOS formula"
817
+ git commit -m "Update macOS formulas"
686
818
  git push
687
819
  ----
688
820
 
689
- Here `--fonts-link` is a link to a page containing a list of available fonts
690
- in the Font Book app.
691
-
692
- If the import is run on a different version of macOS, then a proper version
693
- should be set in the `platforms` attribute of the generated formula:
694
-
695
- [source,yaml]
696
- ----
697
- platforms:
698
- - macos-20
699
- ----
700
-
701
821
 
702
822
  == Development
703
823
 
@@ -732,82 +852,6 @@ https://github.com/fontist/formulas[formulas] repository.
732
852
  If you'd like to add a new formula repository or change settings for an existing
733
853
  one, please refer to its documentation.
734
854
 
735
- === Private Fontist formulas and font repositories
736
-
737
- There is an ability to use private fonts via private Fontist repositories.
738
-
739
- A Fontist repository is a Git repo which contains YAML formula files. Formulas can be created
740
- manually (see https://github.com/fontist/formulas/tree/master/Formulas[examples]),
741
- or xref:Authoring Fontist formulas[auto-generated from an archive].
742
-
743
- A repository can be either a HTTPS or SSH Git repo. In case of SSH, a
744
- corresponding SSH key should be setup with `ssh-agent` in order to access this
745
- private repository.
746
-
747
- The `fontist repo setup` command fetches a repository's formulas, and saves the
748
- repository's name and URL for later use.
749
-
750
- Internally, all repositories are stored at
751
- `~/.fontist/formulas/Formulas/private`.
752
-
753
- [source,sh]
754
- ----
755
- fontist repo setup NAME URL
756
- ----
757
-
758
- E.g.
759
-
760
- [source,sh]
761
- ----
762
- fontist repo setup acme https://example.com/acme/formulas.git
763
- # or
764
- fontist repo setup acme git@example.com:acme/formulas.git
765
- ----
766
-
767
- Then you can just install fonts from this repo:
768
-
769
- [source,sh]
770
- ----
771
- fontist install "private font"
772
- ----
773
-
774
- If the private Fontist formula repository is updated, you can fetch the updates
775
- with the `repo update` command:
776
-
777
- [source,sh]
778
- ----
779
- fontist repo update acme
780
- ----
781
-
782
- If there is a need to avoid using private formulas, the repo can be removed
783
- with:
784
-
785
- [source,sh]
786
- ----
787
- fontist repo remove acme
788
- ----
789
-
790
- === Private formulas
791
-
792
- Authorization of private archives in private formulas can be implemented with
793
- headers.
794
-
795
- Here is an example which works with Github releases:
796
-
797
- [source,yaml]
798
- ----
799
- resources:
800
- fonts.zip:
801
- urls:
802
- - url: https://example.com/repos/acme/formulas/releases/assets/38777461
803
- headers:
804
- Accept: application/octet-stream
805
- Authorization: token ghp_1234567890abcdefghi
806
- ----
807
-
808
- A token can be obtained on the
809
- https://github.com/settings/tokens[GitHub Settings > Tokens page].
810
- This token should have at least the `repo` scope for access to these assets.
811
855
 
812
856
  === Releasing
813
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"