Projects tagged ‘bitmap’, ‘bmp’, and ‘fonts’


Jump to tag:

Projects tagged ‘bitmap’, ‘bmp’, and ‘fonts’

Filtered by Project Tags bitmap bmp fonts

[1 total ]

0 Users

Bitmap loading and writing utilities in pure Python. Supports drawing many shapes and text. This project was created to add support for image drawing capabilities for Google Appengine. To write text ... [More] onto bitmaps, you first need to create proper python module with make_font.py. For example: python make_font.py -f /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf -s 12The python code would look like this: import bmp import bmpfont_arialbd_12 img = bmp.BitMap( 500, 40, bmp.Color.TEAL.lighten() ) img.setFont(bmpfont_arialbd_12.font_data) img.setPenColor( bmp.Color.BLUE ) img.drawText('abcdefghijklmnoprstuvxyz!@#$^%&^**()_}{\",.?<>', 10, 10) img.drawLine( 0, 0, 10, 10) # save the file img.saveFile( "test.bmp" ) # or get the bitmap as string bitmap = img.getBitmap() [Less]
Created 5 months ago.