dintlhaTsaMokwalo
Returns points along text outlines.
dintlhaTsaMokwalo(fonte, mafoko, x, y, [seelo], [nolofatso])Pass a font loaded with tlisaMofutatlhaka. Returns an array of points with x, y and alpha (path angle), without drawing or changing the font. Set text size and alignment first with bogoloJwaMokwalo and rulaganyaMokwalo. Sampling defaults to 0.1; larger values generate more points. Simplification defaults to 0; positive values remove nearly collinear points using an angle threshold in radians. Both options are positional numbers. This interface samples a single line with the current text settings; it does not expose wrapping boxes. The bundled jetbrains-mono-bold.ttf supports outlines; nunito.ttf currently supports drawn text only.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
fonte | mofutatlhaka | A loaded font. |
mafoko | mokwalo | The text to sample. |
x | palo | Text x position. |
y | palo | Text y position. |
seelo (optional) | palo | Sampling factor; defaults to 0.1. |
nolofatso (optional) | palo | Simplification angle in radians; defaults to 0. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(320, 220);
bokamorago(235);
diri fonte = letela tlisaMofutatlhaka("jetbrains-mono-bold.ttf");
bogoloJwaMokwalo(82);
diri dintlha = dintlhaTsaMokwalo(fonte, "Bopa", 35, 145, 0.2);
gopheta (diri ntlha mo dintlha) {
thalaSediko(ntlha.x, ntlha.y, 3);
}
emisaPoapoeletso();
}