diff options
Diffstat (limited to 'tests/pdf_check.c')
| -rw-r--r-- | tests/pdf_check.c | 9 |
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"); |
