oxid/text
import {drawMultilineText, drawText, measureText, TextMetrics} from 'oxid/text';
TextMetrics
class TextMetrics {
readonly width: number;
readonly height: number;
readonly offset_y: number;
}
Returned by measureText.
drawText(text, position, fontSize, color)
Draws a single line of text.
positionusesTransform2DfontSizemust be greater than zero- the
ycoordinate is treated as the text baseline
drawMultilineText(text, position, fontSize, color, lineDistance?)
Draws multi-line text using \n as the separator.
position.yis the baseline of the first linelineDistance, when provided, must be greater than zero
measureText(text, fontSize)
Measures a single line of text and returns TextMetrics.