Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

extracted BDF font from TRS-80

  • Loading branch information...
commit 854d3200aa66a9328ea1c277167675da2e8087fa 1 parent f08b1d4
@phooky authored
Showing with 1,491 additions and 0 deletions.
  1. +1,435 −0 TRS-80_model100/eprom-font.bdf
  2. +56 −0 TRS-80_model100/font-extract.py
View
1,435 TRS-80_model100/eprom-font.bdf
@@ -0,0 +1,1435 @@
+STARTFONT 2.1
+FONT -osbourne-charrom-medium-r-normal--16-160-75-75-c-80-iso10646-1
+SIZE 16 75 75
+FONTBOUNDINGBOX 8 8 0 0
+STARTPROPERTIES 2
+FONT_ASCENT 7
+FONT_DESCENT 1
+ENDPROPERTIES
+CHARS 95
+STARTCHAR U+0020
+ENCODING 32
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR U+0021
+ENCODING 33
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+04
+04
+04
+04
+00
+00
+04
+00
+ENDCHAR
+STARTCHAR U+0022
+ENCODING 34
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0A
+0A
+0A
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR U+0023
+ENCODING 35
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0A
+0A
+1F
+0A
+1F
+0A
+0A
+00
+ENDCHAR
+STARTCHAR U+0024
+ENCODING 36
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+04
+0F
+14
+0E
+05
+1E
+04
+00
+ENDCHAR
+STARTCHAR U+0025
+ENCODING 37
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+18
+19
+02
+04
+08
+13
+03
+00
+ENDCHAR
+STARTCHAR U+0026
+ENCODING 38
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+08
+14
+08
+15
+12
+13
+0C
+00
+ENDCHAR
+STARTCHAR U+0027
+ENCODING 39
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+02
+04
+08
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR U+0028
+ENCODING 40
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+02
+04
+08
+08
+08
+04
+02
+00
+ENDCHAR
+STARTCHAR U+0029
+ENCODING 41
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+08
+04
+02
+02
+02
+04
+08
+00
+ENDCHAR
+STARTCHAR U+002A
+ENCODING 42
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+04
+15
+0E
+04
+0E
+15
+04
+00
+ENDCHAR
+STARTCHAR U+002B
+ENCODING 43
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+04
+04
+1F
+04
+04
+00
+00
+ENDCHAR
+STARTCHAR U+002C
+ENCODING 44
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+00
+00
+00
+04
+04
+08
+ENDCHAR
+STARTCHAR U+002D
+ENCODING 45
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+00
+1F
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR U+002E
+ENCODING 46
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+00
+00
+00
+0C
+0C
+00
+ENDCHAR
+STARTCHAR U+002F
+ENCODING 47
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+01
+02
+04
+08
+10
+00
+ENDCHAR
+STARTCHAR U+0030
+ENCODING 48
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+13
+15
+19
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0031
+ENCODING 49
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+04
+0C
+14
+04
+04
+04
+1F
+00
+ENDCHAR
+STARTCHAR U+0032
+ENCODING 50
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+01
+02
+0C
+10
+1F
+00
+ENDCHAR
+STARTCHAR U+0033
+ENCODING 51
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+01
+06
+01
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0034
+ENCODING 52
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+02
+06
+0A
+12
+1F
+02
+02
+00
+ENDCHAR
+STARTCHAR U+0035
+ENCODING 53
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1F
+10
+1C
+02
+01
+02
+1C
+00
+ENDCHAR
+STARTCHAR U+0036
+ENCODING 54
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+06
+08
+10
+1E
+11
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0037
+ENCODING 55
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1F
+11
+02
+04
+04
+04
+04
+00
+ENDCHAR
+STARTCHAR U+0038
+ENCODING 56
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+11
+0E
+11
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0039
+ENCODING 57
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+11
+0F
+01
+02
+0C
+00
+ENDCHAR
+STARTCHAR U+003A
+ENCODING 58
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+04
+00
+00
+04
+00
+00
+ENDCHAR
+STARTCHAR U+003B
+ENCODING 59
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+04
+00
+00
+04
+04
+08
+ENDCHAR
+STARTCHAR U+003C
+ENCODING 60
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+03
+06
+0C
+18
+0C
+06
+03
+00
+ENDCHAR
+STARTCHAR U+003D
+ENCODING 61
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+1F
+00
+1F
+00
+00
+00
+ENDCHAR
+STARTCHAR U+003E
+ENCODING 62
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+18
+0C
+06
+03
+06
+0C
+18
+00
+ENDCHAR
+STARTCHAR U+003F
+ENCODING 63
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+01
+02
+04
+00
+04
+00
+ENDCHAR
+STARTCHAR U+0040
+ENCODING 64
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+01
+0D
+15
+15
+0E
+00
+ENDCHAR
+STARTCHAR U+0041
+ENCODING 65
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+04
+0A
+11
+11
+1F
+11
+11
+00
+ENDCHAR
+STARTCHAR U+0042
+ENCODING 66
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1E
+09
+09
+0E
+09
+09
+1E
+00
+ENDCHAR
+STARTCHAR U+0043
+ENCODING 67
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+06
+09
+10
+10
+10
+09
+06
+00
+ENDCHAR
+STARTCHAR U+0044
+ENCODING 68
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1C
+0A
+09
+09
+09
+0A
+1C
+00
+ENDCHAR
+STARTCHAR U+0045
+ENCODING 69
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1F
+10
+10
+1E
+10
+10
+1F
+00
+ENDCHAR
+STARTCHAR U+0046
+ENCODING 70
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1F
+10
+10
+1E
+10
+10
+10
+00
+ENDCHAR
+STARTCHAR U+0047
+ENCODING 71
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+10
+17
+11
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0048
+ENCODING 72
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+11
+11
+11
+1F
+11
+11
+11
+00
+ENDCHAR
+STARTCHAR U+0049
+ENCODING 73
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+04
+04
+04
+04
+04
+0E
+00
+ENDCHAR
+STARTCHAR U+004A
+ENCODING 74
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+07
+02
+02
+02
+12
+12
+0C
+00
+ENDCHAR
+STARTCHAR U+004B
+ENCODING 75
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+11
+12
+14
+18
+14
+12
+11
+00
+ENDCHAR
+STARTCHAR U+004C
+ENCODING 76
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+10
+10
+10
+10
+10
+10
+1F
+00
+ENDCHAR
+STARTCHAR U+004D
+ENCODING 77
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+11
+1B
+15
+15
+11
+11
+11
+00
+ENDCHAR
+STARTCHAR U+004E
+ENCODING 78
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+11
+19
+19
+15
+13
+13
+11
+00
+ENDCHAR
+STARTCHAR U+004F
+ENCODING 79
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+11
+11
+11
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0050
+ENCODING 80
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1E
+11
+11
+1E
+10
+10
+10
+00
+ENDCHAR
+STARTCHAR U+0051
+ENCODING 81
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+11
+11
+15
+12
+0D
+00
+ENDCHAR
+STARTCHAR U+0052
+ENCODING 82
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1E
+11
+11
+1E
+14
+12
+11
+00
+ENDCHAR
+STARTCHAR U+0053
+ENCODING 83
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+11
+10
+0E
+01
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0054
+ENCODING 84
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1F
+04
+04
+04
+04
+04
+04
+00
+ENDCHAR
+STARTCHAR U+0055
+ENCODING 85
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+11
+11
+11
+11
+11
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0056
+ENCODING 86
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+11
+11
+11
+11
+0A
+0A
+04
+00
+ENDCHAR
+STARTCHAR U+0057
+ENCODING 87
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+11
+11
+11
+15
+15
+1B
+11
+00
+ENDCHAR
+STARTCHAR U+0058
+ENCODING 88
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+11
+11
+0A
+04
+0A
+11
+11
+00
+ENDCHAR
+STARTCHAR U+0059
+ENCODING 89
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+11
+11
+11
+0E
+04
+04
+04
+00
+ENDCHAR
+STARTCHAR U+005A
+ENCODING 90
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+1F
+01
+02
+04
+08
+10
+1F
+00
+ENDCHAR
+STARTCHAR U+005B
+ENCODING 91
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+08
+08
+08
+08
+08
+0E
+00
+ENDCHAR
+STARTCHAR U+005C
+ENCODING 92
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+10
+08
+04
+02
+01
+00
+ENDCHAR
+STARTCHAR U+005D
+ENCODING 93
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0E
+02
+02
+02
+02
+02
+0E
+00
+ENDCHAR
+STARTCHAR U+005E
+ENCODING 94
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+04
+0A
+11
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR U+005F
+ENCODING 95
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+00
+00
+00
+00
+1F
+00
+ENDCHAR
+STARTCHAR U+0060
+ENCODING 96
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+08
+04
+02
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR U+0061
+ENCODING 97
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+0E
+01
+0F
+11
+0F
+00
+ENDCHAR
+STARTCHAR U+0062
+ENCODING 98
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+10
+10
+16
+19
+11
+19
+16
+00
+ENDCHAR
+STARTCHAR U+0063
+ENCODING 99
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+0E
+11
+10
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0064
+ENCODING 100
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+01
+01
+0D
+13
+11
+13
+0D
+00
+ENDCHAR
+STARTCHAR U+0065
+ENCODING 101
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+0E
+11
+1F
+10
+0E
+00
+ENDCHAR
+STARTCHAR U+0066
+ENCODING 102
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+02
+05
+04
+1F
+04
+04
+04
+00
+ENDCHAR
+STARTCHAR U+0067
+ENCODING 103
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+0D
+13
+13
+0D
+01
+0E
+ENDCHAR
+STARTCHAR U+0068
+ENCODING 104
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+10
+10
+1E
+11
+11
+11
+11
+00
+ENDCHAR
+STARTCHAR U+0069
+ENCODING 105
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+04
+00
+0C
+04
+04
+04
+0E
+00
+ENDCHAR
+STARTCHAR U+006A
+ENCODING 106
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+02
+00
+06
+02
+02
+02
+12
+0C
+ENDCHAR
+STARTCHAR U+006B
+ENCODING 107
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+08
+08
+09
+0A
+0C
+0A
+09
+00
+ENDCHAR
+STARTCHAR U+006C
+ENCODING 108
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+0C
+04
+04
+04
+04
+04
+0E
+00
+ENDCHAR
+STARTCHAR U+006D
+ENCODING 109
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+1A
+15
+15
+15
+15
+00
+ENDCHAR
+STARTCHAR U+006E
+ENCODING 110
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+16
+19
+11
+11
+11
+00
+ENDCHAR
+STARTCHAR U+006F
+ENCODING 111
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+0E
+11
+11
+11
+0E
+00
+ENDCHAR
+STARTCHAR U+0070
+ENCODING 112
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+16
+19
+19
+16
+10
+10
+ENDCHAR
+STARTCHAR U+0071
+ENCODING 113
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+0D
+13
+13
+0D
+01
+01
+ENDCHAR
+STARTCHAR U+0072
+ENCODING 114
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+16
+19
+10
+10
+10
+00
+ENDCHAR
+STARTCHAR U+0073
+ENCODING 115
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+0F
+10
+1E
+01
+1E
+00
+ENDCHAR
+STARTCHAR U+0074
+ENCODING 116
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+08
+08
+1E
+08
+08
+09
+06
+00
+ENDCHAR
+STARTCHAR U+0075
+ENCODING 117
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+12
+12
+12
+12
+0D
+00
+ENDCHAR
+STARTCHAR U+0076
+ENCODING 118
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+11
+11
+11
+0A
+04
+00
+ENDCHAR
+STARTCHAR U+0077
+ENCODING 119
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+11
+15
+15
+15
+0A
+00
+ENDCHAR
+STARTCHAR U+0078
+ENCODING 120
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+11
+0A
+04
+0A
+11
+00
+ENDCHAR
+STARTCHAR U+0079
+ENCODING 121
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+11
+11
+13
+0D
+01
+0E
+ENDCHAR
+STARTCHAR U+007A
+ENCODING 122
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+00
+00
+1F
+02
+04
+08
+1F
+00
+ENDCHAR
+STARTCHAR U+007B
+ENCODING 123
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+03
+04
+04
+08
+04
+04
+03
+00
+ENDCHAR
+STARTCHAR U+007C
+ENCODING 124
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+04
+04
+04
+00
+04
+04
+04
+00
+ENDCHAR
+STARTCHAR U+007D
+ENCODING 125
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+18
+04
+04
+02
+04
+04
+18
+00
+ENDCHAR
+STARTCHAR U+007E
+ENCODING 126
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+08
+15
+02
+00
+00
+00
+00
+00
+ENDCHAR
+ENDFONT
View
56 TRS-80_model100/font-extract.py
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+import sys
+import Image
+
+
+buf = sys.stdin.read()
+
+# Start of first byte of table
+start = 0x7711
+startchar = 0x20 # starts with space
+charw = 5
+charh = 8
+endchar = 0x7e
+charcnt = (endchar - startchar) + 1
+imgw = charw * charcnt
+imgh = charh
+
+print imgw, imgh, len(buf)
+
+baseImg = Image.fromstring("1",(charh,imgw),buf[start:start+imgw])
+img = baseImg.transpose(Image.ROTATE_90)
+img.save("eprom-font.png")
+
+
+# Create BDF file
+f = open("eprom-font.bdf","w")
+f.write("""STARTFONT 2.1
+FONT -osbourne-charrom-medium-r-normal--16-160-75-75-c-80-iso10646-1
+SIZE 16 75 75
+FONTBOUNDINGBOX 8 8 0 0
+STARTPROPERTIES 2
+FONT_ASCENT 7
+FONT_DESCENT 1
+ENDPROPERTIES
+CHARS {0}""".format(charcnt))
+
+for i in range(charcnt):
+ left = i * charw
+ charImg = img.crop((left,0,left+charw,charh))
+ f.write("""
+STARTCHAR U+{0:04X}
+ENCODING {0:d}
+SWIDTH 500 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+""".format(i+startchar))
+
+ d = list(charImg.getdata())
+ for j in range(charh):
+ line = reduce(lambda x,y: (x<<1)+(y&0x01), d[j*charw:(j+1)*charw],0)
+ f.write("{0:02X}\n".format(line))
+ f.write("ENDCHAR")
+
+f.write("\nENDFONT\n")
+f.close()
Please sign in to comment.
Something went wrong with that request. Please try again.