Rasterizer

Overview

Rasterizer is a class in Aspose.Font FOSS for Python.

Scanline rasterizer for GlyphPath outlines with pure-Python PNG export.

Properties

NameTypeAccessDescription
curve_tolerancefloatRead
width``Read
height``Read

Methods

SignatureDescription
__init__(width: int, height: int, background: tuple[int, int, int])
clear(color: tuple[int, int, int] | None)Fill entire buffer with background (or provided) color.
draw_path(path: GlyphPath, color: tuple[int, int, int], transform: tuple[float, ...] | None)Rasterize one path into the current RGB buffer.
to_png()bytesEncode current RGB buffer as 8-bit PNG (IHDR+IDAT+IEND).
close_contour()