def __doc_example1__(images): from random import randint, seed from gamera.core import Image, Dim seed(0) image = Image((0, 0), Dim(320, 300), RGB, DENSE) # These are some various Unicode encoded names of different # languages (from the wikipedia.org front page). Just a quick way # to test Unicode support. I use the long encoding here so this # source file iteself will be portable. names = [ '\xd0\x91\xd1\x8a\xd0\xbb\xd0\xb3\xd0\xb0\xd1\x80\xd1\x81\xd0\xba\xd0\xb8', '\xd7\xa2\xd7\x91\xd7\xa8\xd7\x99\xd7\xaa', '\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9', '\xc4\x8cesk\xc3\xa1', 'Rom\xc3\xa2n\xc4\x83', '\xe1\x83\xa5\xe1\x83\x90\xe1\x83\xa0\xe1\x83\x97\xe1\x83\xa3\xe1\x83\x9a\xe1\x83\x98', '\xd0\x9c\xd0\xb0\xd0\xba\xd0\xb5\xd0\xb4\xd0\xbe\xd0\xbd\xd1\x81\xd0\xba\xd0\xb8', '\xc3\x8dslenska', 'Lietuvi\xc5\xb3', 'T\xc3\xbcrk\xc3\xa7e' ] try: for i, name in enumerate(names): image.draw_text((160, i * 30), name, RGBPixel(randint(0, 255), randint(0, 255), randint(0, 255)), 20, halign=1) except Exception: pass return image