Class cv::FontFace#

Wrapper on top of a truetype/opentype/etc font, i.e. Freetype's FT_Face. View details

Collaboration diagram for cv::FontFace:

Detailed Description#

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.

Examples
samples/dnn/classification.cpp, samples/dnn/object_detection.cpp, samples/dnn/segmentation.cpp, and samples/dnn/text_detection.cpp.

Constructor & Destructor Documentation#

FontFace()#

cv::FontFace::FontFace()

Python:

cv.FontFace(fontPathOrName) -> <FontFace object>

loads default font

FontFace()#

cv::FontFace::FontFace(const String & fontPathOrName)

Python:

cv.FontFace(fontPathOrName) -> <FontFace object>

loads font at the specified path or with specified name.

Parameters

  • fontPathOrName — either path to the custom font or the name of embedded font: “sans”, “italic” or “uni”. Empty fontPathOrName means the default embedded font.

~FontFace()#

cv::FontFace::~FontFace()

Member Function Documentation#

getInstance()#

bool cv::FontFace::getInstance(std::vector< int > & params)

Python:

cv.FontFace.getInstance() -> retval, params

getName()#

String cv::FontFace::getName()

Python:

cv.FontFace.getName() -> retval

operator->()#

Impl * cv::FontFace::operator->()

set()#

bool cv::FontFace::set(const String & fontPathOrName)

Python:

cv.FontFace.set(fontPathOrName) -> retval

loads new font face

setInstance()#

bool cv::FontFace::setInstance(const std::vector< int > & params)

Python:

cv.FontFace.setInstance(params) -> retval

sets the current variable font instance.

Parameters

  • params — The 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).

getBuiltinFontData()#

static bool cv::FontFace::getBuiltinFontData(
const String & fontName,
const uchar *& data,
size_t & datasize )

Member Data Documentation#

impl#

Ptr< Impl > cv::FontFace::impl

Source file#

The documentation for this class was generated from the following file: