BitmapFonts
Stay organized with collections
Save and categorize content based on your preferences.
A container for user-defined bitmap fonts.
Introduced in Wear OS 4.
Syntax
<BitmapFonts>
<BitmapFont name="string">
<!-- Only the most common inner element is shown here. -->
<Character name="string" resource="string"
width="positive-integer" height="positive-integer" />
...
</BitmapFont>
</BitmapFonts>
Inner elements
The BitmapFonts
element must contain at least one BitmapFont
inner element.
BitmapFont
Specifies a particular user-defined bitmap font.
Attributes
name
- The name of the user-defined font family.
Inner elements
Each inner element of a BitmapFont
element must be either a Character
element or a Word
element. Both of these inner elements contain the following
attributes:
name
- The character or word itself.
resource
- A resource ID corresponding to where the character or word is defined.
width
- The width of the character or word, in pixels.
height
- The height of the character or word, in pixels.
Recommended for you
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-03-04 UTC.
[null,null,["Last updated 2025-03-04 UTC."],[],[],null,["# BitmapFonts\n\nA container for user-defined bitmap fonts.\n\nIntroduced in Wear OS 4.\n\nSyntax\n------\n\n```xml\n\u003cBitmapFonts\u003e\n \u003cBitmapFont name=\"string\"\u003e\n \u003c!-- Only the most common inner element is shown here. --\u003e\n \u003cCharacter name=\"string\" resource=\"string\"\n width=\"positive-integer\" height=\"positive-integer\" /\u003e\n ...\n \u003c/BitmapFont\u003e\n\u003c/BitmapFonts\u003e\n```\n\nInner elements\n--------------\n\nThe `BitmapFonts` element must contain at least one `BitmapFont` inner element.\n\n### BitmapFont\n\nSpecifies a particular user-defined bitmap font.\n\n#### Attributes\n\n`name`\n: The name of the user-defined font family.\n\n#### Inner elements\n\nEach inner element of a `BitmapFont` element must be either a `Character`\nelement or a `Word` element. Both of these inner elements contain the following\nattributes:\n\n`name`\n: The character or word itself.\n\n`resource`\n: A resource ID corresponding to where the character or word is defined.\n\n`width`\n: The width of the character or word, in pixels.\n\n`height`\n: The height of the character or word, in pixels.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Using Classes and Objects in Kotlin](/codelabs/android-development-kotlin-3.1)\n- [Kotlin Bootcamp for Programmers 4: Object-oriented programming](/codelabs/kotlin-bootcamp-classes)\n- [Introduction to Compose for TV](/codelabs/compose-for-tv-introduction)"]]