.. include:: headings.inc .. module:: lib.fancytext .. currentmodule:: lib.fancytext .. highlight:: python .. _lib.fancytext: ========================================================================================================================================== |phoenix_title| **fancytext** ========================================================================================================================================== FancyText -- methods for rendering XML specified text This module exports four main methods:: def GetExtent(str, dc=None, enclose=True) def GetFullExtent(str, dc=None, enclose=True) def RenderToBitmap(str, background=None, enclose=True) def RenderToDC(str, dc, x, y, enclose=True) In all cases, 'str' is an XML string. Note that start and end tags are only required if *enclose* is set to False. In this case the text should be wrapped in FancyText tags. In addition, the module exports one class:: class StaticFancyText(self, window, id, text, background, ...) This class works similar to StaticText except it interprets its text as FancyText. The text can support superscripts and subscripts, text in different sizes, colors, styles, weights and families. It also supports a limited set of symbols, currently *times*, *infinity*, *angle* as well as greek letters in both upper case (*Alpha* *Beta*... *Omega*) and lower case (*alpha* *beta*... *omega*). >>> frame = wx.Frame(wx.NULL, -1, "FancyText demo", wx.DefaultPosition) >>> sft = StaticFancyText(frame, -1, testText, wx.Brush("light grey", wx.SOLID)) >>> frame.SetClientSize(sft.GetSize()) >>> didit = frame.Show() >>> from guitest import PauseTests; PauseTests() | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for module **fancytext** .. raw:: html

Inheritance diagram of fancytext

| |function_summary| Functions Summary ==================================== ================================================================================ ================================================================================ :func:`~lib.fancytext.GetExtent` Return the extent of str :func:`~lib.fancytext.GetFullExtent` :func:`~lib.fancytext.iceil` :func:`~lib.fancytext.iround` :func:`~lib.fancytext.RenderToBitmap` Return str rendered on a minumum size bitmap :func:`~lib.fancytext.RenderToDC` Render str onto a wxDC at (x,y) :func:`~lib.fancytext.RenderToRenderer` :func:`~lib.fancytext.test` ================================================================================ ================================================================================ | |class_summary| Classes Summary =============================== ================================================================================ ================================================================================ :ref:`lib.fancytext.DCRenderer` Renders text to a wxPython device context DC. :ref:`lib.fancytext.Renderer` Class for rendering XML marked up text. :ref:`lib.fancytext.SizeRenderer` Processes text as if rendering it, but just computes the size. :ref:`lib.fancytext.StaticFancyText` ================================================================================ ================================================================================ | .. toctree:: :maxdepth: 1 :hidden: lib.fancytext.DCRenderer lib.fancytext.Renderer lib.fancytext.SizeRenderer lib.fancytext.StaticFancyText Functions ------------ .. function:: GetExtent(str, dc=None, enclose=True) Return the extent of str .. function:: GetFullExtent(str, dc=None, enclose=True) .. function:: iceil(number) .. function:: iround(number) .. function:: RenderToBitmap(str, background=None, enclose=1) Return str rendered on a minumum size bitmap .. function:: RenderToDC(str, dc, x, y, enclose=1) Render str onto a wxDC at (x,y) .. function:: RenderToRenderer(str, renderer, enclose=True) .. function:: test()