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.0.tar.gz (111.9 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.0-py3-none-any.whl (178.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tenderness-0.2.0.tar.gz
  • Upload date:
  • Size: 111.9 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.0.tar.gz
Algorithm Hash digest
SHA256 2c71f401ad6dec39f8b1ad50ee65e3b0d843574b31abf7aa2c032e40bf8e3d6a
MD5 f5a6c1cbce3d83d5e741d949dd15ac8f
BLAKE2b-256 e523b595b1c6a78699a968b655703ba37e46d887ae64c851364eb7805ec35da2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tenderness-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 178.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6802a077690885242760aae60e19d6dcc636bd57e6d3cff67e2cfb67eef3f136
MD5 dac7ebd01691fa42b2f1072bb1594f28
BLAKE2b-256 eb308d8bc0c031e0c630be0f14f7fb20cb3535ec1ed8e332a48dfe009967f513

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