diff options
| author | Jakob Fries <jakob.fries@gmail.com> | 2007-12-24 13:09:34 +0000 |
|---|---|---|
| committer | Jakob Fries <jakob.fries@gmail.com> | 2007-12-24 13:09:34 +0000 |
| commit | a02611511c1704c653e5951a44b294a953cdb470 (patch) | |
| tree | adf7232a41d0bd1133b82f8aea952af80a3f53be /scripts | |
| parent | 1ddfbba3666a835b59fc79b59aaae367ee93a6ea (diff) | |
| download | zcatch-a02611511c1704c653e5951a44b294a953cdb470.tar.gz zcatch-a02611511c1704c653e5951a44b294a953cdb470.zip | |
more font stuffs
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/font_converter.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/scripts/font_converter.py b/scripts/font_converter.py index f2ba0e49..0293c623 100644 --- a/scripts/font_converter.py +++ b/scripts/font_converter.py @@ -9,6 +9,7 @@ def convert(input, output): dic = {} for part in parts: + print parts, part key, value = part.split('=') try: @@ -19,8 +20,26 @@ def convert(input, output): return dic def get_entry(line): + while line[-1] == "\r" or line[-1] == "\n": + line = line[0:-1] + parts = [] + + quote = 0 + part = "" + + for c in line: + if c == "\"": + quote = 1-quote + elif c == " " and not quote: + if part: + parts.append(part) + part = "" + else: + part += c + + if part: + parts.append(part) - parts = line.split() type = parts[0] dic = build_dic(parts[1:]) @@ -80,7 +99,8 @@ def convert(input, output): kernings.append(None) def save_char(dic): - chars[dic["id"]] = dic + if dic["id"] < 256: + chars[dic["id"]] = dic def save_kerning(dic): kernings[dic["first"] + dic["second"]*256] = dic |