From 227d0422da0062410c85529bc999d7e509d9de78 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Tue, 22 Sep 2026 09:04:27 +0200 Subject: documents: org name in the invoice and payslip headers, document_header_color --- src/pdf.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pdf.h') diff --git a/src/pdf.h b/src/pdf.h index c6f95ac..9ed4595 100644 --- a/src/pdf.h +++ b/src/pdf.h @@ -20,6 +20,12 @@ void pdf_text(struct pdf *p, double x, double baseline, const char *font, double size, const char *rgb, const char *utf8); double pdf_text_width(const char *font, double size, const char *utf8); double pdf_font_ascent(const char *font, double size); +/* Draws utf8 at x/baseline, shrinking the size (down to min_size) to fit + max_w; if it still does not fit, truncates at a whole UTF-8 character so + the text ends with "...". */ +void pdf_text_fit(struct pdf *p, double x, double baseline, const char *font, + double size, double min_size, double max_w, const char *rgb, + const char *utf8); void pdf_path(struct pdf *p, const char *path, double x, double y, const char *rgb); unsigned char *pdf_finish(struct pdf *p, size_t *len); -- cgit v1.3