savage-fontgen 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/savage-fontgen +10 -12
- data/lib/generate +8 -8
- data/savage-conf/config.yaml +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90f381b626a5beaeafbe5fd3709ee8199405b565
|
4
|
+
data.tar.gz: 14b380c47463dab2189d5d1cb3bef4dccaa5abbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 174f42d99154fabaffaa391887125d3e631cd30c22d322ca4833baeaf92325e7d61b544030a5016680170b506db8a5b0011aaa0a3d2718d7771d6f6287e402ea
|
7
|
+
data.tar.gz: c0b11a322113e95f2fd311b00eecc41d93c3cb7d9aefa8fa94038cc2a0cd6e449badd45ce834c3871e7120b4b73eaa756f7aa37d63c52956f46e1cc2348ea34f
|
data/bin/savage-fontgen
CHANGED
@@ -6,7 +6,7 @@ require 'colorize'
|
|
6
6
|
require 'erubis'
|
7
7
|
require 'yaml'
|
8
8
|
|
9
|
-
VERSION = '0.1.
|
9
|
+
VERSION = '0.1.2'
|
10
10
|
|
11
11
|
options = {}
|
12
12
|
OptionParser.new do |opts|
|
@@ -21,13 +21,9 @@ OptionParser.new do |opts|
|
|
21
21
|
opts.separator ""
|
22
22
|
opts.separator "Configuration options:"
|
23
23
|
|
24
|
-
opts.on "-q",
|
24
|
+
opts.on "-q", "--quiet", "Surpress output" do |o| options[:quiet] = o end
|
25
|
+
opts.on "-c FILE", "--config FILE", "Config File" do |o| options[:config_file] = o end
|
25
26
|
|
26
|
-
opts.on "--edit-conf", "Edit vhosts.yml" do |o|
|
27
|
-
system Vhost.conf['editor'], Vhost.conf_file
|
28
|
-
exit
|
29
|
-
end
|
30
|
-
|
31
27
|
# ==================
|
32
28
|
# = Common Options =
|
33
29
|
# ==================
|
@@ -36,7 +32,7 @@ OptionParser.new do |opts|
|
|
36
32
|
opts.separator "Common options:"
|
37
33
|
|
38
34
|
opts.on "-v", "--version", "Print version" do
|
39
|
-
puts "
|
35
|
+
puts "savage-fontgen - version #{VERSION}", ""
|
40
36
|
exit
|
41
37
|
end
|
42
38
|
|
@@ -57,13 +53,15 @@ end
|
|
57
53
|
|
58
54
|
@r_path = File.join(File.dirname(__FILE__), '..')
|
59
55
|
@source_path = ARGV[0]
|
56
|
+
|
60
57
|
@dest_path = options[:dest_path] || './out'
|
61
|
-
@conf_path = File.join
|
58
|
+
@conf_path = File.join(@r_path, 'savage-conf')
|
59
|
+
@conf_file = options[:config_file] || File.join(@conf_path, 'config.yaml')
|
62
60
|
|
63
|
-
`#{File.join(@r_path, 'lib/generate')} #{@source_path} #{@dest_path} #{
|
61
|
+
`#{File.join(@r_path, 'lib/generate')} #{@source_path} #{@dest_path} #{@conf_file}`
|
64
62
|
|
65
|
-
conf
|
66
|
-
glyphs
|
63
|
+
conf = YAML.load_file @conf_file
|
64
|
+
glyphs = YAML.load_file File.join(@dest_path, 'glyphs.yaml')
|
67
65
|
nocache = Time.now.to_i.to_s
|
68
66
|
|
69
67
|
glyphs.each do |name, unicode|
|
data/lib/generate
CHANGED
@@ -9,16 +9,10 @@ dest = sys.argv.pop()
|
|
9
9
|
src = sys.argv.pop()
|
10
10
|
|
11
11
|
def _mkdir(newdir):
|
12
|
-
"""works the way a good mkdir should :)
|
13
|
-
- already exists, silently complete
|
14
|
-
- regular file in the way, raise an exception
|
15
|
-
- parent directory(ies) does not exist, make them as well
|
16
|
-
"""
|
17
12
|
if os.path.isdir(newdir):
|
18
13
|
pass
|
19
14
|
elif os.path.isfile(newdir):
|
20
|
-
raise OSError("a file with the same name as the desired "
|
21
|
-
"dir, '%s', already exists." % newdir)
|
15
|
+
raise OSError("a file with the same name as the desired dir, '%s', already exists." % newdir)
|
22
16
|
else:
|
23
17
|
head, tail = os.path.split(newdir)
|
24
18
|
if head and not os.path.isdir(head):
|
@@ -30,8 +24,9 @@ def _mkdir(newdir):
|
|
30
24
|
font = fontforge.font()
|
31
25
|
font.fontname = config['fontname']
|
32
26
|
font.familyname = config['familyname']
|
27
|
+
font.em = config['em']
|
33
28
|
|
34
|
-
unicode =
|
29
|
+
unicode = 127744 # http://www.unicode.org/charts/#symbols - Miscellaneous Symbols And Pictographs
|
35
30
|
|
36
31
|
glyphs = dict()
|
37
32
|
|
@@ -46,7 +41,10 @@ for root, _, files in os.walk(src):
|
|
46
41
|
# Import the glyph info
|
47
42
|
glyph.importOutlines(os.path.join(src, "{}.svg".format(name)))
|
48
43
|
glyph.width = config['glyphwidth']
|
44
|
+
glyph.autoHint()
|
45
|
+
glyph.autoInstr()
|
49
46
|
unicode = unicode + 1
|
47
|
+
print glyph.validate()
|
50
48
|
|
51
49
|
_mkdir(os.path.join(dest, 'fonts'))
|
52
50
|
|
@@ -56,3 +54,5 @@ with open(os.path.join(dest, 'glyphs.yaml'), 'w') as outfile:
|
|
56
54
|
# Write the font from memory to a TTF file
|
57
55
|
for ext in config['formats']:
|
58
56
|
font.generate(os.path.join(dest, 'fonts', "{}.{}".format(config['fontname'], ext)))
|
57
|
+
|
58
|
+
font.generateFeatureFile(os.path.join(dest, 'features.txt'))
|
data/savage-conf/config.yaml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: savage-fontgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Clink
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|