aboutsummaryrefslogtreecommitdiff
path: root/tests/pdf_check.c
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 /tests/pdf_check.c
parent8ceb1340a9030bb1030be61003dc65b444732b9e (diff)
downloadbokf-227d0422da0062410c85529bc999d7e509d9de78.tar.gz
bokf-227d0422da0062410c85529bc999d7e509d9de78.zip
documents: org name in the invoice and payslip headers, document_header_colorv0.1.63
Diffstat (limited to 'tests/pdf_check.c')
-rw-r--r--tests/pdf_check.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/pdf_check.c b/tests/pdf_check.c
index 4d56cab..4eaf24d 100644
--- a/tests/pdf_check.c
+++ b/tests/pdf_check.c
@@ -82,6 +82,12 @@ int main(int argc, char **argv)
pdf_line(p, 0, 80, 595, 80, 0.5, "#314c59");
pdf_line(p, 20, 100, 575, 100, 0.25, "#314c59");
+ pdf_text_fit(p, 20, 220, "HB", 16, 8, 200, "#314c59", "Fitted");
+ pdf_text_fit(p, 20, 240, "H", 10, 8, 40, "#314c59",
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
+ pdf_text_fit(p, 20, 260, "H", 10, 8, 40, "#314c59", NULL);
+ pdf_text_fit(p, 20, 260, "H", 10, 8, 40, "#314c59", "");
+
put_text(p, "MAKANDRA", 20, 70, "HB", 16, "#ffffff");
put_text(p, "FAKTURA", 575 - pdf_text_width("H", 16, "FAKTURA"), 70,
"H", 16, "#ffffff");
@@ -123,6 +129,9 @@ int main(int argc, char **argv)
check(contains(data, len, "1 0 obj"), "object 1");
check(contains(data, len, "6 0 obj"), "object 6");
check(!contains(data, len, "\r"), "no CR");
+ check(contains(data, len, "Fitted"), "text_fit keeps short text");
+ check(contains(data, len, "(AAAAAA...)"),
+ "text_fit truncates long text");
if (argc > 1) {
FILE *f = fopen(argv[1], "wb");