TextPropertiesManager¶
-
class TextPropertiesManager¶
This defines all of the
TextPropertiesstructures that might be referenced by name from an embedded text string.A text string, as rendered by a
TextNode, can contain embedded references to one of theTextPropertiesdefined here, by enclosing the name between 1 (ASCII 0x01) characters; this causes a “push” to the named state. All text following the closing 1 character will then be rendered in the new state. The next 2 (ASCII 0x02) character will then restore the previous state for subsequent text.For instance, “x1up1n2 + y” indicates that the character “x” will be rendered in the normal state, the character “n” will be rendered in the “up” state, and then “ + y” will be rendered in the normal state again.
This can also be used to define arbitrary models that can serve as embedded graphic images in a text paragraph. This works similarly; the convention is to create a
TextGraphicthat describes the graphic image, and then associate it here via theset_graphic()call. Then “5name5” will embed the named graphic.Inheritance diagram
digraph inheritancee886f4688a { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "TextPropertiesManager" [URL="acron.core.TextPropertiesManager.html#acron.core.TextPropertiesManager",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TextPropertiesManager" [arrowsize=0.75,style=""]; }- TextPropertiesManager.clear_graphic()¶
Removes the named
TextGraphicstructure from the manager.
- TextPropertiesManager.clear_properties()¶
Removes the named
TextPropertiesstructure from the manager.
- static TextPropertiesManager.get_global_ptr()¶
Returns the pointer to the global
TextPropertiesManagerobject.
- TextPropertiesManager.get_graphic()¶
Returns the
TextGraphicassociated with the indicated name. If there was not previously aTextGraphicassociated with this name, a warning is printed and then a defaultTextGraphicstructure is associated with the name, and returned.Call
has_graphic()instead to check whether a particular name has been defined.
- TextPropertiesManager.get_properties()¶
Returns the
TextPropertiesassociated with the indicated name. If there was not previously aTextPropertiesassociated with this name, a warning is printed and then a defaultTextPropertiesstructure is associated with the name, and returned.Call
has_properties()instead to check whether a particular name has been defined.
- TextPropertiesManager.has_graphic()¶
Returns true if a
TextGraphicstructure has been associated with the indicated name, false otherwise. Normally this meansset_graphic()has been called with this name, but becauseget_graphic()will implicitly create a defaultTextGraphicstructure, it may also mean simply thatget_graphic()has been called with the indicated name.
- TextPropertiesManager.has_properties()¶
Returns true if a
TextPropertiesstructure has been associated with the indicated name, false otherwise. Normally this meansset_properties()has been called with this name, but becauseget_properties()will implicitly create a defaultTextPropertiesstructure, it may also mean simply thatget_properties()has been called with the indicated name.
- TextPropertiesManager.set_graphic()¶
Defines the
TextGraphicassociated with the indicated name. When the name is subsequently encountered in text embedded between 5 characters in aTextNodestring, the specified graphic will be embedded in the text at that point.If there was already a
TextGraphicstructure associated with this name, it is quietly replaced with the new definition.This flavor of set_graphic implicitly creates a frame for the model using the model’s actual computed bounding volume, as derived from
NodePath::calc_tight_bounds(). Create aTextGraphicobject first if you want to have explicit control of the frame.
- TextPropertiesManager.set_properties()¶
Defines the
TextPropertiesassociated with the indicated name. When the name is subsequently encountered in text embedded between 1 characters in aTextNodestring, the following text will be rendered with these properties.If there was already a
TextPropertiesstructure associated with this name, it is quietly replaced with the new definition.
- TextPropertiesManager.write()¶