def test_text(self): with self.draw_and_check(): font = Font(family=MODERN) font.size = 24 self.gc.set_font(font) self.gc.set_text_position(23, 67) self.gc.show_text("hello kiva")
def test_text(self): with self.draw_and_check(): font = Font(family=MODERN) font.size = 24 self.gc.set_font(font) self.gc.set_text_position(23, 67) self.gc.show_text("hello kiva")
def test_text_clip(self): with self.draw_and_check(): self.gc.clip_to_rect(23, 77, 100, 23) font = Font(family=MODERN) font.size = 24 self.gc.set_font(font) self.gc.set_text_position(23, 67) self.gc.show_text("hello kiva")
def test_text_clip(self): with self.draw_and_check(): self.gc.clip_to_rect(23, 77, 100, 23) font = Font(family=MODERN) font.size = 24 self.gc.set_font(font) self.gc.set_text_position(23, 67) self.gc.show_text("hello kiva")
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)