fontist 0.4.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) 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 -2
  5. data/README.md +87 -25
  6. data/lib/fontist.rb +28 -13
  7. data/lib/fontist/downloader.rb +11 -11
  8. data/lib/fontist/errors.rb +1 -0
  9. data/lib/fontist/font.rb +78 -0
  10. data/lib/fontist/font_formula.rb +116 -0
  11. data/lib/fontist/formula.rb +90 -0
  12. data/lib/fontist/formulas.rb +10 -5
  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 +225 -0
  16. data/lib/fontist/formulas/comic_font.rb +77 -0
  17. data/lib/fontist/formulas/courier_font.rb +67 -12
  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 +147 -0
  28. data/lib/fontist/formulas/webding_font.rb +77 -0
  29. data/lib/fontist/registry.rb +42 -0
  30. data/lib/fontist/{data/source.yml → system.yml} +0 -7
  31. data/lib/fontist/system_font.rb +9 -13
  32. data/lib/fontist/utils.rb +8 -0
  33. data/lib/fontist/utils/dsl.rb +73 -0
  34. data/lib/fontist/utils/exe_extractor.rb +72 -0
  35. data/lib/fontist/utils/zip_extractor.rb +38 -0
  36. data/lib/fontist/version.rb +1 -1
  37. data/spec/fontist/downloader_spec.rb +2 -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 +18 -19
  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 +6 -6
  59. data/spec/spec_helper.rb +4 -2
  60. data/spec/support/fontist_helper.rb +4 -2
  61. metadata +45 -25
  62. data/lib/fontist/data/formulas/courier.yml +0 -26
  63. data/lib/fontist/data/formulas/ms_system.yml +0 -68
  64. data/lib/fontist/data/formulas/ms_vista.yml +0 -118
  65. data/lib/fontist/data/formulas/source_font.yml +0 -163
  66. data/lib/fontist/finder.rb +0 -45
  67. data/lib/fontist/formula_finder.rb +0 -94
  68. data/lib/fontist/formulas/base.rb +0 -72
  69. data/lib/fontist/formulas/helpers/exe_extractor.rb +0 -45
  70. data/lib/fontist/formulas/helpers/zip_extractor.rb +0 -36
  71. data/lib/fontist/formulas/ms_system.rb +0 -29
  72. data/lib/fontist/formulas/ms_vista.rb +0 -42
  73. data/lib/fontist/formulas/source_font.rb +0 -25
  74. data/lib/fontist/installer.rb +0 -42
  75. data/lib/fontist/source.rb +0 -58
  76. data/spec/fontist/finder_spec.rb +0 -41
  77. data/spec/fontist/formula_finder_spec.rb +0 -54
  78. data/spec/fontist/formulas/ms_system_spec.rb +0 -31
  79. data/spec/fontist/formulas/ms_vista_spec.rb +0 -27
  80. data/spec/fontist/formulas/source_font_spec.rb +0 -18
  81. data/spec/fontist/installer_spec.rb +0 -48
  82. data/spec/fontist/source_spec.rb +0 -24
@@ -0,0 +1,77 @@
1
+ module Fontist
2
+ module Formulas
3
+ class ComicFont < FontFormula
4
+ desc "Microsoft TrueType Core fonts for the Web"
5
+ homepage "https://www.microsoft.com"
6
+
7
+ resource "comic32.exe" do
8
+ urls [
9
+ "https://nchc.dl.sourceforge.net/project/corefonts/the%20fonts/final/comic32.exe",
10
+ "http://sft.if.usp.br/msttcorefonts/comic32.exe"
11
+ ]
12
+ sha256 "9c6df3feefde26d4e41d4a4fe5db2a89f9123a772594d7f59afd062625cd204e"
13
+ end
14
+
15
+ provides_font("Comic Sans", match_styles_from_file: {
16
+ "Regular" => "Comic.TTF",
17
+ "Bold" => "Comicbd.TTF"
18
+ })
19
+
20
+ def extract
21
+ resource "comic32.exe" do |resource|
22
+ cab_extract(resource) do |dir|
23
+ match_fonts(dir, "Comic Sans")
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/vista"
34
+ end
35
+ end
36
+
37
+ test do
38
+ case platform
39
+ when :macos
40
+ assert_predicate "$HOME/Library/Fonts/Microsoft/Comic.ttf", :exist?
41
+ when :linux
42
+ assert_predicate "/usr/share/fonts/truetype/vista/Comic.ttf", :exist?
43
+ end
44
+ end
45
+
46
+ requires_license_agreement <<~EOS
47
+ (from http://web.archive.org/web/20011222020409/http://www.microsoft.com/typography/fontpack/eula.htm)
48
+ TrueType core fonts for the Web EULA
49
+ END-USER LICENSE AGREEMENT FOR
50
+ MICROSOFT SOFTWARE
51
+ 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.
52
+ SOFTWARE PRODUCT LICENSE
53
+ 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.
54
+ 1. GRANT OF LICENSE. This EULA grants you the following rights:
55
+ * Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.
56
+ * 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.
57
+ 2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.
58
+ * 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.
59
+ * 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.
60
+ * Software Transfer. You may permanently transfer all of your rights under this EULA, provided the recipient agrees to the terms of this EULA.
61
+ * 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.
62
+ 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.
63
+ 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.
64
+ LIMITED WARRANTY
65
+ 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.
66
+ 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.
67
+ MISCELLANEOUS
68
+ If you acquired this product in the United States, this EULA is governed by the laws of the State of Washington.
69
+ If this product was acquired outside the United States, then local laws may apply.
70
+ 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.
71
+ this page was last updated 28 July 1998
72
+ © 1997 Microsoft Corporation. All rights reserved. Terms of use.
73
+ comments to the MST group: ttwsite@microsoft.com
74
+ EOS
75
+ end
76
+ end
77
+ end
@@ -1,25 +1,80 @@
1
1
  module Fontist
2
2
  module Formulas
3
- class CourierFont < Base
4
- include Formulas::Helpers::ExeExtractor
3
+ class CourierFont < FontFormula
4
+ desc "Microsoft TrueType Core fonts for the Web"
5
+ homepage "https://www.microsoft.com"
5
6
 
6
- private
7
+ resource "courie32.exe" do
8
+ urls [
9
+ "https://nchc.dl.sourceforge.net/project/corefonts/the%20fonts/final/courie32.exe",
10
+ "http://sft.if.usp.br/msttcorefonts/courie32.exe"
11
+ ]
12
+ sha256 "bb511d861655dde879ae552eb86b134d6fae67cb58502e6ff73ec5d9151f3384"
13
+ end
14
+
15
+ provides_font("Courier", match_styles_from_file: {
16
+ "Regular" => "cour.ttf",
17
+ "Italic" => "couri.ttf",
18
+ "Bold Italic" => "courbi.ttf",
19
+ "Bold" => "courbd.ttf"
20
+ })
7
21
 
8
- def extract_fonts(font_names)
9
- resources("courier") do |resource|
10
- cab_extract(resource) do |fonts_dir|
11
- font_names.each do |font_name|
12
- match_fonts(fonts_dir, font_name)
13
- end
22
+ def extract
23
+ resource "courie32.exe" do |resource|
24
+ cab_extract(resource) do |dir|
25
+ match_fonts(dir, "Courier")
14
26
  end
15
27
  end
16
28
  end
17
29
 
18
- def check_user_license_agreement
19
- unless resources("courier").agreement === confirmation
20
- raise(Fontist::Errors::LicensingError)
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"
21
36
  end
22
37
  end
38
+
39
+ test do
40
+ case platform
41
+ when :macos
42
+ assert_predicate "$HOME/Library/Fonts/Microsoft/cour.ttf", :exist?
43
+ when :linux
44
+ assert_predicate "/usr/share/fonts/truetype/vista/cour.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
23
77
  end
24
78
  end
79
+
25
80
  end
@@ -0,0 +1,85 @@
1
+ module Fontist
2
+ module Formulas
3
+ class EuphemiaFont < FontFormula
4
+ desc "Euphemia Font"
5
+ homepage "https://www.tiro.com/syllabics/resources/index.html"
6
+
7
+ resource "euphemia.zip" do
8
+ url "https://www.tiro.com/syllabics/resources/compiled_data_sources/Fonts/Euphemia/%202.6.6%20Euphemia%20UCAS.zip"
9
+ sha256 "3a8a7181faf1a50e4cab35ad128ff11df7980c45e9c57e1f190f4355433b59f7"
10
+ end
11
+
12
+ provides_font("Euphemia UCAS", match_styles_from_file: {
13
+ "Italic" => "Euphemia UCAS Italic 2.6.6.ttf",
14
+ "Regular" => "Euphemia UCAS Regular 2.6.6.ttf",
15
+ "Bold" => "Euphemia UCAS Bold 2.6.6.ttf"
16
+ })
17
+
18
+ def extract
19
+ resource("euphemia.zip") do |resource|
20
+ zip_extract(resource) do |fontdir|
21
+ match_fonts(fontdir, "Euphemia UCAS")
22
+ end
23
+ end
24
+ end
25
+
26
+ def install
27
+ case platform
28
+ when :macos
29
+ install_matched_fonts "$HOME/Library/Fonts/Euphemia"
30
+ when :linux
31
+ install_matched_fonts "/usr/share/fonts/truetype/euphemia"
32
+ end
33
+ end
34
+
35
+ test do
36
+ case platform
37
+ when :macos
38
+ assert_predicate "$HOME/Library/Fonts/Euphemia/Euphemia UCAS Italic 2.6.6.ttf", :exist?
39
+ when :linux
40
+ assert_predicate "/usr/share/fonts/truetype/euphemia/Euphemia UCAS Italic 2.6.6.ttf", :exist?
41
+ end
42
+ end
43
+
44
+ license_url "https://www.tiro.com/syllabics/resources/euphemia_EULA.html"
45
+
46
+ open_license <<~EOS
47
+ FONT SOFTWARE PRODUCT LICENSE
48
+ The FONT SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The FONT SOFTWARE is licensed, not sold.
49
+
50
+ Subject to the foregoing, Tiro Typeworks grants you a perpetual non-exclusive license to use the Font Software with the following terms and conditions:
51
+
52
+ 1. ACCEPTANCE OF TERMS
53
+ Installation and use of this software constitutes acceptance of the terms of this licence agreement.
54
+
55
+ 2. GRANT OF LICENSE. This document grants you the following rights:
56
+ - Installation and Use. You may install and use the Font Software on up to 100 computers or users, provided that you agree to inform your employees or any other person having access to the Font Software and copies thereof, of the terms and conditions of this Font Software License Agreement and to ensure that they shall strictly abide by these terms and conditions. A Distribution Agreement must be purchased to in any form re-distribute the Font Software. Tiro Typeworks and its Licensed Distributors has the right to terminate your license immediately if you fail to comply with any term of this Agreement. Upon termination, you must destroy the original and any and all copies of the Font Software.
57
+
58
+ 2.1 You acknowledge that the Font Software is the intellectual property of Tiro Typeworks and/or its several licensors. The term Font Software shall also include any updates, upgrades, additions, modified versions, and work copies of the Font Software licensed to you by Tiro Typeworks. The media itself is and shall remain the property of Tiro Typeworks. Expanded versions, subsets or other derivatives of this design may also exist under other names and be distributed by Tiro Typeworks or other licensed Distributors.
59
+
60
+ 2.2 Modification. You are not allowed to without written approval granted by Tiro Typeworks:
61
+ - modify, reverse compile or merge or ship the Font Software with other software programs,
62
+ - adapt modules, produce sub-sets or supersets or alter any internal font data thereof for your own developments, or
63
+ - put the software solutions embodied in the Font Software to any commercial use other than operating your own computer or output device.
64
+ - modify and/or recompile the Font Software: this includes generating or re-compiling the Font Software from any font design program. (where a 'font design' program is any piece of software capable of reading and re-compiling any standard font format)
65
+
66
+ PLEASE CONTACT TIRO TYPEWORKS OR A LICENSED DISTRIBUTOR IF THERE ARE SPECIFIC MODIFICATIONS THAT YOU REQUIRE.
67
+
68
+ 2.3 You are only allowed to transfer or assign the Font-Software to a third party if such transfer complies with all of the following conditions:
69
+ - The recipient confirms their consent to all terms and conditions of this Font-Software License Agreement.
70
+
71
+ 2.4 Only for the purpose of outputting particular files may you take a copy of the font(s) you have used for such files to a commercial printer or other service bureau, and only if such service bureau has informed you that it has purchased or has been granted a license to use the respective Font-Software. As this font is distributed under a free license, any service bureau or commercial printer may also obtain a license with no cost associated with acquiring a license to the font(s). Only those parties specifically granted 'Distribution Rights' may distribute and grant licenses to the Font Software. Such Distribution Rights may be obtained by contacting Tiro Typeworks.
72
+
73
+ 2.5 Portable Documents. You may "embed" the Font Software within PostScript-Language files, .PDF files, and .EVY files for distribution, viewing, and imaging to other parties.
74
+
75
+ 3. Disclaimer and Limited Warranty.
76
+ AS ALLOWED BY LAW, THE SOFTWARE AND ACCOMPANYING WRITTEN MATERIALS ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, AND TIRO TYPEWORKS AND ASSOCIATIONS OR COMPANIES DISTRIBUTING THE FONT SOFTWARE DISCLAIMS THE WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE AND MERCHANTABILITY. IN ADDITION, TIRO TYPEWORKS AND ASSOCIATIONS OR COMPANIES DISTRIBUTING THE FONT SOFTWARE DOES NOT MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF THE SOFTWARE OR THE WRITTEN MATERIALS IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, CURRENTNESS OR OTHERWISE. THE ENTIRE RISK AS A RESULT OF THE PERFORMANCE OF THE SOFTWARE IS ASSUMED BY THE USER.
77
+
78
+ 4. Without limiting the generality of the foregoing, you agree that you will not distribute or disseminate all or any part of the Font Software through any on-line service and you further agree that any such intentional distribution shall constitute a theft by you of a valuable property of Tiro Typeworks and/or its suppliers.
79
+
80
+ 5. Governing Law
81
+ This agreement is governed by the laws of the Canada. In the event that any provision of this agreement is held to be illegal or otherwise unenforceable, such provision shall be deemed to have been deleted from this agreement, while the remaining provisions of this agreement shall be unaffected and shall continue in full force and effect.
82
+ EOS
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,79 @@
1
+ module Fontist
2
+ module Formulas
3
+ class GeorgiaFont < FontFormula
4
+ desc "Microsoft TrueType Core fonts for the Web"
5
+ homepage "https://www.microsoft.com"
6
+
7
+ resource "georgi32.exe" do
8
+ urls [
9
+ "https://nchc.dl.sourceforge.net/project/corefonts/the%20fonts/final/georgi32.exe",
10
+ "http://sft.if.usp.br/msttcorefonts/georgi32.exe"
11
+ ]
12
+ sha256 "2c2c7dcda6606ea5cf08918fb7cd3f3359e9e84338dc690013f20cd42e930301"
13
+ end
14
+
15
+ provides_font("Georgia", match_styles_from_file: {
16
+ "Regular" => "Georgia.TTF",
17
+ "Italic" => "Georgiai.TTF",
18
+ "Bold Italic" => "Georgiaz.TTF",
19
+ "Bold" => "Georgiab.TTF"
20
+ })
21
+
22
+ def extract
23
+ resource "georgi32.exe" do |resource|
24
+ cab_extract(resource) do |dir|
25
+ match_fonts(dir, "Georgia")
26
+ end
27
+ end
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/Georgia.ttf", :exist?
43
+ when :linux
44
+ assert_predicate "/usr/share/fonts/truetype/vista/Georgia.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
+ end
@@ -0,0 +1,77 @@
1
+ module Fontist
2
+ module Formulas
3
+ class ImpactFont < FontFormula
4
+ desc "Microsoft TrueType Core fonts for the Web"
5
+ homepage "https://www.microsoft.com"
6
+
7
+ resource "impact32.exe" do
8
+ urls [
9
+ "https://nchc.dl.sourceforge.net/project/corefonts/the%20fonts/final/impact32.exe",
10
+ "http://sft.if.usp.br/msttcorefonts/impact32.exe"
11
+ ]
12
+ sha256 "6061ef3b7401d9642f5dfdb5f2b376aa14663f6275e60a51207ad4facf2fccfb"
13
+ end
14
+
15
+ provides_font("Impact", match_styles_from_file: {
16
+ "Regular" => "Impact.TTF"
17
+ })
18
+
19
+ def extract
20
+ resource "impact32.exe" do |resource|
21
+ cab_extract(resource) do |dir|
22
+ match_fonts(dir, "Impact")
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/Impact.ttf", :exist?
40
+ when :linux
41
+ assert_predicate "/usr/share/fonts/truetype/vista/Impact.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,132 @@
1
+ module Fontist
2
+ module Formulas
3
+ class MontserratFont < FontFormula
4
+ desc "Montserrat Font"
5
+ homepage "https://github.com/JulietaUla/Montserrat"
6
+
7
+ resource "montserrat.zip" do
8
+ url "https://www.fontsquirrel.com/fonts/download/montserrat"
9
+
10
+ # Same issue here
11
+ # sha256 "ea1d3721cba61e4de81f4425dee191c904e44129c07d825082d70ee4e168c437"
12
+ end
13
+
14
+ provides_font("Montserrat", match_styles_from_file: {
15
+ "Thin" => "Montserrat-Thin.otf",
16
+ "ThinItalic" => "Montserrat-ThinItalic.otf",
17
+ "ExtraLight" => "Montserrat-ExtraLight.otf",
18
+ "ExtraLight Italic" => "Montserrat-ExtraLightItalic.otf",
19
+ "Light" => "Montserrat-Light.otf",
20
+ "Light Italic" => "Montserrat-LightItalic.otf",
21
+ "Regular" => "Montserrat-Regular.otf",
22
+ "Italic" => "Montserrat-Italic.otf",
23
+ "Medium" => "Montserrat-Medium.otf",
24
+ "Medium Italic" => "Montserrat-MediumItalic.otf",
25
+ "SemiBold" => "Montserrat-SemiBold.otf",
26
+ "SemiBold Italic" => "Montserrat-SemiBoldItalic.otf",
27
+ "Bold" => "Montserrat-Bold.otf",
28
+ "Bold Italic" => "Montserrat-BoldItalic.otf",
29
+ "ExtraBold" => "Montserrat-ExtraBold.otf",
30
+ "ExtraBold Italic" => "Montserrat-ExtraBoldItalic.otf",
31
+ "Black" => "Montserrat-Black.otf",
32
+ "Black Italic" => "Montserrat-BlackItalic.otf"
33
+ })
34
+
35
+ provides_font("Montserrat Alternates", match_styles_from_file: {
36
+ "Thin" => "MontserratAlternates-Thin.otf",
37
+ "Thin Italic" => "MontserratAlternates-ThinItalic.otf",
38
+ "ExtraLight" => "MontserratAlternates-ExtraLight.otf",
39
+ "ExtraLight Italic" => "MontserratAlternates-ExtraLightItalic.otf",
40
+ "Light" => "MontserratAlternates-Light.otf",
41
+ "Light Italic" => "MontserratAlternates-LightItalic.otf",
42
+ "Regular" => "MontserratAlternates-Regular.otf",
43
+ "Italic" => "MontserratAlternates-Italic.otf",
44
+ "Medium" => "MontserratAlternates-Medium.otf",
45
+ "Medium Italic" => "MontserratAlternates-MediumItalic.otf",
46
+ "SemiBold" => "MontserratAlternates-SemiBold.otf",
47
+ "SemiBold Italic" => "MontserratAlternates-SemiBoldItalic.otf",
48
+ "Bold" => "MontserratAlternates-Bold.otf",
49
+ "Bold Italic" => "MontserratAlternates-BoldItalic.otf",
50
+ "ExtraBold" => "MontserratAlternates-ExtraBold.otf",
51
+ "ExtraBold Italic" => "MontserratAlternates-ExtraBoldItalic.otf",
52
+ "Black" => "MontserratAlternates-Black.otf",
53
+ "Black Italic" => "MontserratAlternates-BlackItalic.otf",
54
+ })
55
+
56
+ def extract
57
+ resource("montserrat.zip") do |resource|
58
+ zip_extract(resource) do |fontdir|
59
+ match_fonts(fontdir, "Montserrat")
60
+ match_fonts(fontdir, "Montserrat Alternates")
61
+ end
62
+ end
63
+ end
64
+
65
+ def install
66
+ case platform
67
+ when :macos
68
+ install_matched_fonts "$HOME/Library/Fonts/Montserrat"
69
+ when :linux
70
+ install_matched_fonts "/usr/share/fonts/truetype/montserrat"
71
+ end
72
+ end
73
+
74
+ test do
75
+ case platform
76
+ when :macos
77
+ assert_predicate "$HOME/Library/Fonts/Montserrat/MontserratAlternates-Thin.otf", :exist?
78
+ when :linux
79
+ assert_predicate "/usr/share/fonts/truetype/montserrat/MontserratAlternates-Thin.otf", :exist?
80
+ end
81
+ end
82
+
83
+ open_license <<~EOS
84
+ Copyright 2011 The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat)
85
+
86
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
87
+ This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
88
+
89
+ -----------------------------------------------------------
90
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
91
+ -----------------------------------------------------------
92
+
93
+ PREAMBLE
94
+ 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 framework in which fonts may be shared and improved in partnership with others.
95
+
96
+ 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.
97
+
98
+ DEFINITIONS
99
+ "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.
100
+
101
+ "Reserved Font Name" refers to any names specified as such after the copyright statement(s).
102
+
103
+ "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
104
+
105
+ "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.
106
+
107
+ "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
108
+
109
+ PERMISSION & CONDITIONS
110
+ 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:
111
+
112
+ 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
113
+
114
+ 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, 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.
115
+
116
+ 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.
117
+
118
+ 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.
119
+
120
+ 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.
121
+
122
+ TERMINATION
123
+ This license becomes null and void if any of the above conditions are not met.
124
+
125
+ DISCLAIMER
126
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, 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.
127
+
128
+ EOS
129
+
130
+ end
131
+ end
132
+ end