fontist 0.2.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macosx.yml +1 -1
  3. data/.github/workflows/ubuntu.yml +1 -1
  4. data/.gitignore +4 -3
  5. data/README.md +91 -5
  6. data/fontist.gemspec +1 -0
  7. data/lib/fontist.rb +26 -8
  8. data/lib/fontist/errors.rb +3 -0
  9. data/lib/fontist/font.rb +78 -0
  10. data/lib/fontist/font_formula.rb +123 -0
  11. data/lib/fontist/formula.rb +90 -0
  12. data/lib/fontist/formulas.rb +15 -0
  13. data/lib/fontist/formulas/andale_font.rb +79 -0
  14. data/lib/fontist/formulas/arial_black_font.rb +78 -0
  15. data/lib/fontist/formulas/cleartype_fonts.rb +226 -0
  16. data/lib/fontist/formulas/comic_font.rb +77 -0
  17. data/lib/fontist/formulas/courier_font.rb +80 -0
  18. data/lib/fontist/formulas/euphemia_font.rb +85 -0
  19. data/lib/fontist/formulas/georgia_font.rb +79 -0
  20. data/lib/fontist/formulas/impact_font.rb +77 -0
  21. data/lib/fontist/formulas/montserrat_font.rb +132 -0
  22. data/lib/fontist/formulas/ms_truetype_fonts.rb +124 -0
  23. data/lib/fontist/formulas/open_sans_fonts.rb +263 -0
  24. data/lib/fontist/formulas/overpass_font.rb +73 -0
  25. data/lib/fontist/formulas/source_fonts.rb +109 -0
  26. data/lib/fontist/formulas/stix_fonts.rb +108 -0
  27. data/lib/fontist/formulas/tahoma_font.rb +146 -0
  28. data/lib/fontist/formulas/webding_font.rb +77 -0
  29. data/lib/fontist/registry.rb +42 -0
  30. data/lib/fontist/system.yml +17 -0
  31. data/lib/fontist/system_font.rb +19 -12
  32. data/lib/fontist/utils.rb +9 -0
  33. data/lib/fontist/utils/downloader.rb +74 -0
  34. data/lib/fontist/utils/dsl.rb +77 -0
  35. data/lib/fontist/utils/exe_extractor.rb +72 -0
  36. data/lib/fontist/utils/zip_extractor.rb +38 -0
  37. data/lib/fontist/version.rb +1 -1
  38. data/spec/fontist/font_formula_spec.rb +67 -0
  39. data/spec/fontist/font_spec.rb +87 -0
  40. data/spec/fontist/formula_spec.rb +67 -0
  41. data/spec/fontist/formulas/andale_font_spec.rb +29 -0
  42. data/spec/fontist/formulas/arial_black_font_spec.rb +29 -0
  43. data/spec/fontist/formulas/cleartype_fonts_spec.rb +38 -0
  44. data/spec/fontist/formulas/comic_font_spec.rb +29 -0
  45. data/spec/fontist/formulas/courier_font_spec.rb +29 -0
  46. data/spec/fontist/formulas/euphemia_font_spec.rb +29 -0
  47. data/spec/fontist/formulas/georgia_font_spec.rb +29 -0
  48. data/spec/fontist/formulas/impact_font_spec.rb +29 -0
  49. data/spec/fontist/formulas/montserrat_font_spec.rb +29 -0
  50. data/spec/fontist/formulas/ms_truetype_fonts_spec.rb +29 -0
  51. data/spec/fontist/formulas/open_sans_fonts_spec.rb +29 -0
  52. data/spec/fontist/formulas/overpass_font_spec.rb +29 -0
  53. data/spec/fontist/formulas/source_fonts_spec.rb +31 -0
  54. data/spec/fontist/formulas/stix_fonts_spec.rb +29 -0
  55. data/spec/fontist/formulas/tahoma_font_spec.rb +29 -0
  56. data/spec/fontist/formulas/webding_font_spec.rb +29 -0
  57. data/spec/fontist/registry_spec.rb +47 -0
  58. data/spec/fontist/system_font_spec.rb +16 -0
  59. data/spec/fontist/{downloader_spec.rb → utils/downloader_spec.rb} +8 -8
  60. data/spec/spec_helper.rb +7 -2
  61. data/spec/support/fontist_helper.rb +10 -0
  62. metadata +65 -14
  63. data/assets/source.yml +0 -54
  64. data/lib/fontist/downloader.rb +0 -69
  65. data/lib/fontist/finder.rb +0 -47
  66. data/lib/fontist/installer.rb +0 -44
  67. data/lib/fontist/ms_vista_font.rb +0 -83
  68. data/lib/fontist/source.rb +0 -31
  69. data/spec/fontist/finder_spec.rb +0 -41
  70. data/spec/fontist/installer_spec.rb +0 -48
  71. data/spec/fontist/ms_vista_font_spec.rb +0 -27
  72. data/spec/fontist/source_spec.rb +0 -13
@@ -0,0 +1,109 @@
1
+ module Fontist
2
+ module Formulas
3
+ class SourceFonts < FontFormula
4
+ desc "Adobe Source Fonts"
5
+ homepage "https://www.adobe.com"
6
+
7
+ resource "source-fonts.zip" do
8
+ url "https://github.com/fontist/source-fonts/releases/download/v1.0/source-fonts-1.0.zip"
9
+ sha256 "0107b5d4ba305cb4dff2ba19138407aa2153632a2c41592f74d20cd0d0261bfd"
10
+ end
11
+
12
+ provides_font("Source Code Pro", match_styles_from_file: {
13
+ "Black" => "SourceCodePro-Black.ttf",
14
+ "Black Italic" => "SourceCodePro-BlackIt.ttf",
15
+ "Bold" => "SourceCodePro-Bold.ttf",
16
+ "Bold Italic" => "SourceCodePro-BoldIt.ttf",
17
+ "Extra Light" => "SourceCodePro-ExtraLight.ttf",
18
+ "ExtraLightIt" => "SourceCodePro-ExtraLightIt.ttf",
19
+ "Italic" => "SourceCodePro-It.ttf",
20
+ "Light" => "SourceCodePro-Light.ttf",
21
+ "Light Italic" => "SourceCodePro-LightIt.ttf",
22
+ "Medium" => "SourceCodePro-Medium.ttf",
23
+ "Medium Italic" => "SourceCodePro-MediumIt.ttf",
24
+ "Regular" => "SourceCodePro-Regular.ttf",
25
+ "Semibold" => "SourceCodePro-Semibold.ttf",
26
+ "Semibold Italic" => "SourceCodePro-SemiboldIt.ttf",
27
+ })
28
+
29
+ provides_font("Source Sans Pro", match_styles_from_file: {
30
+ "Black" => "SourceSansPro-Black.ttf",
31
+ "Black Italic" => "SourceSansPro-BlackIt.ttf",
32
+ "Bold" => "SourceSansPro-Bold.ttf",
33
+ "Bold Italic" => "SourceSansPro-BoldIt.ttf",
34
+ "Extra Light" => "SourceSansPro-ExtraLight.ttf",
35
+ "ExtraLightIt" => "SourceSansPro-ExtraLightIt.ttf",
36
+ "Italic" => "SourceSansPro-It.ttf",
37
+ "Light" => "SourceSansPro-Light.ttf",
38
+ "Light Italic" => "SourceSansPro-LightIt.ttf",
39
+ "Medium" => "SourceSansPro-Medium.ttf",
40
+ "Medium Italic" => "SourceSansPro-MediumIt.ttf",
41
+ "Regular" => "SourceSansPro-Regular.ttf",
42
+ "Semibold" => "SourceSansPro-Semibold.ttf",
43
+ "Semibold Italic" => "SourceSansPro-SemiboldIt.ttf",
44
+ })
45
+
46
+ provides_font("Source Serif Pro", match_styles_from_file: {
47
+ "Black" => "SourceSerifPro-Black.ttf",
48
+ "Black Italic" => "SourceSerifPro-BlackIt.ttf",
49
+ "Bold" => "SourceSerifPro-Bold.ttf",
50
+ "Bold Italic" => "SourceSerifPro-BoldIt.ttf",
51
+ "Extra Light" => "SourceSerifPro-ExtraLight.ttf",
52
+ "ExtraLightIt" => "SourceSerifPro-ExtraLightIt.ttf",
53
+ "Italic" => "SourceSerifPro-It.ttf",
54
+ "Light" => "SourceSerifPro-Light.ttf",
55
+ "Light Italic" => "SourceSerifPro-LightIt.ttf",
56
+ "Medium" => "SourceSerifPro-Medium.ttf",
57
+ "Medium Italic" => "SourceSerifPro-MediumIt.ttf",
58
+ "Regular" => "SourceSerifPro-Regular.ttf",
59
+ "Semibold" => "SourceSerifPro-Semibold.ttf",
60
+ "Semibold Italic" => "SourceSerifPro-SemiboldIt.ttf",
61
+ })
62
+
63
+ %w(ExtraLight Light Normal Regular Bold Heavy).each do |style|
64
+ provides_font_collection do |coll|
65
+ filename "SourceHanSans-#{style}.ttc"
66
+
67
+ ["", " TC", " K", " HC", " SC"].each do |variant|
68
+ provides_font "Source Hans Sans#{variant}", extract_styles_from_collection: {
69
+ style.to_s => {
70
+ name: "Source Hans Sans#{variant}",
71
+ style: style
72
+ }
73
+ }
74
+ end
75
+ end
76
+ end
77
+
78
+ def extract
79
+ resource("source-fonts.zip") do |resource|
80
+ zip_extract(resource, fonts_sub_dir: "fonts/") do |fontdir|
81
+ match_fonts(fontdir, "Source Code Pro")
82
+ match_fonts(fontdir, "Source Sans Pro")
83
+ match_fonts(fontdir, "Source Serif Pro")
84
+ match_fonts(fontdir, "Source Han Sans")
85
+ end
86
+ end
87
+ end
88
+
89
+ def install
90
+ case platform
91
+ when :macos
92
+ install_matched_fonts "$HOME/Library/Fonts/Microsoft"
93
+ when :linux
94
+ install_matched_fonts "/usr/share/fonts/truetype/microsoft"
95
+ end
96
+ end
97
+
98
+ test do
99
+ case platform
100
+ when :macos
101
+ assert_predicate "$HOME/Library/Fonts/Microsoft/tahoma.ttf", :exist?
102
+ when :linux
103
+ assert_predicate "/usr/share/fonts/truetype/microsoft/tahoma.ttf", :exist?
104
+ end
105
+ end
106
+
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,108 @@
1
+ module Fontist
2
+ module Formulas
3
+ class StixFont < FontFormula
4
+ desc "stixfonts"
5
+ homepage "https://www.stixfonts.org"
6
+
7
+ resource "stix.zip" do
8
+ url "https://github.com/stipub/stixfonts/raw/master/zipfiles/STIXv2.0.2.zip"
9
+ sha256 "fef26941bf7eeab7ed6400a386211ba11360f0b2df22002382ceb3e2b551179d"
10
+ end
11
+
12
+ provides_font("STIX Two Math", match_styles_from_file: {
13
+ "Regular" => "STIX2Math.otf"
14
+ })
15
+
16
+ provides_font("STIX Two Text", match_styles_from_file: {
17
+ "Bold" => "STIX2Text-Bold.otf",
18
+ "Bold Italic" => "STIX2Text-BoldItalic.otf",
19
+ "Italic" => "STIX2Text-Italic.otf",
20
+ "Regular" => "STIX2Text-Regular.otf"
21
+ })
22
+
23
+ def extract
24
+ resource("stix.zip") do |resource|
25
+ unzip(resource, fonts_sub_dir: "**/*") do |fontdir|
26
+ match_fonts(fontdir, "STIX Two Math")
27
+ match_fonts(fontdir, "STIX Two Text")
28
+ end
29
+ end
30
+ end
31
+
32
+ def install
33
+ case platform
34
+ when :macos
35
+ install_matched_fonts "$HOME/Library/Fonts/STIX"
36
+ when :linux
37
+ install_matched_fonts "/usr/share/fonts/truetype/stix"
38
+ end
39
+ end
40
+
41
+ test do
42
+ case platform
43
+ when :macos
44
+ assert_predicate "$HOME/Library/Fonts/STIX/STIX2Math.otf", :exist?
45
+ when :linux
46
+ assert_predicate "/usr/share/fonts/truetype/stix/STIX2Math.otf", :exist?
47
+ end
48
+ end
49
+
50
+ open_license <<~EOS
51
+ STIX Font License
52
+ 15 April 2019
53
+
54
+ Copyright © 2001–2019 by the STI Pub Companies, consisting of AIP Publishing, the American Chemical Society, the American Mathematical Society, the American Physical Society, Elsevier, Inc., and The Institute of Electrical and Electronic Engineers, Inc. (www.stixfonts.org), with Reserved Font Name STIX Fonts. STIX FontsTM is a trademark of The Institute of Electrical and Electronics Engineers, Inc.
55
+
56
+ Portions copyright © 1998–2003 by MicroPress, Inc. (www.micropress-inc.com), with Reserved Font Name TM Math. To obtain additional mathematical fonts, please contact MicroPress, Inc., 68-30 Harrow Street, Forest Hills, NY 11375, USA – Phone: (718) 575-1816.
57
+ Portions copyright © 1990 by Elsevier, Inc.
58
+ Portions copyright © 2010, 2012, 2014 Adobe Systems Incorporated.
59
+
60
+ This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at http://scripts.sil.org/OFL.
61
+
62
+ --------------------------------------------------
63
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
64
+ --------------------------------------------------
65
+ PREAMBLE
66
+
67
+ The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open frame- work in which fonts may be shared and improved in partnership with others.
68
+
69
+ The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
70
+
71
+ DEFINITIONS
72
+
73
+ “Font Software” refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
74
+
75
+ “Reserved Font Name” refers to any names specified as such after the copyright statement(s).
76
+
77
+ “Original Version” refers to the collection of Font Software components as distributed by the Copyright Holder(s).
78
+
79
+ “Modified Version” refers to any derivative made by adding to, deleting, or substituting – in part or in whole – any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
80
+
81
+ “Author” refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
82
+
83
+ PERMISSION & CONDITIONS
84
+
85
+ Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
86
+
87
+ 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
88
+
89
+ 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any soft- ware, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
90
+
91
+ 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
92
+
93
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
94
+
95
+ 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
96
+
97
+ TERMINATION
98
+
99
+ This license becomes null and void if any of the above conditions are not met.
100
+
101
+ DISCLAIMER
102
+
103
+ THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FIT- NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADE- MARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, IN- CIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
104
+
105
+ EOS
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,146 @@
1
+ module Fontist
2
+ module Formulas
3
+ class TahomaFont < FontFormula
4
+ desc "Microsoft Tahoma Font"
5
+ homepage "https://www.microsoft.com"
6
+
7
+ resource "IELPKTH.CAB" do
8
+ urls [
9
+ "https://master.dl.sourceforge.net/project/corefonts/OldFiles/IELPKTH.CAB"
10
+ ]
11
+
12
+ sha256 "c1be3fb8f0042570be76ec6daa03a99142c88367c1bc810240b85827c715961a"
13
+ end
14
+
15
+ provides_font("Tahoma", match_styles_from_file: {
16
+ "Regular" => "tahoma.ttf",
17
+ "Bold" => "tahomabd.ttf"
18
+ })
19
+
20
+ def extract
21
+ resource("IELPKTH.CAB") do |resource|
22
+ cab_extract(resource) do |fontdir|
23
+ match_fonts(fontdir, "Tahoma")
24
+ end
25
+ end
26
+ end
27
+
28
+ def install
29
+ case platform
30
+ when :macos
31
+ install_matched_fonts "$HOME/Library/Fonts/Microsoft"
32
+ when :linux
33
+ install_matched_fonts "/usr/share/fonts/truetype/microsoft"
34
+ end
35
+ end
36
+
37
+ test do
38
+ case platform
39
+ when :macos
40
+ assert_predicate "$HOME/Library/Fonts/Microsoft/tahoma.ttf", :exist?
41
+ when :linux
42
+ assert_predicate "/usr/share/fonts/truetype/microsoft/tahoma.ttf", :exist?
43
+ end
44
+ end
45
+
46
+ requires_license_agreement <<~EOS
47
+ Microsoft Viewer for Word
48
+ END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE
49
+
50
+ ------------------------
51
+ IMPORTANT-READ CAREFULLY: This Microsoft End-User License Agreement
52
+ ("EULA") is a legal agreement between you (either an individual or a single
53
+ entity) and Microsoft Corporation for the Microsoft software accompanying
54
+ this EULA, which includes computer software and may include associated
55
+ media, printed materials, and "online" or electronic documentation
56
+ ("SOFTWARE PRODUCT" or "SOFTWARE"). By exercising your rights to make and
57
+ use copies of the SOFTWARE PRODUCT, you agree to be bound by the terms of
58
+ this EULA. If you do not agree to the terms of this EULA, you may not use
59
+ the SOFTWARE PRODUCT.
60
+
61
+ ------------------------
62
+ Software PRODUCT LICENSE
63
+
64
+ The SOFTWARE PRODUCT is protected by copyright laws and international
65
+ copyright treaties, as well as other intellectual property laws and
66
+ treaties. The SOFTWARE PRODUCT is licensed, not sold.
67
+
68
+ 1. GRANT OF LICENSE. This EULA grants you the following rights:
69
+ - Installation and Use. You may install and use an unlimited number of
70
+ copies of the SOFTWARE PRODUCT.
71
+ - Reproduction and Distribution. You may reproduce and distribute an
72
+ unlimited number of copies of the SOFTWARE PRODUCT; provided that each
73
+ copy shall be a true and complete copy, including all copyright and
74
+ trademark notices, and shall be accompanied by a copy of this EULA. Copies
75
+ of the SOFTWARE PRODUCT may be distributed as a standalone product or
76
+ included with your own product.
77
+
78
+ 2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.
79
+ - Limitations on Reverse Engineering, Decompilation, and Disassembly. You
80
+ ay not reverse engineer, decompile, or disassemble the SOFTWARE PRODUCT,
81
+ except and only to the extent that such activity is expressly permitted by
82
+ applicable law notwithstanding this limitation.
83
+ - Separation of Components. The SOFTWARE PRODUCT is licensed as a single
84
+ product. Its component parts may not be separated for use on more than one
85
+ computer.
86
+ - Software Transfer. You may permanently transfer all of your rights under
87
+ this EULA, provided the recipient agrees to the terms of this EULA.
88
+ - Termination. Without prejudice to any other rights, Microsoft may
89
+ terminate this EULA if you fail to comply with the terms and conditions of
90
+ this EULA. In such event, you must destroy all copies of the SOFTWARE
91
+ PRODUCT and all of its component parts.
92
+
93
+ 3. COPYRIGHT. All title and copyrights in and to the SOFTWARE PRODUCT
94
+ (including but not limited to any images, photographs, animations, video,
95
+ audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT),
96
+ the accompanying printed materials, and any copies of the SOFTWARE PRODUCT
97
+ are owned by Microsoft or its suppliers. The SOFTWARE PRODUCT is protected
98
+ by copyright laws and international treaty provisions. Therefore, you must
99
+ treat the SOFTWARE PRODUCT like any other copyrighted material.
100
+
101
+ 4. U.S. GOVERNMENT RESTRICTED RIGHTS. The SOFTWARE PRODUCT and
102
+ documentation are provided with RESTRICTED RIGHTS. Use, duplication, or
103
+ disclosure by the Government is subject to restrictions as set forth in
104
+ subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer
105
+ Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of
106
+ the Commercial Computer Software-Restricted Rights at 48 CFR 52.227-19, as
107
+ applicable. Manufacturer is Microsoft Corporation/One Microsoft
108
+ Way/Redmond, WA 98052-6399.
109
+
110
+ ----------------
111
+ LIMITED WARRANTY
112
+
113
+ NO WARRANTIES. Microsoft expressly disclaims any warranty for the SOFTWARE
114
+ PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as
115
+ is" without warranty of any kind, either express or implied, including,
116
+ without limitation, the implied warranties or merchantability, fitness for
117
+ a particular purpose, or noninfringement. The entire risk arising out of
118
+ use or performance of the SOFTWARE PRODUCT remains with you.
119
+
120
+ NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall Microsoft or its
121
+ suppliers be liable for any damages whatsoever (including, without
122
+ limitation, damages for loss of business profits, business interruption,
123
+ loss of business information, or any other pecuniary loss) arising out of
124
+ the use of or inability to use this Microsoft product, even if Microsoft
125
+ has been advised of the possibility of such damages. Because some
126
+ states/jurisdictions do not allow the exclusion or limitation of liability
127
+ for consequential or incidental damages, the above limitation may not apply
128
+ to you.
129
+
130
+ --------------
131
+ Miscellaneous:
132
+
133
+ If you acquired this product in the United States, this EULA is governed by
134
+ the laws of the State of Washington.
135
+
136
+ If this product was acquired outside the United States, then local laws may
137
+ apply.
138
+
139
+ Should you have any questions concerning this EULA, or if you desire to
140
+ contact Microsoft for any reason, please contact the Microsoft subsidiary
141
+ serving your country, or write: Microsoft Sales Information Center/One
142
+ Microsoft Way/Redmond, WA 98052-6399.
143
+ EOS
144
+ end
145
+ end
146
+ end
@@ -0,0 +1,77 @@
1
+ module Fontist
2
+ module Formulas
3
+ class WebdingFont < FontFormula
4
+ desc "Microsoft TrueType Core fonts for the Web"
5
+ homepage "https://www.microsoft.com"
6
+
7
+ resource "webdin32.exe" do
8
+ urls [
9
+ "https://nchc.dl.sourceforge.net/project/corefonts/the%20fonts/final/webdin32.exe",
10
+ "http://sft.if.usp.br/msttcorefonts/webdin32.exe"
11
+ ]
12
+ sha256 "64595b5abc1080fba8610c5c34fab5863408e806aafe84653ca8575bed17d75a"
13
+ end
14
+
15
+ provides_font("Webdings", match_styles_from_file: {
16
+ "Regular" => "Webdings.TTF"
17
+ })
18
+
19
+ def extract
20
+ resource "webdin32.exe" do |resource|
21
+ cab_extract(resource) do |dir|
22
+ match_fonts(dir, "Webdings")
23
+ end
24
+ end
25
+ end
26
+
27
+ def install
28
+ case platform
29
+ when :macos
30
+ install_matched_fonts "$HOME/Library/Fonts/Microsoft"
31
+ when :linux
32
+ install_matched_fonts "/usr/share/fonts/truetype/vista"
33
+ end
34
+ end
35
+
36
+ test do
37
+ case platform
38
+ when :macos
39
+ assert_predicate "$HOME/Library/Fonts/Microsoft/Webdings.ttf", :exist?
40
+ when :linux
41
+ assert_predicate "/usr/share/fonts/truetype/vista/Webdings.ttf", :exist?
42
+ end
43
+ end
44
+
45
+ requires_license_agreement <<~EOS
46
+ (from http://web.archive.org/web/20011222020409/http://www.microsoft.com/typography/fontpack/eula.htm)
47
+ TrueType core fonts for the Web EULA
48
+ END-USER LICENSE AGREEMENT FOR
49
+ MICROSOFT SOFTWARE
50
+ 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.
51
+ SOFTWARE PRODUCT LICENSE
52
+ 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.
53
+ 1. GRANT OF LICENSE. This EULA grants you the following rights:
54
+ * Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.
55
+ * 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.
56
+ 2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.
57
+ * 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.
58
+ * 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.
59
+ * Software Transfer. You may permanently transfer all of your rights under this EULA, provided the recipient agrees to the terms of this EULA.
60
+ * 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.
61
+ 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.
62
+ 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.
63
+ LIMITED WARRANTY
64
+ 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.
65
+ 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.
66
+ MISCELLANEOUS
67
+ If you acquired this product in the United States, this EULA is governed by the laws of the State of Washington.
68
+ If this product was acquired outside the United States, then local laws may apply.
69
+ 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.
70
+ this page was last updated 28 July 1998
71
+ © 1997 Microsoft Corporation. All rights reserved. Terms of use.
72
+ comments to the MST group: ttwsite@microsoft.com
73
+ EOS
74
+ end
75
+ end
76
+
77
+ end
@@ -0,0 +1,42 @@
1
+ module Fontist
2
+ class Registry
3
+ include Singleton
4
+
5
+ def initialize
6
+ @formulas ||= {}
7
+ end
8
+
9
+ def formulas
10
+ parse_to_object(@formulas)
11
+ end
12
+
13
+ def self.formulas
14
+ instance.formulas
15
+ end
16
+
17
+ def self.register(formula, key = nil)
18
+ key ||= formula.instance.key || formula.to_s
19
+ instance.register(formula, key)
20
+ end
21
+
22
+ def register(formula, key)
23
+ @formulas[key] = build_formula_data(formula)
24
+ end
25
+
26
+ private
27
+
28
+ def build_formula_data(formula)
29
+ {
30
+ installer: formula,
31
+ fonts: formula.instance.fonts,
32
+ license: formula.instance.license,
33
+ homepage: formula.instance.homepage ,
34
+ description: formula.instance.description,
35
+ }
36
+ end
37
+
38
+ def parse_to_object(data)
39
+ JSON.parse(data.to_json, object_class: OpenStruct)
40
+ end
41
+ end
42
+ end