The Font element has the following attributes. Some attributes are
required while others are optional.
Required attributes
The following attributes are required:
family
The name of the font used for rendering the text. To use the same font
family as the system, set this value to SYNC_TO_DEVICE.
To use a custom font, place the font file in res/font/, using one of the
following accepted font file extensions: TTF, OTF, TTC, or XML. Then, set this
value to the name of the font file, excluding the extension at the end.
If the font file cannot be resolved, the system font is used.
size
A floating-point value that specifies the text size.
Optional attributes
The following attributes are optional:
color
The color of the text. If provided, you must specify the color using either
the ARGB format (#ff000000 = opaque black) or the RGB format (#000000 =
black).
The space between letters, specified in EM units. The default value is 0.
An example for slight expansion could be 0.05. Negative values tighten text.
slant
Whether to use a NORMAL font slant (default) or an ITALIC slant.
width
An enumeration of several hints for a font family variant to use. The default
value is NORMAL, which applies the "normal" variant of the font.
The following list contains the other enumeration values and the respective
font family variants that they use, if that variant is available for the font:
ULTRA_CONDENSED and EXTRA_CONDENSED use the "condensed-light" variant.
CONDENSED uses the "condensed" variant.
SEMI_CONDENSED uses the "condensed-medium" variant.
SEMI_EXPANDED, EXPANDED, EXTRA_EXPANDED, and ULTRA_EXPANDED each
use the "normal" variant.
weight
An enumeration of several possible font weights. The default value is
NORMAL, which applies a weight of 400.
The following list contains the other enumeration values and their respective
font weights:
THIN uses a font weight of 100.
ULTRA_LIGHT uses a font weight of 150.
EXTRA_LIGHT uses a font weight of 200.
LIGHT uses a font weight of 300.
MEDIUM uses a font weight of 500.
SEMI_BOLD uses a font weight of 600.
ULTRA_BOLD uses a font weight of 750.
EXTRA_BOLD uses a font weight of 800.
BLACK uses a font weight of 900.
EXTRA_BLACK uses a font weight of 1000.
Inner elements
The Font element can contain the following inner elements:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-20 UTC.
[null,null,["Last updated 2025-05-20 UTC."],[],[],null,["# Font\n\nWatch Face Format version Version 4 Version 3 Version 2 Version 1\n\n*** ** * ** ***\n\nProvides rendering instructions for a specific text element.\n\nIntroduced in Wear OS 4.\n\nSyntax\n------\n\n```xml\n\u003cFont family=\"string | SYNC_TO_DEVICE\" size=\"float\"\n color=\"argb-color | rgb-color\" slant=\"NORMAL | ITALIC\"\n letterSpacing=\"em-value\"\n width=\"ULTRA_CONDENSED | EXTRA_CONDENSED | CONDENSED | SEMI_CONDENSED |\n NORMAL | SEMI_EXPANDED | EXPANDED | EXTRA_EXPANDED |\n ULTRA_EXPANDED\"\n weight=\"THIN | ULTRA_LIGHT | EXTRA_LIGHT | LIGHT | NORMAL | MEDIUM |\n BOLD | SEMI_BOLD | ULTRA_BOLD | EXTRA_BOLD | BLACK | EXTRA_BLACK\"\u003e\n \u003c!-- Inner elements consist of text decoration and text formatting\n options. Here, \"Lower\" is used as an example. --\u003e\n \u003cLower ... /\u003e\n\u003c/Font\u003e\n```\n\nAttributes\n----------\n\nThe `Font` element has the following attributes. Some attributes are\nrequired while others are optional.\n\n### Required attributes\n\nThe following attributes are required:\n\n`family`\n\n: The name of the font used for rendering the text. To use the same font\n family as the system, set this value to `SYNC_TO_DEVICE`.\n\n: To use a custom font, place the font file in `res/font/`, using one of the\n following accepted font file extensions: TTF, OTF, TTC, or XML. Then, set this\n value to the name of the font file, excluding the extension at the end.\n\n: If the font file cannot be resolved, the system font is used.\n\n`size`\n\n: A floating-point value that specifies the text size.\n\n### Optional attributes\n\nThe following attributes are optional:\n\n`color`\n\n: The color of the text. If provided, you must specify the color using either\n the ARGB format (`#ff000000` = opaque black) or the RGB format (`#000000` =\n black).\n\n From version 4, this attribute is [transformable](/training/wearables/wff/common/transform/transform).\n\n`letterSpacing`\n\n: The space between letters, specified in EM units. The default value is 0.\n An example for slight expansion could be 0.05. Negative values tighten text.\n\n`slant`\n\n: Whether to use a `NORMAL` font slant (default) or an `ITALIC` slant.\n\n`width`\n\n: An enumeration of several hints for a font family variant to use. The default\n value is `NORMAL`, which applies the \"normal\" variant of the font.\n\n The following list contains the other enumeration values and the respective\n font family variants that they use, if that variant is available for the font:\n\n - `ULTRA_CONDENSED` and `EXTRA_CONDENSED` use the \"condensed-light\" variant.\n - `CONDENSED` uses the \"condensed\" variant.\n - `SEMI_CONDENSED` uses the \"condensed-medium\" variant.\n - `SEMI_EXPANDED`, `EXPANDED`, `EXTRA_EXPANDED`, and `ULTRA_EXPANDED` each use the \"normal\" variant.\n\n`weight`\n\n: An enumeration of several possible font weights. The default value is\n `NORMAL`, which applies a weight of `400`.\n\n The following list contains the other enumeration values and their respective\n font weights:\n\n - `THIN` uses a font weight of `100`.\n - `ULTRA_LIGHT` uses a font weight of `150`.\n - `EXTRA_LIGHT` uses a font weight of `200`.\n - `LIGHT` uses a font weight of `300`.\n - `MEDIUM` uses a font weight of `500`.\n - `SEMI_BOLD` uses a font weight of `600`.\n - `ULTRA_BOLD` uses a font weight of `750`.\n - `EXTRA_BOLD` uses a font weight of `800`.\n - `BLACK` uses a font weight of `900`.\n - `EXTRA_BLACK` uses a font weight of `1000`.\n\nInner elements\n--------------\n\nThe `Font` element can contain the following inner elements:\n\n- [`Shadow`](/training/wearables/wff/group/part/text/decoration/shadow)\n- [`Outline`](/training/wearables/wff/group/part/text/decoration/outline)\n- [`OutGlow`](/training/wearables/wff/group/part/text/decoration/out-glow)\n- [`Underline`](/training/wearables/wff/group/part/text/decoration/underline)\n- [`StrikeThrough`](/training/wearables/wff/group/part/text/decoration/strike-through)\n- [`InlineImage`](/training/wearables/wff/group/part/text/formatter/inline-image)\n- [`Template`](/training/wearables/wff/group/part/text/formatter/template)\n- [`Upper`](/training/wearables/wff/group/part/text/formatter/upper)\n- [`Lower`](/training/wearables/wff/group/part/text/formatter/lower)\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Font](/training/wearables/wff/v2/group/part/text/font)\n- [Outline](/training/wearables/wff/v2/group/part/text/decoration/outline)\n- [Outline](/training/wearables/wff/group/part/text/decoration/outline)"]]