FontPreviewBuilder

FontPreviewBuilder

Overview

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

FontPreviewBuilder.build(font, text, size, color, background, padding, antialias, file_stem, instance_coordinates, instance_name, output_format) generates a PreviewImage (PNG or SVG) of the supplied text rendered with the given font.

This class provides 4 methods for working with FontPreviewBuilder objects in Python programs. Available methods include: build, compose_difference_preview, compose_overlay_preview, compose_sheet. All public members are accessible to any Python application after installing the Aspose.Font FOSS for Python package.

Methods

SignatureDescription
build(font: Font, text: str, size: float, color: tuple[int, int, int], background: tuple[int, int, int], padding: int, antialias: bool, file_stem: str | None, instance_coordinates: dict[str, float] | None, instance_name: str | None, output_format: str)PreviewImageCreates a raster preview image (PNG or SVG) for a given font, text string, size, and color, while compose_difference_preview and compose_overlay_preview generate side‑by‑side comparison boards
compose_sheet(previews: list[PreviewImage], columns: int, gap: int, background: tuple[int, int, int], title: str | None, column_headers: list[str] | None, row_headers: list[str] | None, labels: list[str] | None, footer_lines: list[str] | None, label_color: tuple[int, int, int], file_stem: str)PreviewImageAssembles a grid of PreviewImage objects into one sheet with columns, gap, background, optional title, headers, labels and footer
compose_difference_preview(before: PreviewImage, after: PreviewImage, file_stem: str, background: tuple[int, int, int], before_color: tuple[int, int, int], after_color: tuple[int, int, int], overlap_color: tuple[int, int, int], threshold: int)PreviewImageGenerates a PreviewImage that visualizes differences between before and after images using specified colors and threshold
compose_overlay_preview(before: PreviewImage, after: PreviewImage, file_stem: str, background: tuple[int, int, int], before_color: tuple[int, int, int], after_color: tuple[int, int, int], overlap_color: tuple[int, int, int], threshold: int)PreviewImageProduces a PreviewImage overlaying before and after images with given colors and threshold

See Also