Table Of Contents

Previous topic

SquarePoint

Next topic

TextObjectMixin

This Page

phoenix_title Text

This class creates a text object, placed at the coordinates, x,y. the “Position” argument is a two charactor string, indicating where in relation to the coordinates the string should be oriented.

The first letter is: t, c, or b, for top, center and bottom The second letter is: l, c, or r, for left, center and right The position refers to the position relative to the text itself. It defaults to “tl” (top left).

Size is the size of the font in pixels, or in points for printing (if it ever gets implimented). Those will be the same, If you assume 72 PPI.

  • Family: Font family, a generic way of referring to fonts without specifying actual facename. One of:

    • wx.DEFAULT: Chooses a default font.
    • wx.DECORATI: A decorative font.
    • wx.ROMAN: A formal, serif font.
    • wx.SCRIPT: A handwriting font.
    • wx.SWISS: A sans-serif font.
    • wx.MODERN: A fixed pitch font.

    Note

    these are only as good as the wxWindows defaults, which aren’t so good.

  • Style: One of wx.NORMAL, wx.SLANT and wx.ITALIC.

  • Weight: One of wx.NORMAL, wx.LIGHT and wx.BOLD.

  • Underlined: The value can be True or False. At present this may have an an effect on Windows only.

Alternatively, you can set the kw arg: Font, to a wx.Font, and the above will be ignored.

The size is fixed, and does not scale with the drawing.

The hit-test is done on the entire text extent


class_hierarchy Inheritance Diagram

Inheritance diagram for class Text

Inheritance diagram of Text


method_summary Methods Summary

__init__  

api Class API



class Text(TextObjectMixin, DrawObject)

This class creates a text object, placed at the coordinates, x,y. the “Position” argument is a two charactor string, indicating where in relation to the coordinates the string should be oriented.

The first letter is: t, c, or b, for top, center and bottom The second letter is: l, c, or r, for left, center and right The position refers to the position relative to the text itself. It defaults to “tl” (top left).

Size is the size of the font in pixels, or in points for printing (if it ever gets implimented). Those will be the same, If you assume 72 PPI.

  • Family: Font family, a generic way of referring to fonts without specifying actual facename. One of:

    • wx.DEFAULT: Chooses a default font.
    • wx.DECORATI: A decorative font.
    • wx.ROMAN: A formal, serif font.
    • wx.SCRIPT: A handwriting font.
    • wx.SWISS: A sans-serif font.
    • wx.MODERN: A fixed pitch font.

    Note

    these are only as good as the wxWindows defaults, which aren’t so good.

  • Style: One of wx.NORMAL, wx.SLANT and wx.ITALIC.

  • Weight: One of wx.NORMAL, wx.LIGHT and wx.BOLD.

  • Underlined: The value can be True or False. At present this may have an an effect on Windows only.

Alternatively, you can set the kw arg: Font, to a wx.Font, and the above will be ignored.

The size is fixed, and does not scale with the drawing.

The hit-test is done on the entire text extent


Methods



__init__(self, String, xy, Size = 14, Color = "Black", BackgroundColor = None, Family = MODERN, Style = NORMAL, Weight = NORMAL, Underlined = False, Position = 'tl', InForeground = False, Font = None)