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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +4 -0
  3. data/Gemfile +11 -0
  4. data/README.adoc +6 -6
  5. data/docs/guide/api-ruby.md +8 -9
  6. data/fontist.gemspec +14 -24
  7. data/formula_filename_index.yml +6210 -0
  8. data/formula_index.yml +2568 -0
  9. data/lib/fontist/cli.rb +14 -14
  10. data/lib/fontist/config.rb +75 -14
  11. data/lib/fontist/errors.rb +2 -0
  12. data/lib/fontist/extract.rb +25 -0
  13. data/lib/fontist/font.rb +6 -8
  14. data/lib/fontist/font_collection.rb +16 -0
  15. data/lib/fontist/font_installer.rb +4 -4
  16. data/lib/fontist/font_model.rb +15 -0
  17. data/lib/fontist/font_path.rb +1 -1
  18. data/lib/fontist/font_style.rb +37 -0
  19. data/lib/fontist/formula.rb +169 -112
  20. data/lib/fontist/import/formula_serializer.rb +4 -4
  21. data/lib/fontist/import/google_import.rb +1 -1
  22. data/lib/fontist/index.rb +47 -8
  23. data/lib/fontist/indexes/default_family_font_index.rb +28 -9
  24. data/lib/fontist/indexes/filename_index.rb +45 -8
  25. data/lib/fontist/indexes/font_index.rb +3 -3
  26. data/lib/fontist/indexes/formula_key_to_path.rb +35 -0
  27. data/lib/fontist/indexes/index_mixin.rb +109 -0
  28. data/lib/fontist/indexes/preferred_family_font_index.rb +28 -9
  29. data/lib/fontist/manifest.rb +144 -2
  30. data/lib/fontist/manifest_request.rb +64 -0
  31. data/lib/fontist/manifest_response.rb +66 -0
  32. data/lib/fontist/repo.rb +1 -1
  33. data/lib/fontist/system_font.rb +7 -25
  34. data/lib/fontist/system_index.rb +137 -126
  35. data/lib/fontist/utils/cache.rb +54 -4
  36. data/lib/fontist/version.rb +1 -1
  37. data/lib/fontist.rb +33 -13
  38. metadata +16 -136
  39. data/lib/fontist/indexes/base_index.rb +0 -92
  40. data/lib/fontist/indexes/index_formula.rb +0 -36
  41. data/lib/fontist/manifest/install.rb +0 -35
  42. data/lib/fontist/manifest/locations.rb +0 -84
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfd5ec32758b1fac561e81c902c8a6be42fba0050802a65a1c856d01c4c28239
4
- data.tar.gz: 7530a3efd9cb1921aa9c074a7dc09c343ffb281b2ebd294750fd8621f75c2d83
3
+ metadata.gz: 722a298384ffed9d696e836b150d354e874211c9927ff3482e68a6e0a26367fc
4
+ data.tar.gz: d8b57e7f9223bc56f0b83e0a4ef1b48db4a35e8a8fd41e9af2fe109e0ffda152
5
5
  SHA512:
6
- metadata.gz: 32526e4bee6a47c6ac946acbbf1a831cf9b41b2c1f4ce0e9750ee60dfee06a4c9122bcd521b2f5612ab87d89d75dc13b18d35eed2c25fe8a57e8d1e31ab66738
7
- data.tar.gz: 920c81e9380c7874cc91599161887709a897ae6b37ac21fcda8aa8285eb86b367f9eb4def36d26d96c3f7da891989da1aff4be5085219ecd71cceea594c35259
6
+ metadata.gz: 63aed7061e821c6cc0d30f73de923f1dcf2badcee91855bd99e3618ab6bb859bb6a33935e77ed586be49ae640c97457bdaa148482f02a04fd5694e7c93bc1dfc
7
+ data.tar.gz: f682fc64dafb10898e5d6d676f35f7e2208f46c3fab1d58ddaf95b047fb9c94feacaffe293cdbb6cab951d47dfc28dc738e207d0eaa48b19ce1aac41be858c6a
@@ -4,7 +4,11 @@ on:
4
4
  push:
5
5
  branches: [ main ]
6
6
  tags: [ 'v*' ]
7
+ paths-ignore:
8
+ - '**.adoc'
7
9
  pull_request:
10
+ paths-ignore:
11
+ - '**.adoc'
8
12
 
9
13
  concurrency:
10
14
  group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
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
- ==== `Fontist::Manifest::Locations`
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::Locations.from_hash(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
- ==== `Fontist::Manifest::Install`
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
- Fontist::Manifest::Install.from_hash(manifest, confirmation: "yes")
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::Locations.from_file("manifest.yml")
635
- Fontist::Manifest::Install.from_file("manifest.yml", confirmation: "yes")
634
+ manifest = Fontist::Manifest.from_file("manifest.yml")
635
+ manifest.install(confirmation: "yes")
636
636
  ----
637
637
 
638
638
  === `Fontist::Fontconfig`
@@ -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
- ### Fontist::Manifest::Locations
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::Locations.from_hash(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
- Fontist::Manifest::Install.from_hash(manifest, confirmation: "yes")
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
- ### Support of YAML format
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::Install and Fontist::Manifest::Locations).
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::Locations.from_file("manifest.yml")
179
- Fontist::Manifest::Install.from_file("manifest.yml", confirmation: "yes")
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.add_runtime_dependency "down", "~> 5.0"
33
- spec.add_runtime_dependency "extract_ttc", "~> 0.1"
34
- spec.add_runtime_dependency "fuzzy_match", "~> 2.1"
35
- spec.add_runtime_dependency "json", "~> 2.0"
36
- spec.add_runtime_dependency "nokogiri", "~> 1.0"
37
- spec.add_runtime_dependency "mime-types", "~> 3.0"
38
- spec.add_runtime_dependency "sys-uname", "~> 1.2"
39
- spec.add_runtime_dependency "thor", "~> 1.2", ">= 1.2.1"
40
- spec.add_runtime_dependency "git", "~> 1.0"
41
- spec.add_runtime_dependency "ttfunk", "~> 1.6"
42
- spec.add_runtime_dependency "plist", "~> 3.0"
43
- spec.add_runtime_dependency "excavate", "~> 0.3", '>= 0.3.4'
44
- spec.add_runtime_dependency "socksify", "~> 1.7"
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