fontlabapp.qt.images.resources · declarations 001
Back to fontlabapp.qt.images.resources
RASTER_TYPES
module-attribute
RASTER_TYPES
find_image
find_image(name: str | None, resources: str | Path | None, *, extensions: tuple[str, ...] = IMAGE_TYPES, folders: tuple[str, ...] = ('',)) -> Path | None
Find a resource using the caller's ordered folders and extensions.
pdf_dimensions
pdf_dimensions(path: str | Path, *, run: Callable = run, executable: str = SIPS, timeout: float = SIPS_TIMEOUT) -> tuple[float, float] | None
The first page's size in points, or None when sips cannot read it.
raster_image
raster_image(qt: Any, path: str | Path, width: int, height: int) -> Any
Read the smallest frame covering the target, or the largest available.
render_pdf
render_pdf(path: str | Path, width: int, height: int, *, run: Callable = run, executable: str = SIPS, timeout: float = SIPS_TIMEOUT, scratch_prefix: str = 'fontlabapp-pdf-') -> bytes | None
PNG bytes of the page rasterised at width x height pixels.
retina_variant
retina_variant(path: str | Path, *, raster_types: tuple[str, ...] = RASTER_TYPES) -> Path | None
Find a raster's name@2x sibling using ordered format candidates.
run_sips
run_sips(argv: list[str], run: Callable, *, executable: str = SIPS, timeout: float = SIPS_TIMEOUT) -> Any
Run the bounded macOS image converter, returning None on launch/timeout errors.
svg_image
svg_image(qt: Any, renderer: Callable[[], Any], width: int, height: int) -> Any
Render onto transparent pixels and always end the owned painter.