Created
September 13, 2015 13:29
-
-
Save veb/0e34ede53bd389d5d07e to your computer and use it in GitHub Desktop.
Pango test
This file contains hidden or 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 cairocffi as cairo | |
import pango | |
import pangocairo | |
import glib | |
import gobject | |
import pygtk | |
WIDTH, HEIGHT = 256, 256 | |
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT) | |
context = cairo.Context(surface) | |
context.select_font_face('Raleway-SemiBold', slant=cairo.FONT_SLANT_NORMAL, weight=cairo.FONT_WEIGHT_NORMAL) | |
context.set_font_size(40) | |
text = 'Hello World' | |
context.move_to(0, 100) | |
context.show_text(text) | |
surface.write_to_png("example.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment