getFontMeasure

Returns the runtime's font measurement API, for measuring how text will render in a given font

import { getFontMeasure } from "@roku-sdk/runtime/font";
const getFontMeasure: () => FontMeasureApi

Description

Returns the runtime's font measurement API, for measuring how text will render in a given font.

Use it to size or lay out labels from text metrics such as a line's width and height or the font's ascent and descent, all in pixels. The call is synchronous, and the runtime object is fetched on the first call and reused afterwards.


What’s Next

Did this page help you?