@@ -119,10 +119,10 @@ as follows:
119
119
120
120
``` python
121
121
class PyFont (object ):
122
- def __init__ (self , font , index , vert , horiz , fixed , revbit ):
122
+ def __init__ (self , font , index , vert , horiz , vmap , revbit ):
123
123
self ._bits_horiz = horiz # Width of monospaced char or 0 if variable
124
124
self ._bits_vert = vert # Height of all chars
125
- self ._fixed = fixed # Fixed pitch
125
+ self ._vmap = vmap # Vertical map
126
126
self ._revbit = revbit # Bit reversal of font bytes
127
127
self ._index = index
128
128
self ._font = font
@@ -134,7 +134,7 @@ class PyFont(object):
134
134
return addressof(self ._font) + offset, self ._bits_vert, char_width
135
135
136
136
def get_properties (self ):
137
- return self ._bits_vert, self ._bits_horiz, self ._fixed , self ._revbit
137
+ return self ._bits_vert, self ._bits_horiz, self ._vmap , self ._revbit
138
138
```
139
139
140
140
The device driver calls the `` get_ch `` method for each character in a string.
@@ -150,10 +150,30 @@ has the following outline definition (in practice the bytes objects are large):
150
150
import pyfont
151
151
_myfont = b ' \x00\x00 `
152
152
_myfont_index = b ' \x00\x00\x23\x00 \`
153
- myfont = pyfont.PyFont(_myfont, _myfont_index, 24 , 0 , False , False )
153
+ myfont = pyfont.PyFont(_myfont, _myfont_index, 24 , 0 , True , False )
154
154
155
155
```
156
156
157
+ ## Mapping
158
+
159
+ A character occupies a space where (0, 0) represents the coordinates of the top
160
+ left hand corner of the bitmap. It comprises a set of pixels where increasing x
161
+ values represent locations to the right of the origin and increasing y values
162
+ represent downward positions. Mapping is the process whereby this two
163
+ dimensional array of bits is transformed into a linear sequence of bytes.
164
+
165
+ Vertical mapping means that the LSB of first byte is pixel (0,0), MSB of first
166
+ byte is (0, 7). The second byte (assuming the height is greater than 8 pixels)
167
+ is (0, 8) to (0, 15). Once the column is complete the next byte represents
168
+ (1, 0) to (1, 7).
169
+
170
+ Horizontal mapping means that the MSB of byte 0 is pixel (0,0) with LSB at
171
+ (7,0), with the second byte covering (8, 0) to (15, 0) if the width is greater
172
+ than 8.
173
+
174
+ Bit reversal provides for the case where the bit order of each byte is reversed
175
+ i.e. a byte comprising bits [ b7b6b5b4b3b2b1b0] becomes [ b0b1b2b3b4b5b6b7] .
176
+
157
177
# Specification Notes
158
178
159
179
The design aims primarily to minimise RAM usage. Minimising the size of the
0 commit comments