ropod7 / pyboard_drive

23 stars 11 forks source link

Adding fonts #18

Closed mchobby closed 8 years ago

mchobby commented 8 years ago

Example of use:

from fonts.vera_14 import Vera_14                                           
from lcd import *                                                           
l = LCD( rate = 21000000 )                                                  
l.fillMonocolor( WHITE )                                                    
l.charsTest( color=BLACK, bgcolor=WHITE, font=Vera_14 ) 

About Heydings_20 rendering

This font is a Winding alike, so it is bigger that other font. This font makes 20 x 20 pixels. So I did encode the values on 24bits (a multiple of byte). Apparently the **rendering routine does not support such sizing***. This results in a weird display. However, the bit coding looks right, see the sample here under

c = Heydings_20['69']                                                       
for value in c:                                                             
     print( bin( value ) ) 

which produce the following results

0b111111111111111000000000                                                      
0b111111000000101100000000                                                      
0b111110100001000110000000                                                      
0b111110010011000011000000                                                      
0b111110001110000001000000                                                      
0b111110000100000000100000                                                      
0b111110000010000000110000                                                      
0b111110000010000000010000                                                      
0b111110000010000000010000                                                      
0b111110000010000000010000                                                      
0b111110000010000000100000                                                      
0b111110000100000000100000                                                      
0b111110001110000001000000                                                                                                           0b111110010010000010000000                                                      
0b111110100001000110000000                                                      
0b111111000000101100000000                                                      
0b111111111111111000000000