from wxPython.wx import * from wxPython.lib import fancytext #---------------------------------------------------------------------- test_str = ('' 'some |23 textwith subscript' ' some other text') test_str2 = 'big green text' class TestPanel(wxPanel): def __init__(self, parent): wxPanel.__init__(self, parent, -1) EVT_PAINT(self, self.OnPaint) def OnPaint(self, evt): dc = wxPaintDC(self) w, h = fancytext.GetExtent(test_str, dc) fancytext.RenderToDC(test_str, dc, 20, 20) fancytext.RenderToDC(test_str2, dc, 20, 20 + h + 10) #---------------------------------------------------------------------- def runTest(frame, nb, log): win = TestPanel(nb) return win #---------------------------------------------------------------------- overview = fancytext.__doc__.replace("<", "<") if __name__ == '__main__': import sys,os import run run.main(['', os.path.basename(sys.argv[0])])