Created
November 18, 2012 23:56
-
-
Save guyc/4108225 to your computer and use it in GitHub Desktop.
code for testing font layout using py-gaugette.ssd1306
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gaugette.ssd1306 | |
from gaugette.fonts import arial_16 | |
from gaugette.fonts import arial_mono_15 | |
RESET_PIN = 15 | |
DC_PIN = 16 | |
buffer_width = 128 | |
led = gaugette.ssd1306.SSD1306(reset_pin=RESET_PIN, dc_pin=DC_PIN, buffer_cols=buffer_width) | |
led.begin() | |
led.clear_display() | |
offset = 0 | |
text = "Hello World" | |
font = arial_16 | |
offset = 0 | |
led.draw_text3(0,offset + (32-font.char_height)/2,text,font) | |
font = arial_mono_15 | |
offset = 32 | |
led.draw_text3(0,offset + (32-font.char_height)/2,text,font) | |
led.dump_buffer() | |
led.display() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo python font_test2.py | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
|* * * * * * * * * | | |
|* * * * * * * * * * | | |
|* * * * * * * * * * | | |
|* * *** * * *** * * * * *** * ** * *** * | | |
|* * * * * * * * * * * * * * ** * * ** | | |
|********* * * * * * * * * * * * * * * * * | | |
|* * * * * * * * * * * * * * * * * * | | |
|* * ******* * * * * * * * * * * * * * * | | |
|* * * * * * * * * * * * * * * * * | | |
|* * * * * * * * * * * * * * * * * * | | |
|* * * * * * * * * * * * * * * ** | | |
|* * *** * * *** * * *** * * *** * | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| ** ** * * * * * * * * ** | | |
| ***** * * * * * * * *** * | | |
| * * * * ** ** * | | |
| * * **** | | |
| * | | |
| * | | |
|* * * * | | |
|* * ** * | | |
|* * ** * * | | |
|***** * * * * * * * * | | |
|* **** * * ** * ***** | | |
|* ** ** *** *** * ** * *** ** ** | | |
|* * * * *** ** * ** ** *** ** ***** * * * | | |
|* * * * * * ** ** * * ** ** * * * | | |
|* * * * * * * ** ** * * * * * * * | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment