getTextSize1
import { getTextSize1 } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Calculates the bounding rect for the text
The function cv::getTextSize calculates and returns the size of a box that contains the specified text. That is, the following code renders some text, the tight box surrounding it, and the baseline: :
getTextSize1(imgsize: Size, text: EmbindString, org: Point, fface: FontFace, size: number, weight: number, flags: number, wrap: Range): Rect;4 available overloads
getTextSize1(imgsize: Size, text: EmbindString, org: Point, fface: FontFace, size: number): Rect;getTextSize1(imgsize: Size, text: EmbindString, org: Point, fface: FontFace, size: number, weight: number): Rect;getTextSize1(imgsize: Size, text: EmbindString, org: Point, fface: FontFace, size: number, weight: number, flags: number): Rect;getTextSize1(imgsize: Size, text: EmbindString, org: Point, fface: FontFace, size: number, weight: number, flags: number, wrap: Range): Rect;imgsizeSize of the target image, can be empty
textText string to be drawn.
orgBottom-left corner of the first character of the printed text (see PUT_TEXT_ALIGN_... though)
ffaceThe font to use for the text
sizeFont size in pixels (by default) or pts
weightFont weight, 100..1000, where 100 is "thin" font, 400 is "regular", 600 is "semibold", 800 is "bold" and beyond that is "black". The default weight means "400" for variable-weight fonts or whatever "default" weight the used font provides.
flagsVarious flags, see PUT_TEXT_...
wrapThe optional text wrapping range; see #putText.
The Rect 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.