Skip to main content

Text rendering library for synthetic data generation

Project description

Fallback image description

Source Code Examples Documentation Python Package Index Python versions

Ruff pre-commit NumPy docstrings pydoclint mypy License: Apache-2.0

tenderness is a fast library for synthetic, deterministic document rendering from text and images, powered by Cairo and Pango.

Why tenderness?

Most document datasets don’t come from real structure — they come from reconstruction. Text is rendered, then reverse-engineered back into layout using OCR, heuristics, or fragile parsing pipelines. The result is noisy, incomplete, and not reproducible.

tenderness flips this entirely.

It renders text directly into documents producing images, SVGs, and PDFs with fully known layout from the start. Every character placement, line break, and block position is defined at render time — not inferred afterward.

What this gives you

  • Generate large-scale synthetic document datasets
  • Provide precise structural supervision for vision-language models
  • Build benchmarks for layout understanding systems
  • Ground-truth layout across characters, clusters, runs, and lines

No OCR. No heuristics. No reconstruction. No manual annotation.

Just text in → fully structured document out.

Main Features

  • Multi-format output: Render text and images into Image, SVG, PDF, or NumPy arrays.

  • Composable content blocks: Build documents from simple primitives: TextBlock, ImageBlock, and TableBlock.

  • Minimal flexbox layout engine: A lightweight system that automatically resolves positioning and flow.

  • Exact bounding boxes (OBB + AABB, logical + ink): Extract multi-level data for text (character, cluster, run, line, layout) and blocks.

  • Rich typography & text flow: Custom fonts, hierarchical styling, Pango markup, automatic font fallback, and overflow-aware text continuation across blocks.

  • Composable pipelines: Use the built-in pipeline with pre-defined layouts, or build your own from scratch.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tenderness-0.2.1.tar.gz (112.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tenderness-0.2.1-py3-none-any.whl (178.3 kB view details)

Uploaded Python 3

File details

Details for the file tenderness-0.2.1.tar.gz.

File metadata

  • Download URL: tenderness-0.2.1.tar.gz
  • Upload date:
  • Size: 112.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tenderness-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7af7bcb99f10bb3d4bb4e0b495b179cfd0512d7326c77f73e324061141f41852
MD5 066ef15b5636a592112e318558484c62
BLAKE2b-256 d1357b1720b793de235ee55bfa1fa682a0f9ce12a35e66363086a5d26913e103

See more details on using hashes here.

File details

Details for the file tenderness-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tenderness-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 178.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tenderness-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa7cde3d5598a521bc5c99354924b5e42b5bfca28d4bca6746ae785b21ffa778
MD5 43e1db58eb5102e770391947079a3612
BLAKE2b-256 eae08265084a259ee2161a6320af1140dd65be39fbf50a6d5cffa7ec1791b75e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page