FontFace
import { FontFace } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Native object: release it with using or delete(). Factories can return null; check before calling methods.
Wrapper on top of a truetype/opentype/etc font, i.e. Freetype's FT_Face.
The class is used to store the loaded fonts; the font can then be passed to the functions putText and getTextSize.
Constructors and members
static new
loads font at the specified path or with specified name.
new(fontPathOrName: EmbindString): FontFace;fontPathOrNameeither path to the custom font or the name of embedded font: "sans", "italic" or "uni". Empty fontPathOrName means the default embedded font.
The FontFace result.
clone
Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.
clone(): this;The this result.
set
loads new font face
set(fontPathOrName: EmbindString): boolean;fontPathOrNamefont path or name argument (EmbindString).
The boolean result.
getName
Return the name configured on this FontFace object.
getName(): string;The string result.
setInstance
sets the current variable font instance.
setInstance(params: IntVector): boolean;paramsThe list of pairs key1, value1, key2, value2, ..., e.g.
myfont.setInstance({CV_FOURCC('w','g','h','t'), 400<<16, CV_FOURCC('s','l','n','t'), -(15<<16)});Note that the parameter values are specified in 16.16 fixed-point format, that is, integer values need to be shifted by 16 (or multiplied by 65536).
The boolean result.
getInstance
Read the instance.
sets the current variable font instance.
getInstance(params: IntVector): boolean;paramsOutput destination, filled by the native operation. params argument (IntVector).
The boolean result.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.