Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tehmaze committed Sep 23, 2014
1 parent 8e4da17 commit 14ee27d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ build/
font/*/*/*.bin
font/*/*/*.hex
font/*/*/*.map
font/*/*/*.png
font/*/*/*.yml.1*
27 changes: 10 additions & 17 deletions bin/autotag
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -88,26 +85,22 @@ 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)
if csum in glyphs:
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
Expand Down
20 changes: 10 additions & 10 deletions font.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 14ee27d

Please sign in to comment.