TextCircular


Specifies a circular or curved text configuration.

Introduced in Wear OS 4.

Syntax

<TextCircular centerX="float" centerY="float"
              direction="CLOCKWISE | COUNTER_CLOCKWISE" width="float"
              height="float" startAngle="float-degrees"
              endAngle="float-degrees" align="START | CENTER | END"
              ellipsis="boolean" >
    <!-- Possible inner elements. The PartText element syntax shows a
         more complete example. -->
    <Transform .../>
    <Font ... />
    <BitmapFont ... />
</TextCircular>

Attributes

The TextCircular element has the following attributes. Some attributes are required while others are optional.

Required attributes

The following attributes are required:

centerX and centerY

A pair of floating-point values that specify the position of the element's center.

These attributes are transformable.

width and height

A pair of floating-point values that specify the element's size.

startAngle and endAngle

A pair of floating-point values that specify the angle of the text's starting side and the angle of the text's ending side, respectively. An angle of 0 degrees represents the 12 o'clock position on the watch face.

For example, to curve text around the top quarter of the watch face, use a startAngle of 335.0 and an endAngle of 45.0.

These attributes are transformable.

Optional attributes

The following attributes are optional:

direction

Indicates the direction in which the text is written:

  • CLOCKWISE (default): Show text in the clockwise direction.
  • COUNTER_CLOCKWISE: Show text in the counterclockwise direction.
align

Determines the text's alignment within its parent element:

  • START: left- or top-aligned (right-aligned when the current language uses an RTL text direction)
  • CENTER: center-aligned
  • END: right- or bottom-aligned (left-aligned when the current language uses an RTL text direction)

The default value is CENTER.

ellipsis

A boolean value that indicates whether to show an ellipsis if the text is too long to fit in the parent element. The default is FALSE.

verticalAlign

How to align the text vertically within the bounding box:

  • TOP: the text top edge is aligned on the top of the bounding box.
  • BOTTOM: the text bottom edge is aligned on the bottom of the bounding box.
  • CENTER: the text center is aligned on the center of the bounding box.
  • CENTER_ON_BASELINE: the text baseline is aligned on the center of the bounding box.
isAutoSize
Downscales the font size to fit the bounds of the containing PartText, with a minimum font size of 12px, or the Font minSize since v5. If used in conjunction with ellipsis, first the text is scaled down, then if the text still exceeds the bounds, the ellipsis is applied.

Inner elements

The Text element can contain any number of the following inner elements: