fontist 1.21.4 → 2.0.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 +4 -4
- data/.github/workflows/rake.yml +4 -0
- data/Gemfile +11 -0
- data/README.adoc +6 -6
- data/docs/guide/api-ruby.md +8 -9
- data/fontist.gemspec +14 -24
- data/formula_filename_index.yml +6210 -0
- data/formula_index.yml +2568 -0
- data/lib/fontist/cli.rb +14 -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/import/formula_serializer.rb +4 -4
- data/lib/fontist/import/google_import.rb +1 -1
- 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/system_font.rb +7 -25
- data/lib/fontist/system_index.rb +137 -126
- data/lib/fontist/utils/cache.rb +54 -4
- data/lib/fontist/version.rb +1 -1
- data/lib/fontist.rb +33 -13
- metadata +16 -136
- 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: 722a298384ffed9d696e836b150d354e874211c9927ff3482e68a6e0a26367fc
|
|
4
|
+
data.tar.gz: d8b57e7f9223bc56f0b83e0a4ef1b48db4a35e8a8fd41e9af2fe109e0ffda152
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63aed7061e821c6cc0d30f73de923f1dcf2badcee91855bd99e3618ab6bb859bb6a33935e77ed586be49ae640c97457bdaa148482f02a04fd5694e7c93bc1dfc
|
|
7
|
+
data.tar.gz: f682fc64dafb10898e5d6d676f35f7e2208f46c3fab1d58ddaf95b047fb9c94feacaffe293cdbb6cab951d47dfc28dc738e207d0eaa48b19ce1aac41be858c6a
|
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
|
@@ -534,7 +534,7 @@ Fontist.preferred_family = true
|
|
|
534
534
|
----
|
|
535
535
|
|
|
536
536
|
[[fontist-locations]]
|
|
537
|
-
====
|
|
537
|
+
==== Locations
|
|
538
538
|
|
|
539
539
|
Fontist lets you find font locations from a defined manifest Hash in the
|
|
540
540
|
following format:
|
|
@@ -552,7 +552,7 @@ Font name is useful to choose a specific font in a font collection file (TTC).
|
|
|
552
552
|
|
|
553
553
|
[source,ruby]
|
|
554
554
|
----
|
|
555
|
-
Fontist::Manifest
|
|
555
|
+
Fontist::Manifest.from_hash(manifest, locations: true)
|
|
556
556
|
----
|
|
557
557
|
|
|
558
558
|
[source,ruby]
|
|
@@ -578,14 +578,14 @@ Fontist::Manifest::Locations.from_hash(manifest)
|
|
|
578
578
|
----
|
|
579
579
|
|
|
580
580
|
[[fontist-install]]
|
|
581
|
-
====
|
|
581
|
+
==== Install
|
|
582
582
|
|
|
583
583
|
Fontist lets you not only to obtain font locations but also to install fonts
|
|
584
584
|
from the manifest:
|
|
585
585
|
|
|
586
586
|
[source,ruby]
|
|
587
587
|
----
|
|
588
|
-
|
|
588
|
+
manifest.install(confirmation: "yes")
|
|
589
589
|
----
|
|
590
590
|
|
|
591
591
|
It will install fonts and return their locations:
|
|
@@ -631,8 +631,8 @@ Then the following calls would return font names and paths, as from the
|
|
|
631
631
|
|
|
632
632
|
[source,ruby]
|
|
633
633
|
----
|
|
634
|
-
Fontist::Manifest
|
|
635
|
-
|
|
634
|
+
manifest = Fontist::Manifest.from_file("manifest.yml")
|
|
635
|
+
manifest.install(confirmation: "yes")
|
|
636
636
|
----
|
|
637
637
|
|
|
638
638
|
=== `Fontist::Fontconfig`
|
data/docs/guide/api-ruby.md
CHANGED
|
@@ -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.1"
|
|
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.2", ">= 1.2.1"
|
|
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.4'
|
|
44
|
+
spec.add_dependency "socksify", "~> 1.7"
|
|
45
|
+
spec.add_dependency "lutaml-model", "~> 0.7"
|
|
56
46
|
end
|