diff --git a/.gitignore b/.gitignore index ac2f376..fab5a2e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ build/ font/*/*/*.bin font/*/*/*.hex font/*/*/*.map +font/*/*/*.png font/*/*/*.yml.1* diff --git a/bin/autotag b/bin/autotag index 06e62c5..9ebe2d3 100755 --- a/bin/autotag +++ b/bin/autotag @@ -46,25 +46,22 @@ def findnth(string, sub, n): return s -def subnth(string, n, u): +def subunicode(data, subs): c = 0 - f = False o = [] for line in string.splitlines(): line = line.rstrip() if 'unicode:' in line: - if c == n: - o.append(' unicode: {}'.format(u)) - f = True + if c in subs: + o.append(' unicode: {}'.format(subs.pop(o))) else: o.append(line) - c += 1 else: o.append(line) - if f is False: - raise ValueError('{}th unicode char not found'.format(n)) + if len(subs): + raise ValueError('{} unicode characters remaining'.format(len(subs))) return '\n'.join(o) @@ -88,7 +85,7 @@ def run(): fout = fraw print 'got', len(font), 'glyphs' done = 0 - adds = 0 + subs = {} for i, glyph in enumerate(font): if glyph.character is None: csum = checksum(glyph.bitmap_raw) @@ -96,18 +93,14 @@ def run(): print 'char', i, 'unmapped looks like a ', glyphs[csum] print glyph.bitmap_raw print - glyph.character = glyphs[csum] - - fout = subnth( - fout, - i, - glyphs[csum], - ) - adds += 1 + subs[i] = glyphs[csum] else: done += 1 + adds = len(subs) print 'got', done, '+', adds, '=', (done + adds), '/', len(font) + if subs: + fout = subunicode(fout, subs) if fout != fraw: import time diff --git a/font.yaml b/font.yaml index 515258d..857e4fe 100644 --- a/font.yaml +++ b/font.yaml @@ -135,42 +135,42 @@ Commodore: source: "http://www.c64.com/games/138" Commodore Amiga: - amiga-b-strict: + amiga-b-strict-8x8: description: "B-Strict" source: "B-Girl" copyright: "Lukas Nystrand (aka Mortimer Twang)" - amiga-b-struct: + amiga-b-struct-8x8: description: "B-Struct" source: "B-Girl" copyright: "Lukas Nystrand (aka Mortimer Twang)" - amiga-microknight: + amiga-microknight-8x16: description: "MicroKnight" - amiga-microknightplus: + amiga-microknightplus-8x16: description: "MicroKnight (modified)" - amiga-mo-soul: + amiga-mo-soul-8x16: description: "mO'sOul" source: "mO'sOul" copyright: "Desoto" - amiga-p0t-noodle: + amiga-p0t-noodle-8x16: description: "P0T-NOoDLE" copyright: "Leo Davison (aka Nudel)" - amiga-topaz-a500: + amiga-topaz-a500-8x16: description: "Amiga Topaz Kickstart 1.x" source: "Kickstart v1.3 r34.5" copyright: "Commodore" copyright_year: 1987 - amiga-topaz-a1200: + amiga-topaz-a1200-8x16: description: "Amiga Topaz Kickstart 2.x" source: "Kickstart v3.1 r40.68" copyright: "Commodore" copyright_year: 1993 - amiga-topazplus-a500: + amiga-topazplus-a500-8x16: description: "Amiga Topaz Kickstart 1.x" variant: modified source: "Kickstart v2.04 r37.175" copyright: "Commodore" copyright_year: 1991 - amiga-topazplus-a1200: + amiga-topazplus-a1200-8x16: description: "Amiga Topaz Kickstart 2.x" variant: modified source: "Kickstart v3.1 r40.68"