Expand description
A tiny, self-contained PDF 1.7 writer for GridCraft’s print and PDF export.
- The 14 standard fonts (no embedding) with WinAnsiEncoding, plus approximate width tables
(
text_width) so callers can measure, align and wrap text. Characters outside WinAnsiEncoding (CJK and other scripts) are set in a predefined, non-embedded Adobe-GB1 CID font with theUniGB-UTF16-HCMap instead of being replaced by?. Symbol uses its own built-in encoding (symbol_code), for Greek letters and mathematical operators. - Vector drawing: rectangles, lines (solid or dashed), polygons, circles (Bézier), clipping.
- RGBA images as RGB image XObjects with a soft mask for alpha (run-length encoded).
- Coordinates are points with a top-left origin (y grows down); text
yis the baseline.
Streams are written uncompressed (images use the trivial RunLengthDecode filter) so the crate needs no dependencies.
Structs§
- Info
- Document metadata.
- Page
- A page under construction. Obtain one with
PdfDoc::add_page. - PdfDoc
- A PDF document under construction.
- Point
- A point in page coordinates, measured from the top-left corner.
- Rect
- A page-space rectangle described by its top-left corner and extent.
Enums§
- Family
- A font family for
Font::styled. - Font
- The standard 14 fonts minus ZapfDingbats.
Functions§
- symbol_
code - The Symbol-encoding code for
c, orNonewhen Symbol has no such glyph. - symbol_
width - The advance width of code
codein 1/1000 em, orNonefor an empty slot. - text_
width - Width of
textin points when set infontatsizepoints. - win_
ansi - Unicode → WinAnsiEncoding (CP1252) byte; unmappable characters become
?.
Type Aliases§
- Rgb
- RGB colour, 0–255 per channel.