Font¶
- class Font(self: visp._visp.core.Font, height: int = 16, fontFamily: visp._visp.core.Font.FontFamily = TRUETYPE_FILE, ttfFilename: str = std::string(VISP_RUBIK_REGULAR_FONT_RESOURCES))¶
Bases:
pybind11_object
Font drawing functions for image.
Methods
Overloaded function.
Gets height of the font in pixels.
Gets text bounding box size.
Sets a new height value to font.
Inherited Methods
Operators
__doc__
__module__
Attributes
GENERIC_MONOSPACE
TRUETYPE_FILE
__annotations__
- __init__(self: visp._visp.core.Font, height: int = 16, fontFamily: visp._visp.core.Font.FontFamily = TRUETYPE_FILE, ttfFilename: str = std::string(VISP_RUBIK_REGULAR_FONT_RESOURCES))¶
- drawText(*args, **kwargs)¶
Overloaded function.
drawText(self: visp._visp.core.Font, I: visp._visp.core.ImageGray, text: str, position: visp._visp.core.ImagePoint, color: int) -> bool
Draws a text at the image.
- Parameters:
- I
Image where we draw text.
- text
A text to draw.
- position
A position to draw text.
- color
A color of the text.
- Returns:
A result of the operation.
drawText(self: visp._visp.core.Font, I: visp._visp.core.ImageGray, text: str, position: visp._visp.core.ImagePoint, color: int, background: int) -> bool
Draws a text at the image. Fills the text background by given color.
- Parameters:
- I
Image where we draw text.
- text
A text to draw.
- position
A position to draw text.
- color
A color of the text.
- background
Background color.
- Returns:
a result of the operation.
drawText(self: visp._visp.core.Font, I: visp._visp.core.ImageRGBa, text: str, position: visp._visp.core.ImagePoint, color: visp._visp.core.Color) -> bool
Draws a text at the image.
- Parameters:
- I
Image where we draw text.
- text
A text to draw.
- position
A position to draw text.
- color
A color of the text.
- Returns:
A result of the operation.
drawText(self: visp._visp.core.Font, I: visp._visp.core.ImageRGBa, text: str, position: visp._visp.core.ImagePoint, color: visp._visp.core.Color, background: visp._visp.core.Color) -> bool
Draws a text at the image. Fills the text background by given color.
- Parameters:
- I
Image where we draw text.
- text
A text to draw.
- position
A position to draw text.
- color
A color of the text.
- background
Background color.
- Returns:
a result of the operation.
- getMeasure(self, text: str) visp._visp.core.ImagePoint ¶
Gets text bounding box size.
- Returns:
The width ( j ) and height ( i ) of the text bounding box.