cv.getTextSize - MATLAB File Help
cv.getTextSize

Calculates the width and height of a text string

[siz, baseLine] = cv.getTextSize(text)
[...] = cv.getTextSize(..., 'OptionName', optionValue, ...)

Input

Output

Options

The function cv.getTextSize calculates and returns the size of a box that contains the specified text.

Example

Refer to the draw_text_demo.m sample. The code renders some text, the tight box surrounding it, and the baseline.

See also