runtime.Canvas · builtin ·
Canvas.MeasureTextWidth
Measure text width through the Canvas runtime.
Built into Yeho; no package import is needed. Native services require an admitted host and the correct resource lifecycle.
Canvas.MeasureTextWidth(text text) -> intStatus: registered-intrinsic
Parameters
text text- Supply text as text.
Call Canvas.MeasureTextWidth
A complete typed caller with illustrative arguments. Native operations need the corresponding host and resources.
cpu · builtin · type checked
text text = "text"
int result = Canvas.MeasureTextWidth(text)
Console.Log(Text.From(result))
project.mech
manifestVersion = "2"
package = "api.example.runtime__canvas_measuretextwidth"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
[app]
kind = "headless"
Notes and source
The example checks the call shape. Opening windows, recording audio, changing files, network operations, and process operations have real effects when run. Follow the corresponding package lifecycle before using live resources.
yeho/src/compiler/common/intrinsic_registry.cpp:1628