मुख्य सामग्री पर जाएँ

raygeo.geo.shape.text

FontConfig​

bold​

bold: bool

extra​

extra: dict

family​

family: str

font_family​

font_family: str

font_size​

font_size: float

italic​

italic: bool

size​

size: float

copy()​

copy() -> FontConfig
ParameterTypeDescription
ReturnsFontConfig

from_dict()​

from_dict(data: Optional[dict]) -> FontConfig
ParameterTypeDescription
dataOptional[dict]
ReturnsFontConfig

get_font_metrics()​

get_font_metrics() -> tuple[float, float, float]
ParameterTypeDescription
Returnstuple[float, float, float]

Ascent, descent, and height above the baseline

Ascent, descent, and height above the baseline

get_text_position()​

get_text_position(text: str, index: int) -> float
ParameterTypeDescription
textstr
indexint
Returnsfloat

get_text_width()​

get_text_width(text: str) -> float
ParameterTypeDescription
textstr
Returnsfloat

Text advance width and cursor position markers

Text advance width and cursor position markers

to_dict()​

to_dict() -> dict
ParameterTypeDescription
Returnsdict

Functions​

text_to_geometry()​

text_to_geometry(
text: str,
font_config: geo.shape.text.FontConfig,
) -> geo.Geometry

Convert a text string to a Geometry containing the glyph outlines.

ParameterTypeDescription
textstr
font_configgeo.shape.text.FontConfig
Returnsgeo.Geometry

Glyph outlines rendered as vector geometry

Glyph outlines rendered as vector geometry