Font

open class Font : UIResource

A font class used to define a font for the UIKit.widgets.Text UI element

2 types of fonts can be used:

  • StockFont that are pre-installed with the glasses

  • Slot for Custom fonts that can be created, added to the application resources and uploaded to the glasses

NOTE: The behaviour of adding 2 (or more) different UIKit.widgets.Text having custom fonts with the same slot to the same screen is undefined

See also

Constructors

Link copied to clipboard
constructor(stockFont: Font.StockFont)

Constructor enables creating a stock font

constructor(nameWithExtension: String, slot: Font.Slot)

Constructor enables creating a custom font

constructor(nameWithExtension: String, slot: Font.Slot, maxW: Int, maxH: Int)

Constructor enables creating a custom font

constructor(data: ByteArray, fType: FontType, slot: Font.Slot, maxW: Int, maxH: Int)

Constructor receiving font binary data

Types

Link copied to clipboard

Custom font slots to be uploaded and used

Link copied to clipboard

Pre-installed fonts

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun failedToUpload(): Boolean

Find out if the resource upload to the glasses was failed

Link copied to clipboard
open override fun getMaxSizeBytes(): Int

Returns the maximum size allowed for the UIResource in bytes

Link copied to clipboard

Return the measured height of the text text in pixels

Link copied to clipboard

Return the measured width of the text in pixels

Link copied to clipboard
open override fun getResourceName(): String

Returns the resource name that was set or empty string if not set

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun loadResource(): Boolean

Pre-Load the resource binary data from the application resources

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun wasConfigured(): Boolean

Return true if the resource information is valid and sufficient for upload

Link copied to clipboard
open override fun wasUploadedToGlasses(): Boolean

Find out if the resource was already uploaded to the glasses

Properties

Link copied to clipboard
var maxH: Int

The height of the highest character within the font in pixels

Link copied to clipboard
var maxW: Int

The width of the wider character within the font in pixels

Link copied to clipboard

The custom font Slot

Link copied to clipboard

The stock font StockFont