def test_show_text_at_point(self):
     gc = GraphicsContextArray((100, 100))
     gc.set_font(Font())
     gc.show_text_at_point(str('asdf'), 5, 5)
Example #2
0
from __future__ import print_function

import time
from kiva.fonttools import Font
from kiva.constants import MODERN
from kiva.agg import AffineMatrix, GraphicsContextArray

gc = GraphicsContextArray((200,200))

font = Font(family=MODERN)
#print font.size
font.size=8
gc.set_font(font)


t1 = time.clock()

# consecutive printing of text.
with gc:
    gc.set_antialias(False)
    gc.set_fill_color((0,1,0))
    gc.translate_ctm(50,50)
    gc.rotate_ctm(3.1416/4)
    gc.show_text("hello")
    gc.translate_ctm(-50,-50)
    gc.set_text_matrix(AffineMatrix())
    gc.set_fill_color((0,1,1))
    gc.show_text("hello")

t2 = time.clock()
print('aliased:', t2 - t1)
 def test_show_text_at_point(self):
     gc = GraphicsContextArray((100,100))
     gc.set_font(Font())
     gc.show_text_at_point(six.text_type('asdf'), 5,5)