Skip to main content

ImageFontSize

ClassEnumSource

ImageFontSize.h1 = "h1"
ImageFontSize.h2 = "h2"
ImageFontSize.h3 = "h3"
ImageFontSize.h4 = "h4"

Size of the text in the image.

This font size is high-level. When renderin the text, the pixel size of the text will be determined by this size and the number of characters.

Enums​

NameTypeValue
h1str"h1"
h2str"h2"
h3str"h3"
h4str"h4"

Methods​

from_str​

v_1: Self = ImageFontSize.from_str(val: str | Self)

Use a str to define this size.

Requires​

NameTypeRequired
Description
valstr | SelfShould be h1-h4.

Returns​

NameType
Description
v_1SelfThe size defined from val.

get_line_size​

(v_1: int, v_2: int) = self.get_line_size(n_text: int)

Get the sizes of the text.

Requires​

NameTypeRequired
Description
n_textintThe length of the text to be rendered.

Returns​

NameType
Description
v_1intThe number of characters for each line.
v_2intThe pixel font size.