fontist 1.21.4 → 2.0.2
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 +4 -4
- data/.github/workflows/rake.yml +4 -0
- data/Gemfile +11 -0
- data/README.adoc +77 -11
- data/docs/guide/api-ruby.md +10 -11
- data/fontist.gemspec +14 -24
- data/formula_filename_index.yml +6210 -0
- data/formula_index.yml +2568 -0
- data/lib/fontist/cli.rb +16 -14
- data/lib/fontist/config.rb +75 -14
- data/lib/fontist/errors.rb +2 -0
- data/lib/fontist/extract.rb +25 -0
- data/lib/fontist/font.rb +6 -8
- data/lib/fontist/font_collection.rb +16 -0
- data/lib/fontist/font_installer.rb +4 -4
- data/lib/fontist/font_model.rb +15 -0
- data/lib/fontist/font_path.rb +1 -1
- data/lib/fontist/font_style.rb +37 -0
- data/lib/fontist/formula.rb +169 -112
- data/lib/fontist/helpers.rb +5 -4
- data/lib/fontist/import/create_formula.rb +2 -1
- data/lib/fontist/import/files/collection_file.rb +5 -15
- data/lib/fontist/import/font_style.rb +22 -0
- data/lib/fontist/import/formula_serializer.rb +4 -4
- data/lib/fontist/import/google_import.rb +1 -1
- data/lib/fontist/import/otf/font_file.rb +8 -3
- data/lib/fontist/import/otf_style.rb +3 -1
- data/lib/fontist/import/recursive_extraction.rb +9 -4
- data/lib/fontist/index.rb +47 -8
- data/lib/fontist/indexes/default_family_font_index.rb +28 -9
- data/lib/fontist/indexes/filename_index.rb +45 -8
- data/lib/fontist/indexes/font_index.rb +3 -3
- data/lib/fontist/indexes/formula_key_to_path.rb +35 -0
- data/lib/fontist/indexes/index_mixin.rb +109 -0
- data/lib/fontist/indexes/preferred_family_font_index.rb +28 -9
- data/lib/fontist/manifest.rb +144 -2
- data/lib/fontist/manifest_request.rb +64 -0
- data/lib/fontist/manifest_response.rb +66 -0
- data/lib/fontist/repo.rb +1 -1
- data/lib/fontist/resources/archive_resource.rb +3 -2
- data/lib/fontist/system_font.rb +7 -25
- data/lib/fontist/system_index.rb +137 -126
- data/lib/fontist/utils/cache.rb +54 -4
- data/lib/fontist/utils/downloader.rb +6 -4
- data/lib/fontist/version.rb +1 -1
- data/lib/fontist.rb +33 -13
- metadata +23 -148
- data/lib/fontist/indexes/base_index.rb +0 -92
- data/lib/fontist/indexes/index_formula.rb +0 -36
- data/lib/fontist/manifest/install.rb +0 -35
- data/lib/fontist/manifest/locations.rb +0 -84
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 579975f05c71659ca72914f2e273dead08930e5943f230fbc4ad5029d19b5bad
|
|
4
|
+
data.tar.gz: c3529656ee99bbd27cd9b7c37025e79350c99ead6b5f222cb08773460b2e6feb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7cffa6efd591fc625aff86d71774ef70aff09b6c0fe9d5cb53f4ff0fff81a80fb76950701267ecfd8bea637a26e046a1ce698111226c8972049d86cd0110dd7a
|
|
7
|
+
data.tar.gz: 8e0386ba63208db999567979f733521ff11b64b745bfd492436012761335a6a406b0fc0104176e05cecb283c4bd3924504e7668ab388a2937fd1596f6bfe8fa4
|
data/.github/workflows/rake.yml
CHANGED
data/Gemfile
CHANGED
|
@@ -2,3 +2,14 @@ source "https://rubygems.org"
|
|
|
2
2
|
|
|
3
3
|
# Specify your gem's dependencies in fontist.gemspec
|
|
4
4
|
gemspec
|
|
5
|
+
|
|
6
|
+
gem "pry"
|
|
7
|
+
gem "bundler"
|
|
8
|
+
gem "rake"
|
|
9
|
+
gem "rspec"
|
|
10
|
+
gem "rspec-benchmark"
|
|
11
|
+
gem "rubocop"
|
|
12
|
+
gem "rubocop-rails"
|
|
13
|
+
gem "rubocop-performance"
|
|
14
|
+
gem "vcr"
|
|
15
|
+
gem "webmock"
|
data/README.adoc
CHANGED
|
@@ -4,7 +4,17 @@ image:https://github.com/fontist/fontist/actions/workflows/test-and-release.yml/
|
|
|
4
4
|
image:https://img.shields.io/gem/v/fontist.svg["Gem Version", link="https://rubygems.org/gems/fontist"]
|
|
5
5
|
image:https://img.shields.io/github/issues-pr-raw/fontist/fontist.svg["Pull Requests", link="https://github.com/fontist/fontist/pulls"]
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Fontist lets you find and download fonts for Windows, Linux and Mac.
|
|
8
|
+
|
|
9
|
+
Fontist is designed to facilitate automated and unattended management of font
|
|
10
|
+
installations on modern operating systems.
|
|
11
|
+
|
|
12
|
+
Fontist provides a repository of open
|
|
13
|
+
https://github.com/fontist/formulas[Fontist Formulas] that can be easily
|
|
14
|
+
installed, and also supports private font formula repositories for private or
|
|
15
|
+
licensed commercial fonts.
|
|
16
|
+
|
|
17
|
+
Learn more (and find your font) at https://www.fontist.org[fontist.org].
|
|
8
18
|
|
|
9
19
|
:toc:
|
|
10
20
|
|
|
@@ -468,8 +478,8 @@ styles. You can do that by using:
|
|
|
468
478
|
Fontist::Font.all
|
|
469
479
|
----
|
|
470
480
|
|
|
471
|
-
The return values are
|
|
472
|
-
|
|
481
|
+
The return values are model objects, so you can easily access their properties
|
|
482
|
+
and perform operations on them.
|
|
473
483
|
|
|
474
484
|
=== `Fontist::Formula`
|
|
475
485
|
|
|
@@ -518,8 +528,8 @@ what type fonts can be installed using that formula. Usages:
|
|
|
518
528
|
Fontist::Formula.all
|
|
519
529
|
----
|
|
520
530
|
|
|
521
|
-
The return values are
|
|
522
|
-
|
|
531
|
+
The return values are model objects, so you can easily access their properties
|
|
532
|
+
and perform operations on them.
|
|
523
533
|
|
|
524
534
|
=== `Fontist::Manifest`
|
|
525
535
|
|
|
@@ -534,7 +544,7 @@ Fontist.preferred_family = true
|
|
|
534
544
|
----
|
|
535
545
|
|
|
536
546
|
[[fontist-locations]]
|
|
537
|
-
====
|
|
547
|
+
==== Locations
|
|
538
548
|
|
|
539
549
|
Fontist lets you find font locations from a defined manifest Hash in the
|
|
540
550
|
following format:
|
|
@@ -552,7 +562,7 @@ Font name is useful to choose a specific font in a font collection file (TTC).
|
|
|
552
562
|
|
|
553
563
|
[source,ruby]
|
|
554
564
|
----
|
|
555
|
-
Fontist::Manifest
|
|
565
|
+
Fontist::Manifest.from_hash(manifest, locations: true)
|
|
556
566
|
----
|
|
557
567
|
|
|
558
568
|
[source,ruby]
|
|
@@ -578,14 +588,14 @@ Fontist::Manifest::Locations.from_hash(manifest)
|
|
|
578
588
|
----
|
|
579
589
|
|
|
580
590
|
[[fontist-install]]
|
|
581
|
-
====
|
|
591
|
+
==== Install
|
|
582
592
|
|
|
583
593
|
Fontist lets you not only to obtain font locations but also to install fonts
|
|
584
594
|
from the manifest:
|
|
585
595
|
|
|
586
596
|
[source,ruby]
|
|
587
597
|
----
|
|
588
|
-
|
|
598
|
+
manifest.install(confirmation: "yes")
|
|
589
599
|
----
|
|
590
600
|
|
|
591
601
|
It will install fonts and return their locations:
|
|
@@ -631,8 +641,8 @@ Then the following calls would return font names and paths, as from the
|
|
|
631
641
|
|
|
632
642
|
[source,ruby]
|
|
633
643
|
----
|
|
634
|
-
Fontist::Manifest
|
|
635
|
-
|
|
644
|
+
manifest = Fontist::Manifest.from_file("manifest.yml")
|
|
645
|
+
manifest.install(confirmation: "yes")
|
|
636
646
|
----
|
|
637
647
|
|
|
638
648
|
=== `Fontist::Fontconfig`
|
|
@@ -916,6 +926,62 @@ fontist create-formula https://www.latofonts.com/files/Lato2OFL.zip
|
|
|
916
926
|
cp lato.yml ~/.fontist/formulas/Formulas/
|
|
917
927
|
----
|
|
918
928
|
|
|
929
|
+
==== Options for `create-formula`
|
|
930
|
+
|
|
931
|
+
The `create-formula` command supports several options to customize formula generation:
|
|
932
|
+
|
|
933
|
+
`--name`::
|
|
934
|
+
Specify a custom formula name instead of auto-detecting from fonts.
|
|
935
|
+
+
|
|
936
|
+
[source,sh]
|
|
937
|
+
----
|
|
938
|
+
fontist create-formula https://example.com/fonts.zip --name "My Custom Fonts"
|
|
939
|
+
----
|
|
940
|
+
|
|
941
|
+
`--subdir`::
|
|
942
|
+
Extract fonts only from a specific subdirectory within the archive.
|
|
943
|
+
Uses `fnmatch` patterns.
|
|
944
|
+
+
|
|
945
|
+
[source,sh]
|
|
946
|
+
----
|
|
947
|
+
fontist create-formula https://example.com/fonts.zip --subdir "fonts/otf"
|
|
948
|
+
----
|
|
949
|
+
|
|
950
|
+
`--file-pattern`::
|
|
951
|
+
Filter font files by pattern. Uses `fnmatch` patterns.
|
|
952
|
+
+
|
|
953
|
+
[source,sh]
|
|
954
|
+
----
|
|
955
|
+
fontist create-formula https://example.com/fonts.zip --file-pattern "*.otf"
|
|
956
|
+
----
|
|
957
|
+
|
|
958
|
+
`--name-prefix`::
|
|
959
|
+
Add a prefix to all font family names in the generated formula. This is useful
|
|
960
|
+
for distinguishing compatibility or replacement fonts from original proprietary
|
|
961
|
+
fonts.
|
|
962
|
+
+
|
|
963
|
+
[source,sh]
|
|
964
|
+
----
|
|
965
|
+
fontist create-formula https://dl.winehq.org/wine/source/10.x/wine-10.18.tar.xz \
|
|
966
|
+
--subdir fonts \
|
|
967
|
+
--file-pattern '*.ttf' \
|
|
968
|
+
--name-prefix 'Wine '
|
|
969
|
+
----
|
|
970
|
+
+
|
|
971
|
+
This will generate a formula where all fonts have names prefixed with `"Wine "`,
|
|
972
|
+
such as "Wine Courier", "Wine Tahoma", "Wine Symbol", etc., making it clear
|
|
973
|
+
these are Wine compatibility fonts rather than the original Microsoft fonts.
|
|
974
|
+
|
|
975
|
+
`--mirror`::
|
|
976
|
+
Specify mirror URLs for the font archive (can be used multiple times).
|
|
977
|
+
+
|
|
978
|
+
[source,sh]
|
|
979
|
+
----
|
|
980
|
+
fontist create-formula https://example.com/fonts.zip \
|
|
981
|
+
--mirror https://mirror1.example.com/fonts.zip \
|
|
982
|
+
--mirror https://mirror2.example.com/fonts.zip
|
|
983
|
+
----
|
|
984
|
+
|
|
919
985
|
|
|
920
986
|
==== Overriding font metadata in Fontist formulas
|
|
921
987
|
|
data/docs/guide/api-ruby.md
CHANGED
|
@@ -45,7 +45,7 @@ This might be useful if you want to know the name of the font or the available s
|
|
|
45
45
|
Fontist::Font.all
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
The return values are
|
|
48
|
+
The return values are model objects, so you can easily access their properties and perform operations on them.
|
|
49
49
|
|
|
50
50
|
## Fontist::Formula
|
|
51
51
|
|
|
@@ -79,7 +79,7 @@ The `Fontist::Formula` interface exposes an interface to list all registered fon
|
|
|
79
79
|
Fontist::Formula.all
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
The return values are
|
|
82
|
+
The return values are model objects, so you can easily access their properties and perform operations on them.
|
|
83
83
|
|
|
84
84
|
## Fontist::Manifest
|
|
85
85
|
|
|
@@ -91,7 +91,7 @@ Fontist can be switched to use the preferred family names. This format was used
|
|
|
91
91
|
Fontist.preferred_family = true
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
###
|
|
94
|
+
### Manifest from YAML file or Hash
|
|
95
95
|
|
|
96
96
|
Fontist lets you find font locations from a defined manifest Hash in the following format:
|
|
97
97
|
|
|
@@ -105,7 +105,8 @@ Fontist lets you find font locations from a defined manifest Hash in the followi
|
|
|
105
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
106
|
|
|
107
107
|
```ruby
|
|
108
|
-
Fontist::Manifest
|
|
108
|
+
Fontist::Manifest.from_yaml(manifest)
|
|
109
|
+
Fontist::Manifest.from_hash(manifest)
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
```ruby
|
|
@@ -129,12 +130,10 @@ Fontist::Manifest::Locations.from_hash(manifest)
|
|
|
129
130
|
}
|
|
130
131
|
```
|
|
131
132
|
|
|
132
|
-
### Fontist::Manifest::Install
|
|
133
|
-
|
|
134
133
|
Fontist lets you not only obtain font locations but also install fonts from the manifest:
|
|
135
134
|
|
|
136
135
|
```ruby
|
|
137
|
-
|
|
136
|
+
manifest.install(confirmation: "yes")
|
|
138
137
|
```
|
|
139
138
|
|
|
140
139
|
It will install fonts and return their locations:
|
|
@@ -159,7 +158,7 @@ It will install fonts and return their locations:
|
|
|
159
158
|
}
|
|
160
159
|
```
|
|
161
160
|
|
|
162
|
-
|
|
161
|
+
#### Support of YAML format
|
|
163
162
|
|
|
164
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:
|
|
165
164
|
|
|
@@ -172,11 +171,11 @@ Roboto Mono:
|
|
|
172
171
|
- Regular
|
|
173
172
|
```
|
|
174
173
|
|
|
175
|
-
Then the following calls would return font names and paths, as from the `from_hash` method (see Fontist::Manifest
|
|
174
|
+
Then the following calls would return font names and paths, as from the `from_hash` method (see Fontist::Manifest).
|
|
176
175
|
|
|
177
176
|
```ruby
|
|
178
|
-
Fontist::Manifest
|
|
179
|
-
|
|
177
|
+
manifest = Fontist::Manifest.from_file("manifest.yml")
|
|
178
|
+
manifest.install(confirmation: "yes")
|
|
180
179
|
```
|
|
181
180
|
|
|
182
181
|
## Fontist::Fontconfig
|
data/fontist.gemspec
CHANGED
|
@@ -29,28 +29,18 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
spec.executables = ["fontist"]
|
|
30
30
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
|
31
31
|
|
|
32
|
-
spec.
|
|
33
|
-
spec.
|
|
34
|
-
spec.
|
|
35
|
-
spec.
|
|
36
|
-
spec.
|
|
37
|
-
spec.
|
|
38
|
-
spec.
|
|
39
|
-
spec.
|
|
40
|
-
spec.
|
|
41
|
-
spec.
|
|
42
|
-
spec.
|
|
43
|
-
spec.
|
|
44
|
-
spec.
|
|
45
|
-
|
|
46
|
-
spec.add_development_dependency "pry", "~> 0.14"
|
|
47
|
-
spec.add_development_dependency "bundler", "~> 2.3"
|
|
48
|
-
spec.add_development_dependency "rake", "~> 13"
|
|
49
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
|
50
|
-
spec.add_development_dependency "rspec-benchmark", "~> 0.6"
|
|
51
|
-
spec.add_development_dependency "rubocop", "~> 1.22.1"
|
|
52
|
-
spec.add_development_dependency "rubocop-rails", "~> 2.9"
|
|
53
|
-
spec.add_development_dependency "rubocop-performance", "~> 1.10"
|
|
54
|
-
spec.add_development_dependency "vcr"
|
|
55
|
-
spec.add_development_dependency "webmock"
|
|
32
|
+
spec.add_dependency "down", "~> 5.0"
|
|
33
|
+
spec.add_dependency "extract_ttc", "~> 0.3.7"
|
|
34
|
+
spec.add_dependency "fuzzy_match", "~> 2.1"
|
|
35
|
+
spec.add_dependency "json", "~> 2.0"
|
|
36
|
+
spec.add_dependency "nokogiri", "~> 1.0"
|
|
37
|
+
spec.add_dependency "mime-types", "~> 3.0"
|
|
38
|
+
spec.add_dependency "sys-uname", "~> 1.2"
|
|
39
|
+
spec.add_dependency "thor", "~> 1.4"
|
|
40
|
+
spec.add_dependency "git", "~> 1.0"
|
|
41
|
+
spec.add_dependency "ttfunk", "~> 1.6"
|
|
42
|
+
spec.add_dependency "plist", "~> 3.0"
|
|
43
|
+
spec.add_dependency "excavate", "~> 0.3", '>= 0.3.8'
|
|
44
|
+
spec.add_dependency "socksify", "~> 1.7"
|
|
45
|
+
spec.add_dependency "lutaml-model", "~> 0.7"
|
|
56
46
|
end
|