1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. module:: wx.lib.fancytext
.. currentmodule:: wx.lib.fancytext
.. highlight:: python
.. _wx.lib.fancytext:
==========================================================================================================================================
|phoenix_title| **wx.lib.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.BRUSHSTYLE_SOLID))
>>> frame.SetClientSize(sft.GetSize())
>>> didit = frame.Show()
>>> from guitest import PauseTests; PauseTests()
|function_summary| Functions Summary
====================================
================================================================================ ================================================================================
:func:`~wx.lib.fancytext.GetExtent` Return the extent of str
:func:`~wx.lib.fancytext.GetFullExtent`
:func:`~wx.lib.fancytext.iceil`
:func:`~wx.lib.fancytext.iround`
:func:`~wx.lib.fancytext.RenderToBitmap` Return str rendered on a minumum size bitmap
:func:`~wx.lib.fancytext.RenderToDC` Render str onto a wxDC at (x,y)
:func:`~wx.lib.fancytext.RenderToRenderer`
:func:`~wx.lib.fancytext.test`
================================================================================ ================================================================================
|
|class_summary| Classes Summary
===============================
================================================================================ ================================================================================
:ref:`~wx.lib.fancytext.DCRenderer` Renders text to a wxPython device context DC.
:ref:`~wx.lib.fancytext.Renderer` Class for rendering XML marked up text.
:ref:`~wx.lib.fancytext.SizeRenderer` Processes text as if rendering it, but just computes the size.
:ref:`~wx.lib.fancytext.StaticFancyText`
================================================================================ ================================================================================
|
.. toctree::
:maxdepth: 1
:hidden:
wx.lib.fancytext.DCRenderer
wx.lib.fancytext.Renderer
wx.lib.fancytext.SizeRenderer
wx.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()
|