Functions to draw text into a graphics context.
See Graphics Context for more information about the graphics context.
Other drawing functions and related documentation:
Creates an instance of GTextAttributes for advanced control when rendering text.
New instance of GTextAttributes
Destroys a previously created instance of GTextAttributes.
Restores text flow to the rectangular default.
The attributes for which to disable text flow
Enables text flow that follows the boundaries of the screen.
The attributes for which text flow should be enabled
Additional amount of pixels to inset to the inside of the screen for text flow calculation. Can be zero.
Restores paging and locked content origin to the defaults.
The attributes for which to restore paging and locked content origin
Enables paging and locks the text flow calculation to a fixed point on the screen.
Attributes for which to enable paging and locked content origin
Absolute coordinate on the screen where the text content starts before an animation or scrolling takes place. Usually the frame's origin of a layer in screen coordinates.
Rectangle in absolute coordinates on the screen that describes where text content pages. Usually the container's absolute frame in screen coordinates.
Draw text into the current graphics context, using the context's current text color. The text will be drawn inside a box with the specified dimensions and configuration, with clipping occuring automatically.
The destination graphics context in which to draw
The zero terminated UTF-8 string to draw
The font in which the text should be set
The bounding box in which to draw the text. The first line of text will be drawn against the top of the box.
The overflow behavior, in case the text is larger than what fits inside the box.
The horizontal alignment of the text
Optional text attributes to describe the characteristics of the text
Obtain the maximum size that a text with given font, overflow mode and alignment occupies within a given rectangular constraint.
The zero terminated UTF-8 string for which to calculate the size
The font in which the text should be set while calculating the size
The bounding box in which the text should be constrained
The overflow behavior, in case the text is larger than what fits inside the box.
The horizontal alignment of the text
The maximum size occupied by the text
app_graphics_text_layout_get_content_size_with_attributes
Obtain the maximum size that a text with given font, overflow mode and alignment occupies within a given rectangular constraint.
The zero terminated UTF-8 string for which to calculate the size
The font in which the text should be set while calculating the size
The bounding box in which the text should be constrained
The overflow behavior, in case the text is larger than what fits inside the box.
The horizontal alignment of the text
Optional text attributes to describe the characteristics of the text
The maximum size occupied by the text
app_graphics_text_layout_get_content_size
Text overflow mode controls the way text overflows when the string that is drawn does not fit inside the area constraint.
On overflow, wrap words to a new line below the current one. Once vertical space is consumed, the last line may be clipped.
On overflow, wrap words to a new line below the current one. Once vertical space is consumed, truncate as needed to fit a trailing ellipsis (...). Clipping may occur if the vertical space cannot accomodate the first line of text.
Acts like GTextOverflowModeTrailingEllipsis, plus trims leading and trailing newlines, while treating all other newlines as spaces.
Text aligment controls the way the text is aligned inside the box the text is drawn into.
Aligns the text to the left of the drawing box.
Aligns the text centered inside the drawing box.
Aligns the text to the right of the drawing box.
Do you have questions about the Pebble SDK?
Do you need some help understanding something on this page?
You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can send us a message through the website!