patched up font to make it presentable. fontforge's svg import is... not great

This commit is contained in:
Adam Mayer 2017-12-27 16:13:39 -05:00
parent 8525bee4aa
commit af2679bab4
4 changed files with 2696 additions and 2692 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

2
roms/ff_import.py Normal file → Executable file
View File

@ -33,5 +33,5 @@ print "glyph count {}".format(len(font))
#print font.createChar(0x41)
#font[0x41].importOutlines("alpha_41.svg")
font.save("Apple410.ttf")
font.save("Apple410-new.sfd")

View File

@ -36,17 +36,17 @@ def unpack_byte(b):
return (x,y)
# H:W for a char is 3:2
def unpack_coords(b,xscale=66,yscale=100,xoff=10,yoff=10):
def unpack_coords(b,xscale=66,yscale=100,xoff=25,yoff=25):
"convert two 4-bit signed packed numbers to cairo coordinates"
(x,y) = unpack_byte(b)
return (x*xscale + xoff, (8 - y)*yscale + yoff)
def build_char_file(path, ft, offset):
surf = cairo.SVGSurface(path, 1000, 1220)
surf = cairo.SVGSurface(path, 800, 1280)
c = cairo.Context(surf)
d = list(get_char(ft, offset))
#c.set_source_rgb(0.0, 0.0, 0.0)
c.set_line_width(20)
c.set_line_width(40)
c.set_line_cap(cairo.LINE_CAP_ROUND)
c.set_line_join(cairo.LINE_JOIN_ROUND)
while d: