fontist 1.14.0 → 1.14.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c0b58f3af1125a6a560179502a5ce5845e76b4d4db1c466e5f63f9628203089
4
- data.tar.gz: 2176708c4c71239768f8714cf21d393aae208b8a7757402b08ad369ec155ed25
3
+ metadata.gz: bc5e7576ced5478fb9dc9752a5aa7f514491f112d5bb66b12f86f82b3d8a2f99
4
+ data.tar.gz: 123b39db27bb75fcbd120caae26adb60a7f9f39e9eabd06613ee50c98adde004
5
5
  SHA512:
6
- metadata.gz: c3875e506d599cfab2e7447e7a9f24518080a02f8bce0018f386b06c13a5048a78ce2e8fa61a4109e60e7445bb10164e84d45d33bcc109b4087ca3a2eeedac49
7
- data.tar.gz: 61747670abc9194cba651cb01d5a69d46bbdc84ed99f9de50e0057606a24f2b2efb2b2df782d6cf9b3b99d1c678e33f20d665157655de460e9227075b3a28a0b
6
+ metadata.gz: '08091fefee390b3b349d6f7ccd7ac7bb921274c778f91452e05d19f56eac0399604db310aba1ea59fcfa7eafb1c1945aaa6d5454c1141850a7931fa6c44fd9b2'
7
+ data.tar.gz: d086b630b7d5e32435215d2498b023a3de3238f69c143436e09d0112860c14112167e9dcaa11e8fc1870affb5b63a53b46b9d5a236d00394ec7eeeb6b587e8af
data/README.adoc CHANGED
@@ -160,17 +160,16 @@ These fonts are removed:
160
160
 
161
161
  === Status: `fontist status`
162
162
 
163
- Prints installed font paths grouped by formula and font.
163
+ Prints installed font paths with a corresponding formula.
164
164
 
165
165
  [source,sh]
166
166
  ----
167
167
  $ fontist status "segoe ui"
168
- segoe_ui
169
- Segoe UI
170
- Regular (/Users/user/.fontist/fonts/SEGOEUI.TTF)
171
- Bold (/Users/user/.fontist/fonts/SEGOEUIB.TTF)
172
- Italic (/Users/user/.fontist/fonts/SEGOEUII.TTF)
173
- 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)
174
173
  ----
175
174
 
176
175
  === List: `fontist list`
@@ -242,11 +241,21 @@ Segoe UI:
242
241
  - "/Users/user/.fontist/fonts/SEGOEUIB.TTF"
243
242
  Roboto Mono:
244
243
  Regular:
245
- full_name:
246
- paths: []
244
+ full_name: Roboto Mono Regular
245
+ paths:
246
+ - "/Users/user/.fontist/fonts/RobotoMono-VariableFont_wght.ttf"
247
247
  ----
248
248
 
249
- 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:
251
+
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
+ ----
250
259
 
251
260
  === Install fonts from manifest: `fontist manifest-install`
252
261
 
@@ -556,7 +565,7 @@ Fontist::Fontconfig.remove # disable detection
556
565
  Fontist::Fontconfig.remove(force: true) # do not fail if no config exists
557
566
  ----
558
567
 
559
- === Installing macOS-specific add-on fonts
568
+ == Installing macOS-specific add-on fonts
560
569
 
561
570
  The purpose of Fontist allowing macOS-specific add-on fonts is to allow CI jobs
562
571
  on macOS environments to use these specially licensed fonts that are not
@@ -701,27 +710,6 @@ fontist create-formula https://www.latofonts.com/download/lato2ofl-zip/
701
710
  cp lato.yml ~/.fontist/formulas/Formulas/
702
711
  ----
703
712
 
704
- Though indexes are auto-generated now, maintainers should rebuild indexes in the
705
- main repo for backward compatibility with Fontist versions prior to v1.9.x.
706
-
707
- A formula index should be rebuilt when a new formula is generated or an existing
708
- one changed:
709
-
710
- [source,sh]
711
- ----
712
- fontist rebuild-index --main-repo
713
- ----
714
-
715
- Then, both the formula and the updated indexes should be committed and pushed to
716
- the formula repository:
717
-
718
- [source,sh]
719
- ----
720
- cd ~/.fontist/formulas
721
- git add Formulas/lato.yml index.yml filename_index.yml
722
- git commit -m "Add Lato formula"
723
- ----
724
-
725
713
  === Authentication for private formulas or private formula repositories
726
714
 
727
715
  Authorization of private archives in private formulas can be implemented with
@@ -784,29 +772,13 @@ WARNING: This section is only for Fontist maintainers.
784
772
  https://fonts.google.com[Google Fonts] provides probably the largest collection
785
773
  of widely-used, freely and openly licensed fonts.
786
774
 
787
- Fontist's https://github.com/fonitist/formula[formula library] includes support
775
+ Fontist's https://github.com/fontist/formulas[formula library] includes support
788
776
  for all openly-licensed fonts provided through Google Fonts, and maintains
789
777
  Fontist formulas for all such fonts.
790
778
 
791
- A GHA workflow checks for updated fonts on Google Fonts daily.
792
-
793
- In case an update is found, it could be fetched to the library by:
794
-
795
- [source,sh]
796
- ----
797
- bin/fontist import google
798
- ----
799
-
800
- The script would update formulas which should be committed to a separate
801
- repository https://github.com/fontist/formulas[formulas]:
802
-
803
- [source,sh]
804
- ----
805
- cd ~/.fontist/versions/{last_version}/formulas
806
- git add Formulas/google
807
- git commit -m "Google Fonts update"
808
- git push
809
- ----
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.
810
782
 
811
783
  === Dynamically importing formulas from SIL
812
784
 
@@ -833,35 +805,19 @@ git push
833
805
  === Dynamically importing formulas from macOS
834
806
 
835
807
  macOS provides https://support.apple.com/en-om/HT211240#download[fonts] which
836
- can be manually downloaded with `Font Book.app`. When such font is requested,
837
- Fontist prints information on how to install it.
808
+ can be manually downloaded with `Font Book.app`.
838
809
 
839
- In order to know which fonts are available in a current version of macOS,
840
- for each version there is a formula containing all supported fonts.
841
-
842
- A new formula can be generated with:
810
+ To update macOS formulas:
843
811
 
844
812
  [source,sh]
845
813
  ----
846
- fontist import macos --name "Big Sur" --fonts-link "https://support.apple.com/en-om/HT211240#download"
814
+ fontist import macos
847
815
  cd ~/.fontist/versions/{last_version}/formulas
848
816
  git add Formulas/macos
849
- git commit -m "Add Big Sur macOS formula"
817
+ git commit -m "Update macOS formulas"
850
818
  git push
851
819
  ----
852
820
 
853
- Here `--fonts-link` is a link to a page containing a list of available fonts
854
- in the `Font Book.app`.
855
-
856
- If the import is run on a different version of macOS, then a proper version
857
- should be set in the `platforms` attribute of the generated formula:
858
-
859
- [source,yaml]
860
- ----
861
- platforms:
862
- - macos-20
863
- ----
864
-
865
821
 
866
822
  == Development
867
823
 
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"
@@ -97,8 +97,17 @@ module Fontist
97
97
 
98
98
  def generate_file_path(source)
99
99
  dir = Dir.mktmpdir(nil, Fontist.downloads_path)
100
- filename = source.original_filename
101
- File.join(dir, filename)
100
+ File.join(dir, filename(source))
101
+ end
102
+
103
+ def filename(source)
104
+ if File.extname(source.original_filename).empty? && source.content_type
105
+ require "mime/types"
106
+ ext = MIME::Types[source.content_type].first&.preferred_extension
107
+ return "#{source.original_filename}.#{ext}" if ext
108
+ end
109
+
110
+ source.original_filename
102
111
  end
103
112
 
104
113
  def move(source_file, target_path)
@@ -1,3 +1,3 @@
1
1
  module Fontist
2
- VERSION = "1.14.0".freeze
2
+ VERSION = "1.14.1".freeze
3
3
  end
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: 1.14.0
4
+ version: 1.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-23 00:00:00.000000000 Z
11
+ date: 2022-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: down
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mime-types
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: sys-uname
57
71
  requirement: !ruby/object:Gem::Requirement