summaryrefslogtreecommitdiff
path: root/src/pdf.h
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-22 09:04:27 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-22 09:04:27 +0200
commit227d0422da0062410c85529bc999d7e509d9de78 (patch)
tree23102d1fb049b610ec154e7c136e3d92d941bd6d /src/pdf.h
parent8ceb1340a9030bb1030be61003dc65b444732b9e (diff)
downloadbokf-0.1.63.tar.gz
bokf-0.1.63.zip
documents: org name in the invoice and payslip headers, document_header_colorv0.1.63
Diffstat (limited to 'src/pdf.h')
-rw-r--r--src/pdf.h6
1 files changed, 6 insertions, 0 deletions
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);