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

__init__

drawText

Overloaded function.

getHeight

Gets height of the font in pixels.

getMeasure

Gets text bounding box size.

setHeight

Sets a new height value to font.

Inherited Methods

Operators

__doc__

__init__

__module__

Attributes

GENERIC_MONOSPACE

TRUETYPE_FILE

__annotations__

class FontFamily(self, value: int)

Bases: pybind11_object

Values:

  • GENERIC_MONOSPACE

  • TRUETYPE_FILE

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
__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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

getHeight(self) int

Gets height of the font in pixels.

Returns:

Current height of the font.

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.

setHeight(self, height: int) bool

Sets a new height value to font.

Parameters:
height: int

A new height value in pixels.

Returns:

A result of the operation.