text method

void text(
  1. StyleId style,
  2. String text
)

Writes text in style style of styles; a lone surrogate in it as U+FFFD, as UTF-8 has none.

Implementation

void text(StyleId style, String text) {
  _to(style);
  for (final c in text.runes) {
    out.codePoint(c >= 0xD800 && c <= 0xDFFF ? 0xFFFD : c);
  }
}