fontist 1.3.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/check_google.yml +28 -0
  3. data/.github/workflows/macosx.yml +3 -0
  4. data/.github/workflows/ubuntu.yml +1 -1
  5. data/.github/workflows/windows.yml +1 -1
  6. data/.gitignore +6 -0
  7. data/.hound.yml +2 -0
  8. data/.rubocop.yml +22 -0
  9. data/README.md +224 -0
  10. data/bin/check_google +8 -0
  11. data/bin/convert_formulas +8 -0
  12. data/bin/fontist +7 -0
  13. data/bin/generate_otfinfo +8 -0
  14. data/bin/import_google +8 -0
  15. data/fontist.gemspec +15 -1
  16. data/lib/fontist.rb +19 -13
  17. data/lib/fontist/cli.rb +168 -0
  18. data/lib/fontist/errors.rb +6 -0
  19. data/lib/fontist/font.rb +145 -7
  20. data/lib/fontist/font_formula.rb +42 -7
  21. data/lib/fontist/fontist_font.rb +70 -0
  22. data/lib/fontist/formula.rb +31 -9
  23. data/lib/fontist/formula_template.rb +122 -0
  24. data/lib/fontist/formulas.rb +41 -0
  25. data/lib/fontist/import.rb +9 -0
  26. data/lib/fontist/import/convert_formulas.rb +65 -0
  27. data/lib/fontist/import/create_formula.rb +59 -0
  28. data/lib/fontist/import/extractors.rb +5 -0
  29. data/lib/fontist/import/extractors/cab_extractor.rb +37 -0
  30. data/lib/fontist/import/extractors/extractor.rb +19 -0
  31. data/lib/fontist/import/extractors/ole_extractor.rb +41 -0
  32. data/lib/fontist/import/extractors/seven_zip_extractor.rb +44 -0
  33. data/lib/fontist/import/extractors/zip_extractor.rb +31 -0
  34. data/lib/fontist/import/files/collection_file.rb +52 -0
  35. data/lib/fontist/import/files/file_requirement.rb +17 -0
  36. data/lib/fontist/import/files/font_detector.rb +48 -0
  37. data/lib/fontist/import/formula_builder.rb +166 -0
  38. data/lib/fontist/import/formula_serializer.rb +133 -0
  39. data/lib/fontist/import/google.rb +16 -0
  40. data/lib/fontist/import/google/fonts_public.md +10 -0
  41. data/lib/fontist/import/google/fonts_public.pb.rb +71 -0
  42. data/lib/fontist/import/google/fonts_public.proto +46 -0
  43. data/lib/fontist/import/google/new_fonts_fetcher.rb +121 -0
  44. data/lib/fontist/import/google/skiplist.yml +8 -0
  45. data/lib/fontist/import/google_check.rb +34 -0
  46. data/lib/fontist/import/google_import.rb +180 -0
  47. data/lib/fontist/import/helpers/hash_helper.rb +13 -0
  48. data/lib/fontist/import/helpers/system_helper.rb +23 -0
  49. data/lib/fontist/import/otf/font_file.rb +105 -0
  50. data/lib/fontist/import/otf_parser.rb +25 -0
  51. data/lib/fontist/import/otf_style.rb +29 -0
  52. data/lib/fontist/import/otfinfo/otfinfo_requirement.rb +22 -0
  53. data/lib/fontist/import/otfinfo/template.erb +20 -0
  54. data/lib/fontist/import/otfinfo_generate.rb +45 -0
  55. data/lib/fontist/import/recursive_extraction.rb +185 -0
  56. data/lib/fontist/import/template_helper.rb +19 -0
  57. data/lib/fontist/import/text_helper.rb +30 -0
  58. data/lib/fontist/manifest.rb +2 -0
  59. data/lib/fontist/manifest/install.rb +32 -0
  60. data/lib/fontist/manifest/locations.rb +60 -0
  61. data/lib/fontist/system_font.rb +66 -22
  62. data/lib/fontist/utils.rb +5 -0
  63. data/lib/fontist/utils/cache.rb +88 -0
  64. data/lib/fontist/utils/downloader.rb +66 -9
  65. data/lib/fontist/utils/dsl.rb +8 -0
  66. data/lib/fontist/utils/dsl/collection_font.rb +36 -0
  67. data/lib/fontist/utils/dsl/font.rb +38 -0
  68. data/lib/fontist/utils/exe_extractor.rb +25 -22
  69. data/lib/fontist/utils/msi_extractor.rb +31 -0
  70. data/lib/fontist/utils/seven_zip_extractor.rb +41 -0
  71. data/lib/fontist/utils/system.rb +23 -0
  72. data/lib/fontist/utils/ui.rb +12 -0
  73. data/lib/fontist/utils/zip_extractor.rb +22 -8
  74. data/lib/fontist/version.rb +1 -1
  75. metadata +173 -49
  76. data/lib/fontist/formulas/andale_font.rb +0 -80
  77. data/lib/fontist/formulas/arial_black_font.rb +0 -79
  78. data/lib/fontist/formulas/cleartype_fonts.rb +0 -227
  79. data/lib/fontist/formulas/comic_font.rb +0 -78
  80. data/lib/fontist/formulas/courier_font.rb +0 -81
  81. data/lib/fontist/formulas/euphemia_font.rb +0 -85
  82. data/lib/fontist/formulas/georgia_font.rb +0 -80
  83. data/lib/fontist/formulas/impact_font.rb +0 -78
  84. data/lib/fontist/formulas/montserrat_font.rb +0 -132
  85. data/lib/fontist/formulas/ms_truetype_fonts.rb +0 -125
  86. data/lib/fontist/formulas/open_sans_fonts.rb +0 -263
  87. data/lib/fontist/formulas/overpass_font.rb +0 -73
  88. data/lib/fontist/formulas/source_fonts.rb +0 -109
  89. data/lib/fontist/formulas/stix_fonts.rb +0 -108
  90. data/lib/fontist/formulas/tahoma_font.rb +0 -147
  91. data/lib/fontist/formulas/webding_font.rb +0 -78
  92. data/spec/fontist/font_formula_spec.rb +0 -67
  93. data/spec/fontist/font_spec.rb +0 -113
  94. data/spec/fontist/formula_spec.rb +0 -67
  95. data/spec/fontist/formulas/andale_font_spec.rb +0 -29
  96. data/spec/fontist/formulas/arial_black_font_spec.rb +0 -29
  97. data/spec/fontist/formulas/cleartype_fonts_spec.rb +0 -38
  98. data/spec/fontist/formulas/comic_font_spec.rb +0 -29
  99. data/spec/fontist/formulas/courier_font_spec.rb +0 -29
  100. data/spec/fontist/formulas/euphemia_font_spec.rb +0 -29
  101. data/spec/fontist/formulas/georgia_font_spec.rb +0 -29
  102. data/spec/fontist/formulas/impact_font_spec.rb +0 -29
  103. data/spec/fontist/formulas/montserrat_font_spec.rb +0 -29
  104. data/spec/fontist/formulas/ms_truetype_fonts_spec.rb +0 -29
  105. data/spec/fontist/formulas/open_sans_fonts_spec.rb +0 -29
  106. data/spec/fontist/formulas/overpass_font_spec.rb +0 -29
  107. data/spec/fontist/formulas/source_fonts_spec.rb +0 -31
  108. data/spec/fontist/formulas/stix_fonts_spec.rb +0 -29
  109. data/spec/fontist/formulas/tahoma_font_spec.rb +0 -29
  110. data/spec/fontist/formulas/webding_font_spec.rb +0 -29
  111. data/spec/fontist/registry_spec.rb +0 -47
  112. data/spec/fontist/system_font_spec.rb +0 -44
  113. data/spec/fontist/utils/downloader_spec.rb +0 -35
  114. data/spec/fontist_spec.rb +0 -5
  115. data/spec/spec_helper.rb +0 -22
  116. data/spec/support/fontist_helper.rb +0 -10
@@ -0,0 +1,23 @@
1
+ module Fontist
2
+ module Utils
3
+ module System
4
+ def self.user_os # rubocop:disable Metrics/MethodLength
5
+ @user_os ||= begin
6
+ host_os = RbConfig::CONFIG["host_os"]
7
+ case host_os
8
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
9
+ :windows
10
+ when /darwin|mac os/
11
+ :macos
12
+ when /linux/
13
+ :linux
14
+ when /solaris|bsd/
15
+ :unix
16
+ else
17
+ raise Fontist::Error, "unknown os: #{host_os.inspect}"
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -3,6 +3,14 @@ require "thor"
3
3
  module Fontist
4
4
  module Utils
5
5
  class UI < Thor
6
+ def self.success(message)
7
+ new.say(message, :green)
8
+ end
9
+
10
+ def self.error(message)
11
+ new.say(message, :red)
12
+ end
13
+
6
14
  def self.say(message)
7
15
  new.say(message)
8
16
  end
@@ -10,6 +18,10 @@ module Fontist
10
18
  def self.ask(message, options = {})
11
19
  new.ask(message, options)
12
20
  end
21
+
22
+ def self.print(message)
23
+ super
24
+ end
13
25
  end
14
26
  end
15
27
  end
@@ -4,10 +4,11 @@ require "pathname"
4
4
  module Fontist
5
5
  module Utils
6
6
  module ZipExtractor
7
- def zip_extract(resource, download: true, fonts_sub_dir: "")
7
+ def zip_extract(resource, download: true, fonts_sub_dir: nil)
8
8
  zip_file = download_file(resource) if download
9
9
  zip_file ||= resource.urls.first
10
10
 
11
+ Fontist.ui.say(%(Installing font "#{key}".))
11
12
  fonts_paths = unzip_fonts(zip_file, fonts_sub_dir)
12
13
  block_given? ? yield(fonts_paths) : fonts_paths
13
14
  end
@@ -16,23 +17,36 @@ module Fontist
16
17
 
17
18
  private
18
19
 
19
- def unzip_fonts(file, fonts_sub_dir = "")
20
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
21
+ def unzip_fonts(file, subdir)
20
22
  Zip.on_exists_proc = true
21
- Array.new.tap do |fonts|
22
23
 
24
+ Array.new.tap do |fonts|
23
25
  Zip::File.open(file) do |zip_file|
24
- zip_file.glob("#{fonts_sub_dir}*.{ttf,ttc,otf}").each do |entry|
26
+ zip_file.each do |entry|
25
27
  if entry.name
26
- filename = Pathname.new(entry.name).basename
27
- font_path = fonts_path.join(filename.to_s)
28
- fonts.push(font_path.to_s)
28
+ filename = Pathname.new(entry.name).basename.to_s
29
+ if font_directory?(entry.name, subdir) && font_file?(filename)
30
+ target_filename = target_filename(filename)
31
+ font_path = fonts_path.join(target_filename)
32
+ fonts.push(font_path.to_s)
29
33
 
30
- entry.extract(font_path)
34
+ entry.extract(font_path)
35
+ end
31
36
  end
32
37
  end
33
38
  end
34
39
  end
35
40
  end
41
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
42
+
43
+ def font_directory?(path, subdir)
44
+ return true unless subdir
45
+
46
+ dirname = File.dirname(path)
47
+ normalized_pattern = subdir.chomp("/")
48
+ File.fnmatch?(normalized_pattern, dirname)
49
+ end
36
50
  end
37
51
  end
38
52
  end
@@ -1,3 +1,3 @@
1
1
  module Fontist
2
- VERSION = "1.3.0".freeze
2
+ VERSION = "1.7.0".freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  - Abu Nashir
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-08-09 00:00:00.000000000 Z
12
+ date: 2020-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: down
@@ -53,6 +53,34 @@ dependencies:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
55
  version: 2.3.0
56
+ - !ruby/object:Gem::Dependency
57
+ name: seven_zip_ruby
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '1.0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: ruby-ole
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '1.0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.0'
56
84
  - !ruby/object:Gem::Dependency
57
85
  name: thor
58
86
  requirement: !ruby/object:Gem::Requirement
@@ -67,6 +95,34 @@ dependencies:
67
95
  - - "~>"
68
96
  - !ruby/object:Gem::Version
69
97
  version: 1.0.1
98
+ - !ruby/object:Gem::Dependency
99
+ name: git
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '1.0'
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '1.0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: extract_ttc
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '0.1'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '0.1'
70
126
  - !ruby/object:Gem::Dependency
71
127
  name: pry
72
128
  requirement: !ruby/object:Gem::Requirement
@@ -123,85 +179,153 @@ dependencies:
123
179
  - - "~>"
124
180
  - !ruby/object:Gem::Version
125
181
  version: '3.0'
182
+ - !ruby/object:Gem::Dependency
183
+ name: rubocop
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - '='
187
+ - !ruby/object:Gem::Version
188
+ version: 0.75.0
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - '='
194
+ - !ruby/object:Gem::Version
195
+ version: 0.75.0
196
+ - !ruby/object:Gem::Dependency
197
+ name: rubocop-rails
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: '0'
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ - !ruby/object:Gem::Dependency
211
+ name: rubocop-performance
212
+ requirement: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
217
+ type: :development
218
+ prerelease: false
219
+ version_requirements: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: '0'
224
+ - !ruby/object:Gem::Dependency
225
+ name: ruby-protocol-buffers
226
+ requirement: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - "~>"
229
+ - !ruby/object:Gem::Version
230
+ version: '1.0'
231
+ type: :development
232
+ prerelease: false
233
+ version_requirements: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - "~>"
236
+ - !ruby/object:Gem::Version
237
+ version: '1.0'
126
238
  description: A libarary find or download fonts
127
239
  email:
128
240
  - operations@ribose.com
129
241
  - abunashir@gmail.com
130
- executables: []
242
+ executables:
243
+ - fontist
131
244
  extensions: []
132
245
  extra_rdoc_files: []
133
246
  files:
247
+ - ".github/workflows/check_google.yml"
134
248
  - ".github/workflows/macosx.yml"
135
249
  - ".github/workflows/ubuntu.yml"
136
250
  - ".github/workflows/windows.yml"
137
251
  - ".gitignore"
252
+ - ".hound.yml"
138
253
  - ".rspec"
254
+ - ".rubocop.yml"
139
255
  - Gemfile
140
256
  - LICENSE.txt
141
257
  - README.md
142
258
  - Rakefile
259
+ - bin/check_google
143
260
  - bin/console
261
+ - bin/convert_formulas
262
+ - bin/fontist
263
+ - bin/generate_otfinfo
264
+ - bin/import_google
144
265
  - bin/rspec
145
266
  - bin/setup
146
267
  - fontist.gemspec
147
268
  - lib/fontist.rb
269
+ - lib/fontist/cli.rb
148
270
  - lib/fontist/errors.rb
149
271
  - lib/fontist/font.rb
150
272
  - lib/fontist/font_formula.rb
273
+ - lib/fontist/fontist_font.rb
151
274
  - lib/fontist/formula.rb
275
+ - lib/fontist/formula_template.rb
152
276
  - lib/fontist/formulas.rb
153
- - lib/fontist/formulas/andale_font.rb
154
- - lib/fontist/formulas/arial_black_font.rb
155
- - lib/fontist/formulas/cleartype_fonts.rb
156
- - lib/fontist/formulas/comic_font.rb
157
- - lib/fontist/formulas/courier_font.rb
158
- - lib/fontist/formulas/euphemia_font.rb
159
- - lib/fontist/formulas/georgia_font.rb
160
- - lib/fontist/formulas/impact_font.rb
161
- - lib/fontist/formulas/montserrat_font.rb
162
- - lib/fontist/formulas/ms_truetype_fonts.rb
163
- - lib/fontist/formulas/open_sans_fonts.rb
164
- - lib/fontist/formulas/overpass_font.rb
165
- - lib/fontist/formulas/source_fonts.rb
166
- - lib/fontist/formulas/stix_fonts.rb
167
- - lib/fontist/formulas/tahoma_font.rb
168
- - lib/fontist/formulas/webding_font.rb
277
+ - lib/fontist/import.rb
278
+ - lib/fontist/import/convert_formulas.rb
279
+ - lib/fontist/import/create_formula.rb
280
+ - lib/fontist/import/extractors.rb
281
+ - lib/fontist/import/extractors/cab_extractor.rb
282
+ - lib/fontist/import/extractors/extractor.rb
283
+ - lib/fontist/import/extractors/ole_extractor.rb
284
+ - lib/fontist/import/extractors/seven_zip_extractor.rb
285
+ - lib/fontist/import/extractors/zip_extractor.rb
286
+ - lib/fontist/import/files/collection_file.rb
287
+ - lib/fontist/import/files/file_requirement.rb
288
+ - lib/fontist/import/files/font_detector.rb
289
+ - lib/fontist/import/formula_builder.rb
290
+ - lib/fontist/import/formula_serializer.rb
291
+ - lib/fontist/import/google.rb
292
+ - lib/fontist/import/google/fonts_public.md
293
+ - lib/fontist/import/google/fonts_public.pb.rb
294
+ - lib/fontist/import/google/fonts_public.proto
295
+ - lib/fontist/import/google/new_fonts_fetcher.rb
296
+ - lib/fontist/import/google/skiplist.yml
297
+ - lib/fontist/import/google_check.rb
298
+ - lib/fontist/import/google_import.rb
299
+ - lib/fontist/import/helpers/hash_helper.rb
300
+ - lib/fontist/import/helpers/system_helper.rb
301
+ - lib/fontist/import/otf/font_file.rb
302
+ - lib/fontist/import/otf_parser.rb
303
+ - lib/fontist/import/otf_style.rb
304
+ - lib/fontist/import/otfinfo/otfinfo_requirement.rb
305
+ - lib/fontist/import/otfinfo/template.erb
306
+ - lib/fontist/import/otfinfo_generate.rb
307
+ - lib/fontist/import/recursive_extraction.rb
308
+ - lib/fontist/import/template_helper.rb
309
+ - lib/fontist/import/text_helper.rb
310
+ - lib/fontist/manifest.rb
311
+ - lib/fontist/manifest/install.rb
312
+ - lib/fontist/manifest/locations.rb
169
313
  - lib/fontist/registry.rb
170
314
  - lib/fontist/system.yml
171
315
  - lib/fontist/system_font.rb
172
316
  - lib/fontist/utils.rb
317
+ - lib/fontist/utils/cache.rb
173
318
  - lib/fontist/utils/downloader.rb
174
319
  - lib/fontist/utils/dsl.rb
320
+ - lib/fontist/utils/dsl/collection_font.rb
321
+ - lib/fontist/utils/dsl/font.rb
175
322
  - lib/fontist/utils/exe_extractor.rb
323
+ - lib/fontist/utils/msi_extractor.rb
324
+ - lib/fontist/utils/seven_zip_extractor.rb
325
+ - lib/fontist/utils/system.rb
176
326
  - lib/fontist/utils/ui.rb
177
327
  - lib/fontist/utils/zip_extractor.rb
178
328
  - lib/fontist/version.rb
179
- - spec/fixtures/fonts/DejaVuSerif.ttf
180
- - spec/fontist/font_formula_spec.rb
181
- - spec/fontist/font_spec.rb
182
- - spec/fontist/formula_spec.rb
183
- - spec/fontist/formulas/andale_font_spec.rb
184
- - spec/fontist/formulas/arial_black_font_spec.rb
185
- - spec/fontist/formulas/cleartype_fonts_spec.rb
186
- - spec/fontist/formulas/comic_font_spec.rb
187
- - spec/fontist/formulas/courier_font_spec.rb
188
- - spec/fontist/formulas/euphemia_font_spec.rb
189
- - spec/fontist/formulas/georgia_font_spec.rb
190
- - spec/fontist/formulas/impact_font_spec.rb
191
- - spec/fontist/formulas/montserrat_font_spec.rb
192
- - spec/fontist/formulas/ms_truetype_fonts_spec.rb
193
- - spec/fontist/formulas/open_sans_fonts_spec.rb
194
- - spec/fontist/formulas/overpass_font_spec.rb
195
- - spec/fontist/formulas/source_fonts_spec.rb
196
- - spec/fontist/formulas/stix_fonts_spec.rb
197
- - spec/fontist/formulas/tahoma_font_spec.rb
198
- - spec/fontist/formulas/webding_font_spec.rb
199
- - spec/fontist/registry_spec.rb
200
- - spec/fontist/system_font_spec.rb
201
- - spec/fontist/utils/downloader_spec.rb
202
- - spec/fontist_spec.rb
203
- - spec/spec_helper.rb
204
- - spec/support/fontist_helper.rb
205
329
  homepage: https://github.com/fontist/fontist
206
330
  licenses:
207
331
  - BSD-2-Clause
@@ -209,7 +333,7 @@ metadata:
209
333
  homepage_uri: https://github.com/fontist/fontist
210
334
  source_code_uri: https://github.com/fontist/fontist
211
335
  changelog_uri: https://github.com/fontist/fontist
212
- post_install_message:
336
+ post_install_message: Please run `fontist update` to fetch formulas
213
337
  rdoc_options: []
214
338
  require_paths:
215
339
  - lib
@@ -224,8 +348,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
348
  - !ruby/object:Gem::Version
225
349
  version: '0'
226
350
  requirements: []
227
- rubygems_version: 3.0.4
228
- signing_key:
351
+ rubygems_version: 3.0.3
352
+ signing_key:
229
353
  specification_version: 4
230
354
  summary: A libarary find or download fonts
231
355
  test_files: []
@@ -1,80 +0,0 @@
1
- module Fontist
2
- module Formulas
3
- class AndaleFont < FontFormula
4
- key :andale_font
5
- desc "Microsoft TrueType Core fonts for the Web"
6
- homepage "https://www.microsoft.com"
7
-
8
- resource "andale32.exe" do
9
- urls [
10
- "https://gitlab.com/fontmirror/archive/-/raw/master/andale32.exe",
11
- "https://nchc.dl.sourceforge.net/project/corefonts/the%20fonts/final/andale32.exe",
12
- "http://sft.if.usp.br/msttcorefonts/andale32.exe"
13
- ]
14
- sha256 "0524fe42951adc3a7eb870e32f0920313c71f170c859b5f770d82b4ee111e970"
15
- end
16
-
17
- provides_font("Andale Mono", match_styles_from_file: {
18
- "Regular" => "AndaleMo.TTF"
19
- })
20
-
21
- def extract
22
- resource "andale32.exe" do |resource|
23
- cab_extract(resource) do |dir|
24
- match_fonts(dir, "Andale Mono")
25
- end
26
- end
27
-
28
- end
29
-
30
- def install
31
- case platform
32
- when :macos
33
- install_matched_fonts "$HOME/Library/Fonts/Microsoft"
34
- when :linux
35
- install_matched_fonts "/usr/share/fonts/truetype/vista"
36
- end
37
- end
38
-
39
- test do
40
- case platform
41
- when :macos
42
- assert_predicate "$HOME/Library/Fonts/Microsoft/AndaleMo.ttf", :exist?
43
- when :linux
44
- assert_predicate "/usr/share/fonts/truetype/vista/AndaleMo.ttf", :exist?
45
- end
46
- end
47
-
48
- requires_license_agreement <<~EOS
49
- (from http://web.archive.org/web/20011222020409/http://www.microsoft.com/typography/fontpack/eula.htm)
50
- TrueType core fonts for the Web EULA
51
- END-USER LICENSE AGREEMENT FOR
52
- MICROSOFT SOFTWARE
53
- IMPORTANT-READ CAREFULLY: This Microsoft End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation for the Microsoft software accompanying this EULA, which includes computer software and may include associated media, printed materials, and "on-line" or electronic documentation ("SOFTWARE PRODUCT" or "SOFTWARE"). By exercising your rights to make and use copies of the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, you may not use the SOFTWARE PRODUCT.
54
- SOFTWARE PRODUCT LICENSE
55
- The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.
56
- 1. GRANT OF LICENSE. This EULA grants you the following rights:
57
- * Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.
58
- * Reproduction and Distribution. You may reproduce and distribute an unlimited number of copies of the SOFTWARE PRODUCT; provided that each copy shall be a true and complete copy, including all copyright and trademark notices, and shall be accompanied by a copy of this EULA. Copies of the SOFTWARE PRODUCT may not be distributed for profit either on a standalone basis or included as part of your own product.
59
- 2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.
60
- * Limitations on Reverse Engineering, Decompilation, and Disassembly. You may not reverse engineer, decompile, or disassemble the SOFTWARE PRODUCT, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
61
- * Restrictions on Alteration. You may not rename, edit or create any derivative works from the SOFTWARE PRODUCT, other than subsetting when embedding them in documents.
62
- * Software Transfer. You may permanently transfer all of your rights under this EULA, provided the recipient agrees to the terms of this EULA.
63
- * Termination. Without prejudice to any other rights, Microsoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOFTWARE PRODUCT and all of its component parts.
64
- 3. COPYRIGHT. All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, text, and "applets" incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by Microsoft or its suppliers. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material.
65
- 4. U.S. GOVERNMENT RESTRICTED RIGHTS. The SOFTWARE PRODUCT and documentation are provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights at 48 CFR 52.227-19, as applicable. Manufacturer is Microsoft Corporation/One Microsoft Way/Redmond, WA 98052-6399.
66
- LIMITED WARRANTY
67
- NO WARRANTIES. Microsoft expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or noninfringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.
68
- NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall Microsoft or its suppliers be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this Microsoft product, even if Microsoft has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.
69
- MISCELLANEOUS
70
- If you acquired this product in the United States, this EULA is governed by the laws of the State of Washington.
71
- If this product was acquired outside the United States, then local laws may apply.
72
- Should you have any questions concerning this EULA, or if you desire to contact Microsoft for any reason, please contact the Microsoft subsidiary serving your country, or write: Microsoft Sales Information Center/One Microsoft Way/Redmond, WA 98052-6399.
73
- this page was last updated 28 July 1998
74
- © 1997 Microsoft Corporation. All rights reserved. Terms of use.
75
- comments to the MST group: ttwsite@microsoft.com
76
- EOS
77
- end
78
- end
79
-
80
- end