-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 1.008
- Loading branch information
Showing
21 changed files
with
422 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,5 @@ mincho7m | |
mincho9m | ||
LGC/Makefile | ||
HZMincho.zip | ||
intersect*.pe | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
def getfield(glyph, key): | ||
import re | ||
nwl = re.compile('\r?\n') | ||
field = re.compile(r'^\s*([\w\-]+)\s*:\s*(.+?)\s*$') | ||
rawlist = nwl.split(glyph.comment) | ||
fields = {} | ||
for line in rawlist: | ||
(name, value) = field.match(line).group(1, 2) | ||
fields[name] = value | ||
return fields[key] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,33 @@ Sans-serif Katakana and Figures, namely CIDs 20473 to 20496 and | |
20513 to 20522 are from | ||
[M+ 2m](http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/) font. | ||
|
||
Build-time dependencies | ||
----------------------- | ||
These softwares are required in order to build the font. | ||
Of course no special softwares required after once the font is built. | ||
|
||
KAGE engine is referred as a Git submodule. Do not forget | ||
`git submodule init && git submodule update` before you build. | ||
|
||
* [Fontforge][1] with Python and native script feature enabled | ||
* [Adobe Font Development Kit for OpenType][2] | ||
* JavaScript | ||
* [Perl][3] | ||
* [Ruby][4] | ||
* [SQLite3][5] | ||
* [Inkscape][6] | ||
* [ImageMagick][7] | ||
* [Potrace][8] | ||
|
||
[1]: http://fontforge.github.io/ | ||
[2]: http://www.adobe.com/devnet/opentype/afdko.html | ||
[3]: http://www.perl.org/ | ||
[4]: https://www.ruby-lang.org/ | ||
[5]: http://www.sqlite.org/ | ||
[6]: https://inkscape.org/ja/ | ||
[7]: http://www.imagemagick.org/ | ||
[8]: http://potrace.sourceforge.net/ | ||
|
||
Authors | ||
------- | ||
* Merged by MihailJP <[email protected]>. | ||
|
@@ -119,6 +146,11 @@ M+ font is free for any use. | |
Version History | ||
--------------- | ||
|
||
### Version 1.008, December 24, 2014 | ||
* Beta release | ||
* New overlap removal routine (rasterize then re-vectorize) | ||
* Make extra-bold font bolder | ||
|
||
### Version 1.007, November 22, 2014 | ||
* Beta release | ||
* Refined symbol glyphs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'optparse' | ||
op = OptionParser.new | ||
|
||
op.parse!(ARGV) | ||
|
||
@kagedat = {} | ||
@cache = {} | ||
|
||
def strokes(glyph) | ||
if not @cache.include?(glyph) then | ||
elements = @kagedat[glyph].split(/\$/) | ||
numOfStrokes = 0 | ||
for element in elements | ||
if element =~ /^99:/ then | ||
begin | ||
refName = element.split(/:/)[7] | ||
numOfStrokes += strokes(refName) | ||
rescue NoMethodError | ||
newestVer = @kagedat.keys.select {|x| x.start_with?("#{refName}@")}.map {|x| x.split(/@/)[1].to_i}.max | ||
numOfStrokes += strokes("#{refName}@#{newestVer}") | ||
end | ||
else | ||
numOfStrokes += 1 | ||
end | ||
end | ||
@cache[glyph] = numOfStrokes | ||
end | ||
@cache[glyph] | ||
end | ||
|
||
while l = gets | ||
l.chomp! | ||
(name, dat) = l.split(/\t/) | ||
@kagedat[name] = dat | ||
end | ||
|
||
glyphs = @kagedat.keys.select {|x| x =~ /^uf[0-9abcdef]{4}$/} | ||
|
||
for glyph in glyphs | ||
numOfStrokes = strokes(glyph) | ||
ratio = (1.0 - (1.0 / (1.0 + Math::E ** (3.0 - 0.5 * numOfStrokes)))) * (1.75 - 1.125) + 1.125 | ||
print "#{glyph}\t#{numOfStrokes}\t#{1.0 / ratio}\t#{ratio}\n" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env fontforge | ||
|
||
import fontforge | ||
import psMat | ||
from sys import argv, stderr | ||
from GlyphComment import getfield | ||
|
||
fontforge.setPrefs('CoverageFormatsAllowed', 1) | ||
|
||
if len(argv) < 4: | ||
stderr.write("Usage: "+argv[0]+" ratio infile outfile\n") | ||
quit(1) | ||
|
||
widthScale = None | ||
widthList = {} | ||
try: | ||
widthScale = float(argv[1]) | ||
except ValueError: | ||
import csv | ||
reader = csv.reader(open(argv[1]), delimiter='\t') | ||
for data in reader: | ||
widthList[data[0]] = float(data[3]) | ||
|
||
font = fontforge.open(argv[2]) | ||
for glyph in font.glyphs(): | ||
if glyph.isWorthOutputting(): | ||
kagename = getfield(glyph, "Kage") | ||
glyphWidth = glyph.width | ||
glyphScale = widthList[kagename] if kagename in widthList else widthScale | ||
if glyphScale != 1.0: | ||
glyph.transform(psMat.scale(glyphScale, 1.0), ("partialRefs", "round")) | ||
glyph.width = glyphWidth | ||
font.save(argv[3]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
# U+34B8 㒸 | ||
/^u34b8-02\t/c \ | ||
u34b8-02 2:0:7:100:30:89:51:66:73$1:0:1:102:26:150:26$2:27:0:150:26:165:54:183:67$1:0:0:90:59:162:59$2:32:7:125:59:110:81:75:103$2:7:4:106:81:147:123:130:183$2:32:7:121:98:104:120:73:139$2:32:7:133:124:107:158:62:180$2:0:7:173:84:162:98:144:116$2:7:0:132:59:146:143:181:172 | ||
/^u34b8-06-var-001\t/c \ | ||
u34b8-06-var-001 1:0:1:78:34:126:34$2:27:0:126:34:133:52:160:67$2:0:7:78:41:67:60:37:82$1:0:0:67:67:141:67$2:32:7:111:67:91:88:47:106$2:7:4:89:86:132:116:111:175$2:32:7:105:98:86:119:45:138$2:32:7:117:116:92:148:46:169$2:0:7:154:86:140:99:117:113$2:7:8:115:114:145:131:161:153 | ||
/^u34b8-06-var-008\t/c \ | ||
u34b8-06-var-008 2:0:7:78:41:67:60:37:82$1:0:1:78:34:126:34$2:27:0:126:34:133:52:160:67$1:0:0:67:67:141:67$2:32:7:111:67:91:87:47:104$2:7:4:89:85:132:114:111:172$2:32:7:105:97:86:117:45:136$2:32:7:117:114:92:145:46:166$2:0:7:154:85:140:98:117:111$2:7:0:115:112:138:141:161:150 | ||
/^u34b8-jv\t/c \ | ||
u34b8-jv 2:0:7:66:25:50:53:14:79$1:0:1:75:24:132:24$2:27:0:132:24:153:57:180:69$1:0:0:48:64:146:64$2:32:7:94:64:69:90:28:112$2:7:4:78:81:123:115:106:183$2:32:7:96:101:65:129:26:146$2:32:7:108:125:71:163:18:183$2:0:7:162:82:146:98:126:113$2:7:0:108:64:131:153:178:172 | ||
/^u34b8-var-004\t/c \ | ||
u34b8-var-004 2:0:7:66:25:50:53:14:79$1:0:1:75:24:132:24$2:27:0:132:24:153:57:180:69$1:0:0:48:64:146:64$2:0:7:93:67:69:90:28:112$2:7:4:78:81:123:115:106:183$2:32:7:96:101:65:129:26:146$2:32:7:108:125:71:163:18:183$2:0:7:162:82:146:98:126:113$2:7:0:111:74:133:153:178:172 | ||
|
||
# U+3563 㕣 | ||
/^u3563-02\t/c \ | ||
u3563-02 1:0:1:111:24:153:24$2:27:0:153:24:157:67:183:92$2:0:7:113:34:110:71:88:103$1:12:13:105:111:105:169$1:2:2:105:111:164:111$1:22:23:164:111:164:169$1:2:2:105:169:164:169 | ||
|
||
# U+4E41 乁 | ||
/^u4e41\t/c \ | ||
u4e41 1:0:1:62:31:111:31$2:27:0:111:31:119:144:179:181 | ||
/^cdp-89fc\t/c \ | ||
cdp-89fc 1:0:1:20:34:117:34$2:27:0:117:34:132:144:182:183 | ||
/^extf-00096\t/c \ | ||
extf-00096 1:0:1:40:31:111:31$2:27:0:111:31:119:144:179:181 | ||
/^u2f802\t/c \ | ||
u2f802 1:0:1:20:34:144:34$2:27:0:144:34:149:141:182:183 | ||
/^kx-008107\t/c \ | ||
kx-008107 1:0:1:69:26:100:26$2:27:0:100:26:98:144:181:178 | ||
|
||
# U+514C 兌 | ||
/^u514c-01\t/c \ | ||
u514c-01 2:0:7:41:28:31:67:12:88$1:0:1:46:25:70:25$2:27:0:70:25:76:64:95:86$1:12:13:34:63:34:110$1:2:2:34:63:77:63$1:22:23:77:63:77:110$1:2:2:34:110:77:110$2:0:7:48:112:43:174:13:188$1:32:0:62:110:62:164$2:0:7:49:175:73:155:97:135 | ||
/^u514c-02\t/c \ | ||
u514c-02 2:0:7:118:33:105:59:82:80$1:0:1:114:25:149:25$2:27:0:149:25:160:49:183:65$1:12:13:107:72:107:114$1:2:2:107:72:167:72$1:22:23:167:72:167:114$1:2:2:107:114:167:114$2:0:7:126:121:120:169:76:189$3:32:5:146:114:146:180:182:180 | ||
/^u514c-02-var-002\t/c \ | ||
u514c-02-var-002 2:0:7:118:33:105:59:82:80$1:0:1:114:25:149:25$2:27:0:149:25:160:49:183:65$1:12:13:107:72:107:114$1:2:2:107:72:167:72$1:22:23:167:72:167:114$1:2:2:107:114:167:114$2:32:7:127:114:120:169:76:189$3:32:5:146:114:146:180:182:180 | ||
/^u514c-05\t/c \ | ||
u514c-05 2:0:7:37:28:29:67:12:88$1:0:1:42:25:63:25$2:27:0:63:25:69:64:85:84$1:12:13:31:63:31:110$1:2:2:31:63:69:63$1:22:23:69:63:69:110$1:2:2:31:110:69:110$2:0:7:42:116:37:162:12:188$3:32:5:59:110:59:180:185:180 | ||
/^u514c-v02\t/c \ | ||
u514c-v02 2:0:7:120:30:105:59:82:80$1:0:1:101:25:149:25$2:27:0:149:25:160:49:183:65$1:12:13:107:72:107:114$1:2:2:107:72:167:72$1:22:23:167:72:167:114$1:2:2:107:114:167:114$2:0:7:127:119:120:169:76:189$3:0:5:146:119:146:180:182:180 | ||
|
||
# U+5165 入 | ||
/^u5165\t/c \ | ||
u5165 2:7:8:103:56:102:74:100:85$2:32:7:102:79:77:149:13:184$1:0:1:56:30:102:30$6:27:0:102:30:103:95:133:151:179:177 | ||
/^u5165-01\t/c \ | ||
u5165-01 1:0:1:25:39:55:39$2:27:0:55:32:54:124:82:151$2:32:7:52:73:50:140:14:164 | ||
/^u5165-02\t/c \ | ||
u5165-02 1:0:1:94:26:134:26$2:27:0:134:26:132:140:183:179$2:32:7:133:70:124:157:84:187$2:7:8:132:26:134:62:131:87 | ||
/^u5165-03\t/c \ | ||
u5165-03 2:32:7:102:25:74:72:12:106$1:0:1:61:25:106:25$2:27:0:106:25:139:74:182:93 | ||
|
||
# U+5167 內 | ||
/^u5167\t/c \ | ||
u5167 1:12:0:37:63:37:185$1:2:2:37:63:163:63$1:22:4:163:63:163:182$2:32:7:98:62:90:116:45:144$1:0:1:55:28:101:28$2:27:0:101:28:100:100:149:134 | ||
/^u5167-02\t/c \ | ||
u5167-02 1:12:0:98:60:98:185$1:2:2:98:60:174:60$1:22:4:174:60:174:182$2:32:7:136:60:130:113:102:142$1:0:1:106:27:136:27$2:27:0:136:27:136:98:165:134 | ||
/^u5167-05\t/c \ | ||
u5167-05 1:12:0:32:47:32:185$1:2:2:32:47:168:47$1:22:4:168:47:168:182$2:32:7:97:48:89:87:41:109$1:0:1:51:24:101:24$2:27:0:101:24:100:76:152:102 | ||
|
||
# U+516B 八 | ||
/^u516b\t/c \ | ||
u516b 1:0:1:64:39:123:39$2:27:0:123:39:131:137:180:173$2:0:7:74:68:56:154:12:183 | ||
/^u516b-02\t/c \ | ||
u516b-02 1:0:1:97:32:148:32$2:27:0:148:32:150:146:183:182$2:0:7:111:61:109:159:60:187 | ||
/^u516b-03\t/c \ | ||
u516b-03 2:0:7:68:37:54:77:12:105$1:0:1:74:28:128:28$2:27:0:128:28:141:73:181:95 | ||
/^u516b-05-var-007\t/c \ | ||
u516b-05-var-007 7:0:7:44:18:44:94:43:164:10:188$1:0:1:135:22:156:22$2:27:0:156:22:159:164:182:183 | ||
/^u516b-t\t/c \ | ||
u516b-t 2:0:7:74:49:66:136:12:188$1:0:1:103:39:122:39$2:27:0:122:39:137:137:183:180 | ||
/^u516b-t02\t/c \ | ||
u516b-t02 1:0:1:133:32:148:32$2:27:0:148:32:150:146:183:182$2:0:7:111:61:109:159:60:187 | ||
/^u516b-t03\t/c \ | ||
u516b-t03 2:0:7:68:37:54:77:12:105$1:0:1:104:28:128:28$2:27:0:128:28:141:73:181:95 | ||
|
||
# U+516C 公 | ||
/^u516c-ue0101\t/c \ | ||
u516c-ue0101 2:0:7:68:43:52:88:12:118$1:0:1:73:30:130:30$2:27:0:130:30:141:79:182:105$2:0:7:98:80:81:129:55:171$2:0:7:30:174:74:168:153:154$2:7:8:121:112:149:143:165:180 | ||
/^u516c-01-var-001\t/c \ | ||
u516c-01-var-001 2:0:7:40:38:35:76:12:113$1:0:1:40:25:67:25$2:27:0:67:25:78:79:97:100$2:0:7:55:80:46:127:33:169$2:0:7:21:172:43:166:82:152$2:7:8:66:111:80:139:87:169 | ||
/^u516c-02-var-001\t/c \ | ||
u516c-02-var-001 2:0:7:113:43:103:88:79:118$1:0:1:116:30:150:30$2:27:0:150:30:157:79:182:105$2:0:7:131:83:119:126:100:171$2:0:7:83:172:126:167:170:160$2:7:8:148:123:167:147:178:179 | ||
/^u516c-t07\t/c \ | ||
u516c-t07 2:0:7:68:43:52:88:12:118$1:0:1:73:30:130:30$2:27:0:130:30:141:79:182:105$99:0:0:11:65:188:188:u53b6-g | ||
|
||
# U+5173 关 | ||
/^u5173-02-var-001\t/c \ | ||
u5173-02-var-001 2:0:7:112:26:103:55:79:82$1:0:1:120:25:151:25$2:27:0:151:25:163:54:182:69$1:0:0:95:78:169:78$1:0:0:82:120:187:120$7:32:7:131:78:131:104:131:173:70:189$2:7:0:136:121:154:169:181:182 | ||
/^u5173-06-var-001\t/c \ | ||
u5173-06-var-001 1:0:1:75:50:114:50$2:27:0:114:50:118:68:152:78$2:0:7:83:56:71:74:43:84$1:0:0:65:82:134:82$1:0:0:43:111:156:111$7:32:7:100:82:100:99:99:144:41:161$2:7:8:94:121:127:131:144:156 | ||
/^u5173-var-004\t/c \ | ||
u5173-var-004 1:0:1:64:24:122:24$2:27:0:122:24:128:50:178:65$2:0:7:75:33:57:59:16:74$1:0:0:49:72:151:72$1:0:0:16:114:184:114$7:32:7:100:72:100:97:99:163:13:187$2:7:8:92:128:141:144:167:180 | ||
|
||
# U+5206 分 | ||
/^u5206-02\t/c \ | ||
u5206-02 2:0:7:108:40:99:79:71:102$1:0:1:109:27:145:27$2:27:0:145:27:152:69:182:91$1:0:2:85:103:159:103$2:22:4:159:103:161:157:147:180$2:32:7:116:103:116:167:62:188 | ||
/^u5206-02-var-002\t/c \ | ||
u5206-02-var-002 2:0:7:113:32:100:80:72:103$1:0:1:92:28:146:28$2:27:0:146:28:153:70:183:92$1:0:2:86:104:160:104$2:22:4:160:104:162:158:148:181$2:32:7:117:104:117:168:63:189 | ||
|
||
# U+66FD 曽 | ||
/^u66fd-var-001\t/c \ | ||
u66fd-var-001 2:0:7:67:33:51:59:11:76$1:0:1:72:25:138:25$2:27:0:131:25:145:54:181:67$99:0:0:12:52:188:124:u7530$99:0:0:20:120:180:190:u65e5 | ||
|
||
# U+66FE 曾 | ||
/^u66fe\t/c \ | ||
u66fe 2:0:7:67:33:51:59:11:76$1:0:1:72:25:131:25$2:27:0:131:25:145:54:181:67$99:0:0:0:-12:200:196:cdp-8b63-04 | ||
/^u66fe-ue0104\t/c \ | ||
u66fe-ue0104 2:0:7:67:33:51:59:11:76$1:0:1:72:25:131:25$2:27:0:131:25:145:54:181:67$1:0:0:70:50:133:50$99:0:0:0:-15:200:199:cdp-8b63-04 | ||
|
||
# U+76C6 盆 | ||
/^u76c6-02\t/c \ | ||
u76c6-02 2:0:7:117:33:105:59:80:76$1:0:1:114:27:154:27$2:27:0:154:27:167:56:182:67$1:2:2:101:69:163:69$2:22:4:163:69:165:97:154:114$2:32:7:132:69:124:105:84:122$1:12:32:101:129:101:183$1:2:2:101:129:168:129$1:22:32:168:129:168:183$1:32:32:123:129:123:183$1:32:32:146:129:146:183$1:0:0:80:183:188:183 | ||
/^u76c6-itaiji-001\t/c \ | ||
u76c6-itaiji-001 1:12:32:50:130:50:178$1:2:2:50:130:149:130$1:22:32:149:130:149:178$1:32:32:82:130:82:178$1:32:32:117:130:117:178$1:0:0:18:178:184:178$2:27:0:142:44:153:74:177:95$2:0:7:107:16:73:49:17:63$2:32:8:88:58:121:92:92:119$2:32:7:85:35:96:79:49:94$2:7:8:75:96:91:116:90:114$1:0:1:121:44:142:44 | ||
/^j83-4b5f\t/c \ | ||
j83-4b5f 2:0:7:66:30:52:58:13:80$1:0:1:74:25:128:25$2:27:0:128:25:147:57:180:67$1:2:2:48:65:144:65$2:22:4:144:65:146:93:128:113$2:32:7:97:65:83:110:26:121$99:0:0:0:-12:200:201:u76bf-04 | ||
|
||
# U+7A74 穴 | ||
/^u7a74-03-var-003\t/c \ | ||
u7a74-03-var-003 1:0:32:100:15:100:40$99:0:0:0:15:200:187:u5196-03$2:0:7:68:62:53:85:15:102$1:0:1:78:59:128:59$2:27:0:128:59:147:84:177:95 | ||
/^u7a74-k\t/c \ | ||
u7a74-k 99:0:0:8:0:195:234:u5b80-03$2:0:7:72:100:57:152:17:182$2:27:0:124:87:144:151:177:173$1:0:1:69:87:124:87 | ||
|
||
# U+7A7A 空 | ||
/^u7a7a-02-var-001\t/c \ | ||
u7a7a-02-var-001 1:0:32:130:16:130:43$2:7:8:87:32:91:55:81:71$1:0:2:89:43:177:43$2:22:7:177:43:174:55:164:71$2:0:7:112:78:102:104:76:125$1:0:1:110:68:147:68$2:27:0:147:68:159:99:181:113$1:0:0:90:129:175:129$1:32:32:130:129:130:182$1:0:0:78:182:185:182 | ||
|
||
# U+7FC1 翁 | ||
/^u7fc1-ue0101\t/c \ | ||
u7fc1-ue0101 1:0:1:69:24:132:24$2:27:0:132:24:142:51:182:68$2:0:7:69:31:54:60:13:78$2:0:7:103:42:88:64:64:87$2:0:7:40:87:83:82:143:76$2:7:8:115:56:141:70:157:90$1:0:2:27:106:89:106$1:22:4:89:106:89:183$2:7:8:32:118:54:123:65:139$2:0:7:24:169:52:159:79:146$1:0:2:108:106:169:106$1:22:4:169:106:169:182$2:7:8:111:118:134:123:144:139$2:0:7:106:167:131:159:161:145 | ||
/^u7fc1-ue0102\t/c \ | ||
u7fc1-ue0102 1:0:1:69:24:132:24$2:27:0:132:24:142:51:182:68$2:0:7:69:31:54:60:13:78$2:0:7:103:42:88:64:64:87$2:0:7:40:87:83:82:143:76$2:7:8:115:56:141:70:157:90$1:0:2:28:106:90:106$1:22:4:90:106:90:183$2:0:7:70:113:52:132:23:141$2:0:7:79:135:62:161:18:178$1:0:2:109:106:170:106$1:22:4:170:106:170:182$2:0:7:149:113:136:130:106:142$2:0:7:159:135:138:162:100:176 | ||
/^u7fc1-var-002\t/c \ | ||
u7fc1-var-002 1:0:1:69:24:132:24$2:27:0:132:24:142:51:182:68$2:0:7:69:31:54:60:13:78$2:0:7:103:42:88:64:64:87$2:0:7:40:87:83:82:143:76$2:7:8:115:56:141:70:157:90$1:0:2:20:108:88:108$1:22:4:88:108:88:182$2:32:7:73:108:54:127:21:145$2:32:7:88:131:54:166:22:178$1:0:2:102:108:170:108$1:22:4:170:108:170:182$2:32:7:154:108:137:127:104:145$2:32:7:170:131:136:166:104:178 | ||
|
||
# U+8089 肉 | ||
/^aj1-13967\t/c \ | ||
aj1-13967 1:12:0:36:54:36:185$1:2:2:36:54:165:54$1:22:4:165:54:165:182$2:32:7:99:54:89:90:47:115$1:0:1:56:28:102:28$2:27:0:102:28:103:81:149:107$2:0:7:104:97:92:135:48:160$2:7:8:97:118:131:134:147:154 | ||
|
||
# U+8555 蕕 | ||
/^u8555-ue0101\t/c \ | ||
u8555-ue0101 99:0:0:8:4:195:152:u8279-03$99:0:0:5:45:164:194:u72ad-01$1:0:0:97:86:160:86$1:12:13:91:108:91:173$1:2:2:91:108:165:108$1:22:23:165:108:165:173$7:32:7:116:86:116:108:116:130:96:146$3:32:5:135:86:135:136:153:136$1:0:0:101:155:156:155$1:2:2:91:173:165:173$2:0:7:102:60:91:87:69:103$2:27:0:151:60:165:84:181:94$1:0:1:111:60:151:60 | ||
/^u8555-ue0103\t/c \ | ||
u8555-ue0103 99:0:0:7:8:190:158:ufa5e-03@5$99:0:0:5:48:154:196:u72ad-01$1:0:0:93:91:154:91$1:12:13:84:111:84:175$1:2:2:84:111:163:111$1:22:23:163:111:163:175$7:32:7:110:91:110:111:110:143:84:153$3:32:5:130:91:130:143:152:143$1:2:2:84:161:163:161$1:2:2:84:175:163:175$2:27:0:146:69:159:93:182:106$2:0:7:101:67:89:98:63:118$1:0:1:116:69:146:69 | ||
|
||
# U+914B 酋 | ||
/^u914b\t/c \ | ||
u914b 2:0:7:67:23:50:61:16:89$1:0:1:81:23:134:23:0:0:0:0$2:27:0:134:23:152:60:181:72$1:0:0:58:61:148:61$1:12:13:48:91:48:171$1:2:2:48:91:157:91$1:22:23:157:91:157:171$7:32:7:87:62:87:89:87:118:60:139$3:32:5:114:62:114:122:140:122$1:2:2:48:147:157:147$1:2:2:48:171:157:171 | ||
/^u914b-02\t/c \ | ||
u914b-02 2:0:7:101:27:90:59:66:84$1:0:1:110:24:156:24$2:27:0:156:24:168:57:183:72$1:0:0:96:58:162:58$1:12:13:88:89:88:173$1:2:2:88:89:171:89$1:22:23:171:89:171:173$7:32:7:117:58:117:89:117:120:95:142$3:32:5:139:58:139:126:159:126$1:2:2:88:151:171:151$1:2:2:88:173:171:173 | ||
/^u914b-02-var-001\t/c \ | ||
u914b-02-var-001 2:0:7:101:27:90:59:66:84$1:0:1:110:24:156:24$2:27:0:156:24:168:57:183:72$1:0:0:96:58:162:58$1:12:13:88:89:88:173$1:2:2:88:89:171:89$1:22:23:171:89:171:173$7:32:7:117:58:117:89:117:120:95:142$3:32:5:139:58:139:126:159:126$1:0:0:100:152:161:152$1:2:2:88:173:171:173 | ||
/^u914b-var-001\t/c \ | ||
u914b-var-001 2:0:7:67:23:50:61:16:89$1:0:1:81:23:134:23$2:27:0:134:23:152:60:181:72$1:0:0:58:61:148:61$1:12:13:48:91:48:171$1:2:2:48:91:157:91$1:22:23:157:91:157:171$7:32:7:87:62:87:89:87:118:60:139$3:32:5:114:62:114:122:140:122$1:0:0:60:147:145:147$1:2:2:48:171:157:171 | ||
/^u914b-var-004\t/c \ | ||
u914b-var-004 2:0:7:67:23:50:61:16:89$1:0:1:81:23:134:23$2:27:0:134:23:152:60:180:72$1:0:0:58:61:148:61$1:12:13:45:90:45:173$1:2:2:45:90:161:90$1:22:23:161:90:161:173$7:32:7:85:61:85:90:87:130:55:140$3:32:5:115:61:115:123:145:123$1:2:0:45:153:142:153$1:2:2:45:173:161:173 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env ruby | ||
|
||
$numerator = 1 | ||
$denominator = 1 | ||
|
||
@filelist = {} | ||
|
||
require 'csv' | ||
|
||
require 'optparse' | ||
opt = OptionParser.new | ||
opt.on('-n', '--numerator=VAL', 'numerator of width scale (default: 1)') {|val| $numerator = val.to_i} | ||
opt.on('-d', '--denominator=VAL', 'denominator of width scale (default: 1)') {|val| $denominator = val.to_i} | ||
opt.on('-f', '--file=FILENAME', 'read width scale of each glyph from file') {|filename| | ||
CSV.foreach(filename, col_sep: "\t") {|row| | ||
@filelist[row[0]] = row[2].to_f | ||
} | ||
} | ||
opt.parse!(ARGV) | ||
|
||
while l = gets() | ||
l.chomp! | ||
if l =~ /^uf([0-9a-f]{4})\t/ then | ||
glyphName = l.split("\t")[0] | ||
arg = l.split("\t")[1].split(":") | ||
for i in [3, 5] | ||
if @filelist.empty? then | ||
arg[i] = (arg[i].to_f * $numerator / $denominator).round.to_s | ||
else | ||
arg[i] = (arg[i].to_f * @filelist[glyphName]).round.to_s | ||
end | ||
end | ||
l = "#{glyphName}\t#{arg.join(":")}" | ||
end | ||
puts l | ||
end |
Oops, something went wrong.