This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfonts.rb
145 lines (124 loc) · 3.42 KB
/
fonts.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
dep "all-fonts" do
requires "forza.otf",
"hack.ttf",
"gothamc.otf",
"idlewild.otf",
"vitesse.otf",
"opensans.ttf",
"source sans.otf",
"sullivan.otf",
"crimson.otf",
"mensch.ttf",
"roboto.ttf",
"metropolis.otf",
"league-gothic.otf",
"deconeue.ttf"
end
dep "user font dir exists" do
met? {
"~/Library/Fonts".p.dir?
}
meet {
log_shell "Creating ~/Library/Fonts", "mkdir ~/Library/Fonts"
}
end
meta "ttf" do
accepts_list_for :source
accepts_list_for :ttf_filename
template {
requires "user font dir exists"
met? {
"~/Library/Fonts/#{ttf_filename.first}".p.exists?
}
meet {
source.each do |uri|
Babushka::Resource.extract(uri) do
Dir.glob("*.ttf") do |font|
log_shell "Installing #{font}", "cp #{font} ~/Library/Fonts"
end
end
end
}
}
end
meta "otf" do
accepts_list_for :source
accepts_list_for :otf_filename
template {
requires "user font dir exists"
met? {
"~/Library/Fonts/#{otf_filename.first}".p.exists?
}
meet {
source.each do |uri|
Babushka::Resource.extract(uri) do
Dir.glob("**/*.otf") do |font|
log_shell "Installing #{font}", "cp #{font} ~/Library/Fonts"
end
end
end
}
}
end
dep "forza.otf" do
source "https://dl.dropboxusercontent.com/u/103175/Fonts/Forza.zip"
otf_filename "Forza-Black.otf"
end
dep "league-gothic.otf" do
source "https://github.com/theleagueof/league-gothic/archive/master.zip"
otf_filename "LeagueGothic-Regular.otf"
end
dep "hack.ttf" do
source "https://dl.dropboxusercontent.com/u/103175/Fonts/Hack-ttf.zip"
ttf_filename "Hack-Bold.ttf"
end
dep "roboto.ttf" do
source "https://dl.dropboxusercontent.com/u/103175/Fonts/roboto.zip"
ttf_filename "Roboto-Medium.ttf"
end
dep "gothamc.otf" do
source "https://dl.dropboxusercontent.com/u/103175/Fonts/GothamCond.zip"
otf_filename "GothamCond-Black.otf"
end
dep "idlewild.otf" do
source "https://dl.dropboxusercontent.com/u/103175/Fonts/Idlewild.zip"
otf_filename "Idlewild-Bold.otf"
end
dep "vitesse.otf" do
source "https://dl.dropboxusercontent.com/u/103175/Fonts/Vitesse.zip"
otf_filename "Vitesse-Black.otf"
end
dep "sullivan.otf" do
source "https://dl.dropboxusercontent.com/u/103175/Fonts/Sullivan.zip"
otf_filename "Sullivan-Regular.otf"
end
dep "opensans.ttf" do
source "https://dl.dropboxusercontent.com/u/103175/Fonts/OpenSans.zip"
ttf_filename "OpenSans-Bold.ttf"
end
dep "source sans.otf" do
source "https://github.com/adobe-fonts/source-sans-pro/archive/2.010R-ro/1.065R-it.zip"
otf_filename "SourceSansPro-Black.otf"
end
dep "crimson.otf" do
source "http://internode.dl.sourceforge.net/project/crimsontext/crimson_101217.zip"
otf_filename "Crimson-Roman.otf"
end
dep "mensch.ttf" do
ttf_filename "Mensch.ttf"
meet {
`curl https://dl.dropboxusercontent.com/u/103175/Fonts/Mensch.ttf > ~/Library/Fonts/Mensch.ttf`
}
end
dep "metropolis.otf" do
otf_filename "Metropolis.otf"
meet {
`curl https://dl.dropboxusercontent.com/u/103175/Fonts/Metropolis.otf > ~/Library/Fonts/Metropolis.otf`
}
end
dep "deconeue.ttf" do
ttf_filename "DecoNeue-Light.ttf"
meet {
`curl https://dl.dropboxusercontent.com/u/103175/Fonts/DecoNeue-Light.ttf > ~/Library/Fonts/DecoNeue-Light.ttf`
}
end