TextLine
TextLine
is a special version of TextBox
that fits the frame to the text instead of flowing the text within the designated frame.
Topics
Discussion
Properties
Refer to the properties concepts section for an overview of properties.
|
Set the value of multiple properties by name. |
|
Set property |
|
Create a context manager that allows setting multiple properties in an efficient way. |
Identification
|
Get the name assigned to this layer during |
|
Set |
|
Set |
Geometry
Refer to the geometry concepts section for an overview of geometry.
Get the anchor of the layer. |
|
|
Set the anchor of the layer. |
Get the position of this layer. |
|
|
Set the position of this layer. |
|
Get the size of this layer. |
|
Set the Size of this layer. |
- TextLine.getTextSize(applyTransformation=True)
Get the size of the text in the layer.
If
applyTransformation
isTrue
the scale from the super layer transformation will be applied to the size.
Transformations
Get a list of all transformations. |
|
|
Add a transformation with |
|
Remove the transformation with |
|
Add a translate transformation with |
|
Add a scale transformation with |
|
Add a rotation transformation with |
|
Add a skew transformation with |
|
Add a transformation with |
Remove the transformation with |
|
Add a sublayer translate transformation with |
|
|
Add a sublayer scale transformation with |
|
Add a sublayer scale transformation with |
|
Add a sublayer skew transformation with |
Frame
Get if the layer is visible. |
|
|
Set if the layer is visible. |
Get if the layer hides any sublayer data outside of its frame. |
|
|
set if the layer hides any sublayer data outside of its frame. |
Get the opacity of this layer. |
|
|
Set the opacity of this layer, |
Get the background color for this layer. |
|
|
Set the background color for this layer. |
Get the border color for this layer. |
|
|
Set the border color for this layer. |
Get the border width for this layer. |
|
|
Set the border width for this layer. |
Get this corner radius of this layer. |
|
|
Set the corner radius of this layer. |
Get the padding for this layer. |
|
|
Set the padding between the edge of the frame and the text for this layer. |
- TextLine.getOffset()
Get the offset for this layer.
- TextLine.setOffset(value)
Set the offset between the position of this layer and where it is actually rendered.
value
must be a tuple of x, y values.container.appendSymbolSublayer( position=(250, 100), imageSettings=dict( name="oval", size=(10, 10), fillColor=(1, 1, 0, 1) ) ) textLineLayer = container.appendTextLineSublayer( position=(250, 100), size=(400, 100), backgroundColor=(1, 1, 0, 0.5), text="Merz", fillColor=(1, 0, 0, 1), horizontalAlignment="right" ) textLineLayer.setOffset((-10, -10))
Shadow
Get the shadow color for this layer. |
|
|
Set the shadow color for this layer. |
Get the shadow opacity for this layer. |
|
|
Set the shadow opacity for this layer. |
Get the shadow offset for this layer. |
|
|
Set the shadow offset for this layer. |
Get the shadow blur radius for this layer. |
|
|
Set the shadow blur radius for this layer. |
Filters
Refer the filter documentation in Base for complete details.
Set the compositing filter for the layer. |
|
|
Set the compositing filter for the layer. |
Get a list of the filters for this layer. |
|
|
Set a list of the filters for this layer. |
|
Append a filter to this layer. |
|
Get the filter with |
|
Remove the filter with |
Clear all background filters from this layer. |
|
Get a list of the background filters for this layer. |
|
|
Set a list of the background filters for this layer. |
|
Append a background filter to this layer. |
|
Get the background filter with |
|
Remove the background filter with |
Text
|
Get the text for this layer. |
|
Set the text for this layer. |
Get the fill color for this layer. |
|
|
Set the fill color for this layer. |
Font
|
Get the name of the font for this layer. |
|
Set the name of the font for this layer. |
Get the weight of the font in the layer. |
|
|
Set the weight of the font in the layer. |
Get the figure style. |
|
|
Set the figure style. |
Point Size
Get the point size for this layer. |
|
|
Set the point size for this layer. |
|
Get if the point size for this layer should always visually be the value of |
|
Set if the point size for this layer should always visually be the value of |
Alignment
Get the horizontal alignment for this layer. |
|
|
Set the horizontal alignment for this layer. |
- TextLine.getVerticalAlignment()
Get the vertical alignment for this layer.
- TextLine.setVerticalAlignment(value)
Set the vertical alignment for this layer. The options are:
"top"
"bottom"
"center"
container.appendSymbolSublayer( position=(250, 100), imageSettings=dict( name="oval", size=(10, 10), fillColor=(1, 1, 0, 1) ) ) textLineLayer = container.appendTextLineSublayer( position=(250, 100), size=(400, 100), backgroundColor=(1, 1, 0, 0.5), text="Merz", fillColor=(1, 0, 0, 1), horizontalAlignment="right" ) textLineLayer.setVerticalAlignment("bottom")
Animation
Refer to the animation concepts section for an overview of animation.
Remove all animations from this layer. |
|
|
Stop the animation with the |
Get if animation is currently paused for this layer. |
|
Pause the animation of this layer. |
|
Resume the animation of the layer. |
Sublayers
Refer to the layer hierarchy concepts section for an overview of sublayers.
|
Place a hold on adding the sublayers to this layer’s CALayer until the context manager exits. |
Get all sublayers within this layer. |
|
|
Get the sublayer with |
Remove all sublayers within this layer. |
|
|
Remove the given sublayer from the layer. |
|
Append an instantiated sublayer to this layer. |
|
Append a sublayer to this layer. |
|
Append a base layer. |
|
Append a path layer. |
|
Append a line layer. |
|
Append a oval layer. |
|
Append a rectangle layer. |
|
Append an image layer. |
|
Append a text box. |
|
Append a text line. |
|
Append a symbol. |
|
This creates a context manager that provides a sublayer creation syntax that supports a subset of the DrawBot API. |
Superlayers
Refer to the layer hierarchy concepts section for an overview of superlayers.
Get the Container that this layer belongs to. |
|
Get the layer that this layer belongs to. |
Hit Testing
CoreAnimation Object
Get the CALayer that this object wraps. |