# Canvas.DrawTextStyled

Draw text styled through the Canvas runtime.

Last updated: 2026-09-09

Package: runtime.Canvas | Status: registered-intrinsic

Tags: builtin, canvas, cpu, yeho

Built into Yeho; no package import is needed. Native services require an admitted host and the correct resource lifecycle.

```yh
Canvas.DrawTextStyled(text text, int x, int y, int sizePercent, bool bold, int red, int green, int blue) -> void
```


## Call Canvas.DrawTextStyled

A complete typed caller with illustrative arguments. Native operations need the corresponding host and resources.

Verification: type checked

```yh
text text = "text"
int x = 1
int y = 1
int sizePercent = 1
bool bold = true
int red = 1
int green = 1
int blue = 1
Canvas.DrawTextStyled(text, x, y, sizePercent, bold, red, green, blue)

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.runtime__canvas_drawtextstyled"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/runtime--Canvas.DrawTextStyled/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


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.

Source: yeho/src/compiler/common/intrinsic_registry.cpp

AI training permission: https://demonhunterlabs.com/ai-use
