Michael Pohoreski
unread,Jun 18, 2017, 5:04:46 PM6/18/17You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I was bored this morning so let's chop, dissect, and re-assembly the WITWICS font.
First, we can save the font via AppleWin's debugger:
bsave "witwics_6x9.bin",f800:f8eb
Inspecting the font we notice
; Head Size: 182 bytes
; Data Size: 823 bytes
; ====================
; File Size: 1005 bytes
Let's get rid off that idiotic 16-bit offset header along with the explicit glyph height stored in each glyph and make it implicit -- since we KNOW this font is 9 scanlines -- that is 9 bytes / glyph. We will also move all the font metric data (width) into a separate table (array).
Original Font Size: 3ec
Optimized Font Size: 38e
That's a saving of a whopping $5E (94) bytes!
Here is the assembly source ...
- - - 8< opt6x9.s - - -
; ===========
; 6x9 Bitmaps
; ===========
glyphs6x9
DB $03,$03,$03,$03,$00,$03,$03,$00,$00 ; '!
DB $1B,$1B,$1B,$00,$00,$00,$00,$00,$00 ; '"
DB $36,$7F,$7F,$36,$7F,$7F,$36,$00,$00 ; '#
DB $3E,$6B,$0B,$3E,$68,$6B,$3E,$00,$00 ; '$
DB $63,$73,$38,$1C,$0E,$67,$63,$00,$00 ; '%
DB $07,$07,$05,$00,$35,$57,$35,$00,$00 ; '&
DB $03,$03,$03,$00,$00,$00,$00,$00,$00 ; ''
DB $0C,$06,$03,$03,$03,$06,$0C,$00,$00 ; '(
DB $03,$06,$0C,$0C,$0C,$06,$03,$00,$00 ; ')
DB $49,$2A,$1C,$7F,$1C,$2A,$49,$00,$00 ; '*
DB $00,$0C,$0C,$3F,$3F,$0C,$0C,$00,$00 ; '+
DB $00,$00,$00,$00,$00,$06,$06,$02,$01 ; ',
DB $00,$00,$00,$3F,$3F,$00,$00,$00,$00 ; '-
DB $00,$00,$00,$00,$00,$03,$03,$00,$00 ; '.
DB $60,$70,$38,$1C,$0E,$07,$03,$00,$00 ; '/
DB $1C,$3E,$63,$63,$63,$3E,$1C,$00,$00 ; '0
DB $0C,$0E,$0F,$0C,$0C,$0C,$3F,$00,$00 ; '1
DB $3E,$63,$60,$3E,$03,$03,$7F,$00,$00 ; '2
DB $3E,$63,$60,$38,$60,$63,$3E,$00,$00 ; '3
DB $38,$3C,$36,$33,$7F,$30,$30,$00,$00 ; '4
DB $7F,$03,$3E,$60,$60,$63,$3E,$00,$00 ; '5
DB $3E,$63,$03,$3F,$63,$63,$3E,$00,$00 ; '6
DB $3E,$63,$60,$30,$18,$0C,$0C,$00,$00 ; '7
DB $3E,$63,$63,$3E,$63,$63,$3E,$00,$00 ; '8
DB $3E,$63,$63,$7E,$60,$63,$3E,$00,$00 ; '9
DB $00,$00,$03,$03,$00,$03,$03,$00,$00 ; ':
DB $00,$00,$06,$06,$00,$06,$06,$02,$01 ; ';
DB $18,$0C,$06,$03,$06,$0C,$18,$00,$00 ; '<
DB $00,$3F,$3F,$00,$3F,$3F,$00,$00,$00 ; '=
DB $03,$06,$0C,$18,$0C,$06,$03,$00,$00 ; '>
DB $1E,$33,$18,$0C,$0C,$00,$0C,$00,$00 ; '?
DB $07,$05,$07,$3D,$10,$10,$10,$00,$00 ; '@
DB $0C,$1E,$33,$33,$3F,$33,$33,$00,$00 ; 'A
DB $1F,$33,$33,$1F,$33,$33,$1F,$00,$00 ; 'B
DB $1E,$33,$03,$03,$03,$33,$1E,$00,$00 ; 'C
DB $1F,$33,$33,$33,$33,$33,$1F,$00,$00 ; 'D
DB $3F,$03,$03,$1F,$03,$03,$3F,$00,$00 ; 'E
DB $3F,$03,$03,$1F,$03,$03,$03,$00,$00 ; 'F
DB $1E,$33,$03,$3B,$33,$33,$1E,$00,$00 ; 'G
DB $33,$33,$33,$3F,$33,$33,$33,$00,$00 ; 'H
DB $0F,$06,$06,$06,$06,$06,$0F,$00,$00 ; 'I
DB $30,$30,$30,$30,$30,$33,$1E,$00,$00 ; 'J
DB $33,$1B,$0F,$07,$0F,$1B,$33,$00,$00 ; 'K
DB $03,$03,$03,$03,$03,$03,$3F,$00,$00 ; 'L
DB $21,$33,$3F,$3F,$33,$33,$33,$00,$00 ; 'M
DB $33,$37,$37,$3F,$3B,$3B,$33,$00,$00 ; 'N
DB $1E,$33,$33,$33,$33,$33,$1E,$00,$00 ; 'O
DB $1F,$33,$33,$1F,$03,$03,$03,$00,$00 ; 'P
DB $1E,$33,$33,$33,$3B,$3B,$3E,$00,$00 ; 'Q
DB $1F,$33,$33,$1F,$0F,$1B,$33,$00,$00 ; 'R
DB $1E,$33,$03,$1E,$30,$33,$1E,$00,$00 ; 'S
DB $3F,$0C,$0C,$0C,$0C,$0C,$0C,$00,$00 ; 'T
DB $33,$33,$33,$33,$33,$33,$1E,$00,$00 ; 'U
DB $33,$33,$33,$33,$33,$1E,$0C,$00,$00 ; 'V
DB $33,$33,$33,$3F,$3F,$33,$21,$00,$00 ; 'W
DB $33,$33,$3F,$1E,$3F,$33,$33,$00,$00 ; 'X
DB $33,$33,$33,$1E,$0C,$0C,$0C,$00,$00 ; 'Y
DB $3F,$30,$18,$0C,$06,$03,$3F,$00,$00 ; 'Z
DB $0F,$03,$03,$03,$03,$03,$0F,$00,$00 ; '[
DB $03,$07,$0E,$1C,$38,$70,$60,$00,$00 ; '\
DB $0F,$0C,$0C,$0C,$0C,$0C,$0F,$00,$00 ; ']
DB $1E,$33,$00,$00,$00,$00,$00,$00,$00 ; '^
DB $00,$00,$00,$00,$00,$00,$00,$7F,$00 ; '_
DB $00,$00,$00,$00,$00,$06,$06,$02,$01 ; '`
DB $00,$00,$1E,$30,$3E,$33,$3E,$00,$00 ; 'a
DB $03,$03,$1F,$33,$33,$33,$1F,$00,$00 ; 'b
DB $00,$00,$1E,$33,$03,$33,$1E,$00,$00 ; 'c
DB $30,$30,$3E,$33,$33,$33,$3E,$00,$00 ; 'd
DB $00,$00,$1E,$33,$3F,$03,$1E,$00,$00 ; 'e
DB $1C,$06,$06,$0F,$06,$06,$06,$00,$00 ; 'f
DB $00,$00,$1E,$33,$33,$33,$3E,$30,$1E ; 'g
DB $03,$03,$1F,$33,$33,$33,$33,$00,$00 ; 'h
DB $03,$00,$03,$03,$03,$03,$03,$00,$00 ; 'i
DB $00,$18,$00,$18,$18,$18,$18,$1B,$0E ; 'j
DB $03,$03,$1B,$0F,$07,$0F,$1B,$00,$00 ; 'k
DB $03,$03,$03,$03,$03,$03,$03,$00,$00 ; 'l
DB $00,$00,$13,$3F,$3F,$33,$33,$00,$00 ; 'm
DB $00,$00,$1F,$33,$33,$33,$33,$00,$00 ; 'n
DB $00,$00,$1E,$33,$33,$33,$1E,$00,$00 ; 'o
DB $00,$00,$1F,$33,$33,$33,$1F,$03,$03 ; 'p
DB $00,$00,$3E,$33,$33,$33,$3E,$30,$30 ; 'q
DB $00,$00,$0F,$1B,$03,$03,$03,$00,$00 ; 'r
DB $00,$00,$1E,$03,$1E,$30,$1E,$00,$00 ; 's
DB $06,$06,$0F,$06,$06,$36,$1C,$00,$00 ; 't
DB $00,$00,$33,$33,$33,$33,$1E,$00,$00 ; 'u
DB $00,$00,$33,$33,$33,$1E,$0C,$00,$00 ; 'v
DB $00,$00,$33,$33,$3F,$3F,$12,$00,$00 ; 'w
DB $00,$00,$33,$33,$1E,$33,$33,$00,$00 ; 'x
DB $00,$00,$33,$33,$33,$33,$3E,$30,$1E ; 'y
DB $00,$00,$3F,$18,$0C,$06,$3F,$00,$00 ; 'z
DB $33,$33,$33,$3F,$3F,$33,$21,$00,$00 ; '{
; ===========
; 6x9 Metrics
; ===========
widths6x9
DB $02 ; '!
DB $05 ; '"
DB $07 ; '#
DB $07 ; '$
DB $07 ; '%
DB $07 ; '&
DB $02 ; ''
DB $04 ; '(
DB $04 ; ')
DB $07 ; '*
DB $06 ; '+
DB $03 ; ',
DB $06 ; '-
DB $02 ; '.
DB $07 ; '/
DB $07 ; '0
DB $07 ; '1
DB $07 ; '2
DB $07 ; '3
DB $07 ; '4
DB $07 ; '5
DB $07 ; '6
DB $07 ; '7
DB $07 ; '8
DB $07 ; '9
DB $02 ; ':
DB $03 ; ';
DB $05 ; '<
DB $06 ; '=
DB $05 ; '>
DB $06 ; '?
DB $06 ; '@
DB $06 ; 'A
DB $06 ; 'B
DB $06 ; 'C
DB $06 ; 'D
DB $06 ; 'E
DB $06 ; 'F
DB $06 ; 'G
DB $06 ; 'H
DB $04 ; 'I
DB $06 ; 'J
DB $06 ; 'K
DB $06 ; 'L
DB $06 ; 'M
DB $06 ; 'N
DB $06 ; 'O
DB $06 ; 'P
DB $06 ; 'Q
DB $06 ; 'R
DB $06 ; 'S
DB $06 ; 'T
DB $06 ; 'U
DB $06 ; 'V
DB $06 ; 'W
DB $06 ; 'X
DB $06 ; 'Y
DB $06 ; 'Z
DB $04 ; '[
DB $07 ; '\
DB $04 ; ']
DB $06 ; '^
DB $07 ; '_
DB $03 ; '`
DB $06 ; 'a
DB $06 ; 'b
DB $06 ; 'c
DB $06 ; 'd
DB $06 ; 'e
DB $05 ; 'f
DB $06 ; 'g
DB $06 ; 'h
DB $02 ; 'i
DB $05 ; 'j
DB $05 ; 'k
DB $02 ; 'l
DB $06 ; 'm
DB $06 ; 'n
DB $06 ; 'o
DB $06 ; 'p
DB $06 ; 'q
DB $05 ; 'r
DB $06 ; 's
DB $06 ; 't
DB $06 ; 'u
DB $06 ; 'v
DB $06 ; 'w
DB $06 ; 'x
DB $06 ; 'y
DB $06 ; 'z
DB $06 ; '{
Next post I'll show some code to render these glyphs.