TextRenderer

개요

TextRenderer은 Aspose.Font FOSS에서 Python를 위해 제공되는 클래스입니다.

글꼴의 글리프 메트릭 및 선택적 커닝 페어를 사용하여 텍스트를 레이아웃합니다.

이 클래스는 Python 프로그램에서 TextRenderer 객체를 다루기 위한 5개의 메서드를 제공합니다. 사용 가능한 메서드에는 layout, layout_glyphs, render_png, render_rgb, render_svg가 포함됩니다. Aspose.Font FOSS for Python 패키지를 설치한 후 모든 Python 애플리케이션에서 모든 공개 멤버에 접근할 수 있습니다.

메서드

시그니처설명
layout(font: Font, text: str, size: float, kern: bool) → TextLayout텍스트를 GlyphIds으로 해결한 다음 layout_glyphs을 호출합니다.
layout_glyphs(font: Font, glyph_ids: list[GlyphId], size: float, kern: bool) → TextLayout미리 해결된 글리프 ID를 배치합니다.
`render_rgb(font: Font, text: str, size: float, color: tuple[int, int, int], background: tuple[int, int, int], padding: int, antialias: bool, _fixed_canvas: tuple[int, int]None, _fixed_baseline: float
render_png(font: Font, text: str, size: float, color: tuple[int, int, int], background: tuple[int, int, int], padding: int, antialias: bool) → bytes단일 행 텍스트를 소프트웨어 래스터화로 PNG 바이트에 렌더링합니다.
render_svg(font: Font, text: str, size: float, color: tuple[int, int, int], background: tuple[int, int, int], padding: int) → bytes벡터 윤곽선을 사용하여 단일 행 텍스트를 SVG 바이트로 렌더링합니다.

참조

 한국어