diff --git a/ChangeLog b/ChangeLog index c716643b..1a4b209c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ Version 2.12.0.9 (dev) not released yet horizontal alignments of EAN/UPC vector text also tweaked - Text (HRT) for standalone EAN-2 and EAN-5 now at top of symbol (was at bottom) +- Text height (font size) for SMALL_TEXT vector output reduced - For Windows, filenames are now assumed to be UTF-8 encoded. Affects `outfile` in `zint_symbol` and all API filename arguments - Never used `fontsize` field removed from `zint_symbol` @@ -72,6 +73,10 @@ Changes - CLI: add some more barcode synonyms for DBAR - common: various fiddlings - CMake: don't include png.c unless ZINT_USE_PNG (avoids clang warning) +- vector: reduce SMALL_TEXT font height 6 -> 5 to be more like raster; + reduce antialiasing allowance for `textoffset`; + adjust text to baseline using values for Arimo rather than percentage +- raster/vector: rename `text_height` -> `font_height` Bugs ---- @@ -92,6 +97,7 @@ Bugs - EAN/UPC: fix excess 1X to right of add-ons - Composites: fix excess whitespace; fix quiet zone calcs to allow for linear shifting +- GUI: fix not enabling font combo "Small Bold (vector only)" by default Version 2.12.0 (2022-12-12) diff --git a/backend/raster.c b/backend/raster.c index 681abb5c..192fe533 100644 --- a/backend/raster.c +++ b/backend/raster.c @@ -915,7 +915,7 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl int hide_text; int i, r; int block_width = 0; - int text_height; /* Font pixel size (so whole integers) */ + int font_height; /* Font pixel size (so whole integers) */ float text_gap; /* Gap between barcode and text */ float guard_descent; const int upcean_guard_whitespace = !(symbol->output_options & BARCODE_NO_QUIET_ZONES) @@ -969,13 +969,13 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl /* Note font sizes halved as in pixels */ if (upceanflag) { textflags = UPCEAN_TEXT | (symbol->output_options & SMALL_TEXT); /* Bold not available for UPC/EAN */ - text_height = (UPCEAN_FONT_HEIGHT + 1) / 2; + font_height = (UPCEAN_FONT_HEIGHT + 1) / 2; text_gap = symbol->text_gap ? symbol->text_gap : 1.0f; /* Height of guard bar descent (none for EAN-2 and EAN-5) */ guard_descent = upceanflag >= 6 ? symbol->guard_descent : 0.0f; } else { textflags = symbol->output_options & (SMALL_TEXT | BOLD_TEXT); - text_height = textflags & SMALL_TEXT ? (SMALL_FONT_HEIGHT + 1) / 2 : (NORMAL_FONT_HEIGHT + 1) / 2; + font_height = textflags & SMALL_TEXT ? (SMALL_FONT_HEIGHT + 1) / 2 : (NORMAL_FONT_HEIGHT + 1) / 2; text_gap = symbol->text_gap ? symbol->text_gap : 1.0f; guard_descent = 0.0f; } @@ -983,10 +983,13 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl if (hide_text) { textoffset = guard_descent; } else { - if (text_height + text_gap > guard_descent) { - textoffset = text_height + text_gap; + if (upceanflag) { + textoffset = font_height + text_gap; + if (textoffset < guard_descent) { + textoffset = guard_descent; + } } else { - textoffset = guard_descent; + textoffset = font_height + text_gap; } } @@ -1032,7 +1035,7 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl && module_is_set(symbol, r, i + block_width) == fill; block_width++); if ((r == (symbol->rows - 1)) && (i > main_width) && (addon_latch == 0)) { int addon_row_height_si; - const int text_offset_si = (text_height + text_gap) * si; + const int text_offset_si = (font_height + text_gap) * si; copy_bar_line(pixelbuf, xoffset_si, main_width * si, yposn_si, row_height_si, image_width, image_height); addon_text_yposn = yposn_si; @@ -1066,7 +1069,7 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl } else { if (upceanflag && !hide_text) { /* EAN-2, EAN-5 (standalone add-ons) */ - yposn_si += (int) (text_height + text_gap) * si; + yposn_si += (int) (font_height + text_gap) * si; } for (r = 0; r < symbol->rows; r++) { const int row_height_si = row_heights_si[r]; diff --git a/backend/tests/data/emf/code128_egrave_bold.emf b/backend/tests/data/emf/code128_egrave_bold.emf index 95270b3b..adcafb26 100644 Binary files a/backend/tests/data/emf/code128_egrave_bold.emf and b/backend/tests/data/emf/code128_egrave_bold.emf differ diff --git a/backend/tests/data/emf/code128_egrave_bold_100dpi.emf b/backend/tests/data/emf/code128_egrave_bold_100dpi.emf index f1cce5cb..96a6778c 100644 Binary files a/backend/tests/data/emf/code128_egrave_bold_100dpi.emf and b/backend/tests/data/emf/code128_egrave_bold_100dpi.emf differ diff --git a/backend/tests/data/emf/code128_egrave_bold_1200dpi.emf b/backend/tests/data/emf/code128_egrave_bold_1200dpi.emf index 284e2636..b038e0d2 100644 Binary files a/backend/tests/data/emf/code128_egrave_bold_1200dpi.emf and b/backend/tests/data/emf/code128_egrave_bold_1200dpi.emf differ diff --git a/backend/tests/data/emf/code128_egrave_bold_150dpi.emf b/backend/tests/data/emf/code128_egrave_bold_150dpi.emf index 40743387..fee503ef 100644 Binary files a/backend/tests/data/emf/code128_egrave_bold_150dpi.emf and b/backend/tests/data/emf/code128_egrave_bold_150dpi.emf differ diff --git a/backend/tests/data/emf/code128_egrave_bold_300dpi.emf b/backend/tests/data/emf/code128_egrave_bold_300dpi.emf index 3b265579..19d3493c 100644 Binary files a/backend/tests/data/emf/code128_egrave_bold_300dpi.emf and b/backend/tests/data/emf/code128_egrave_bold_300dpi.emf differ diff --git a/backend/tests/data/emf/code128_egrave_bold_400dpi.emf b/backend/tests/data/emf/code128_egrave_bold_400dpi.emf index 6471bf4a..fd6d6b7e 100644 Binary files a/backend/tests/data/emf/code128_egrave_bold_400dpi.emf and b/backend/tests/data/emf/code128_egrave_bold_400dpi.emf differ diff --git a/backend/tests/data/emf/code39_rotate_180.emf b/backend/tests/data/emf/code39_rotate_180.emf index edb7a760..196fce2d 100644 Binary files a/backend/tests/data/emf/code39_rotate_180.emf and b/backend/tests/data/emf/code39_rotate_180.emf differ diff --git a/backend/tests/data/emf/code39_rotate_270.emf b/backend/tests/data/emf/code39_rotate_270.emf index 80509061..b282a40c 100644 Binary files a/backend/tests/data/emf/code39_rotate_270.emf and b/backend/tests/data/emf/code39_rotate_270.emf differ diff --git a/backend/tests/data/emf/code39_rotate_90.emf b/backend/tests/data/emf/code39_rotate_90.emf index 41567751..f85206aa 100644 Binary files a/backend/tests/data/emf/code39_rotate_90.emf and b/backend/tests/data/emf/code39_rotate_90.emf differ diff --git a/backend/tests/data/emf/code39_rotate_90_300dpi.emf b/backend/tests/data/emf/code39_rotate_90_300dpi.emf index e526ed04..871f9976 100644 Binary files a/backend/tests/data/emf/code39_rotate_90_300dpi.emf and b/backend/tests/data/emf/code39_rotate_90_300dpi.emf differ diff --git a/backend/tests/data/emf/itf14_bold.emf b/backend/tests/data/emf/itf14_bold.emf index 3d41d7c4..7b11c088 100644 Binary files a/backend/tests/data/emf/itf14_bold.emf and b/backend/tests/data/emf/itf14_bold.emf differ diff --git a/backend/tests/data/emf/itf14_bold_600dpi.emf b/backend/tests/data/emf/itf14_bold_600dpi.emf index 559917f0..c57b6fbf 100644 Binary files a/backend/tests/data/emf/itf14_bold_600dpi.emf and b/backend/tests/data/emf/itf14_bold_600dpi.emf differ diff --git a/backend/tests/data/emf/telenum_fg_bg.emf b/backend/tests/data/emf/telenum_fg_bg.emf index 93cf8d78..3aa63cd6 100644 Binary files a/backend/tests/data/emf/telenum_fg_bg.emf and b/backend/tests/data/emf/telenum_fg_bg.emf differ diff --git a/backend/tests/data/emf/telenum_fg_bg_150dpi.emf b/backend/tests/data/emf/telenum_fg_bg_150dpi.emf index 0cca7cb1..d596d1cb 100644 Binary files a/backend/tests/data/emf/telenum_fg_bg_150dpi.emf and b/backend/tests/data/emf/telenum_fg_bg_150dpi.emf differ diff --git a/backend/tests/data/emf/upu_s10_cmyk_nobg.emf b/backend/tests/data/emf/upu_s10_cmyk_nobg.emf index 26e5c6db..cbd97acf 100644 Binary files a/backend/tests/data/emf/upu_s10_cmyk_nobg.emf and b/backend/tests/data/emf/upu_s10_cmyk_nobg.emf differ diff --git a/backend/tests/data/eps/code128_egrave_bold.eps b/backend/tests/data/eps/code128_egrave_bold.eps index f781fa86..3f3cac59 100644 --- a/backend/tests/data/eps/code128_egrave_bold.eps +++ b/backend/tests/data/eps/code128_egrave_bold.eps @@ -2,14 +2,14 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 224 119 +%%BoundingBox: 0 0 224 117 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 1 1 1 setrgbcolor -118.9 0 0 224 R +116.28 0 0 224 R 0 0 0 setrgbcolor -100 18.9 I 0 4 R +100 16.28 I 0 4 R I 6 2 R I 12 2 R I 22 2 R @@ -48,6 +48,6 @@ currentdict end /Helvetica-ISOLatin1 exch definefont pop /Helvetica-ISOLatin1 findfont 14 scalefont setfont - 112 4.9 moveto + 112 2.94 moveto (gjpqy) stringwidth pop -2 div 0 rmoveto (gjpqy) show diff --git a/backend/tests/data/eps/code128_egrave_bold_rotate_180.eps b/backend/tests/data/eps/code128_egrave_bold_rotate_180.eps index 6cf900b9..daf6ab2b 100644 --- a/backend/tests/data/eps/code128_egrave_bold_rotate_180.eps +++ b/backend/tests/data/eps/code128_egrave_bold_rotate_180.eps @@ -2,12 +2,12 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 224 119 +%%BoundingBox: 0 0 224 117 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 1 1 1 setrgbcolor -118.9 0 0 224 R +116.28 0 0 224 R 0 0 0 setrgbcolor 100 0 I 220 4 R I 216 2 R @@ -48,7 +48,7 @@ currentdict end /Helvetica-ISOLatin1 exch definefont pop /Helvetica-ISOLatin1 findfont 14 scalefont setfont - 112 114 moveto + 112 113.34 moveto gsave 180 rotate (gjpqy) stringwidth pop -2 div 0 rmoveto diff --git a/backend/tests/data/eps/code128_egrave_bold_rotate_270.eps b/backend/tests/data/eps/code128_egrave_bold_rotate_270.eps index a76f2d6a..3f5f2183 100644 --- a/backend/tests/data/eps/code128_egrave_bold_rotate_270.eps +++ b/backend/tests/data/eps/code128_egrave_bold_rotate_270.eps @@ -2,12 +2,12 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 119 224 +%%BoundingBox: 0 0 117 224 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 1 1 1 setrgbcolor -224 0 0 118.9 R +224 0 0 116.28 R 0 0 0 setrgbcolor 4 0 0 100 R 2 6 0 100 R @@ -48,7 +48,7 @@ currentdict end /Helvetica-ISOLatin1 exch definefont pop /Helvetica-ISOLatin1 findfont 14 scalefont setfont - 114 112 moveto + 113.34 112 moveto gsave 90 rotate (gjpqy) stringwidth pop -2 div 0 rmoveto diff --git a/backend/tests/data/eps/code128_egrave_bold_rotate_90.eps b/backend/tests/data/eps/code128_egrave_bold_rotate_90.eps index 459ddeec..bb9f39d6 100644 --- a/backend/tests/data/eps/code128_egrave_bold_rotate_90.eps +++ b/backend/tests/data/eps/code128_egrave_bold_rotate_90.eps @@ -2,44 +2,44 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 119 224 +%%BoundingBox: 0 0 117 224 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 1 1 1 setrgbcolor -224 0 0 118.9 R +224 0 0 116.28 R 0 0 0 setrgbcolor -4 220 18.9 100 R -2 216 18.9 100 R -2 210 18.9 100 R -2 200 18.9 100 R -8 190 18.9 100 R -6 182 18.9 100 R -4 176 18.9 100 R -2 168 18.9 100 R -2 160 18.9 100 R -2 156 18.9 100 R -4 148 18.9 100 R -2 144 18.9 100 R -2 134 18.9 100 R -4 122 18.9 100 R -2 116 18.9 100 R -2 112 18.9 100 R -2 108 18.9 100 R -8 96 18.9 100 R -2 90 18.9 100 R -2 84 18.9 100 R -8 74 18.9 100 R -4 66 18.9 100 R -4 60 18.9 100 R -8 50 18.9 100 R -2 46 18.9 100 R -4 36 18.9 100 R -2 28 18.9 100 R -4 22 18.9 100 R -6 10 18.9 100 R -2 6 18.9 100 R -4 0 18.9 100 R +4 220 16.28 100 R +2 216 16.28 100 R +2 210 16.28 100 R +2 200 16.28 100 R +8 190 16.28 100 R +6 182 16.28 100 R +4 176 16.28 100 R +2 168 16.28 100 R +2 160 16.28 100 R +2 156 16.28 100 R +4 148 16.28 100 R +2 144 16.28 100 R +2 134 16.28 100 R +4 122 16.28 100 R +2 116 16.28 100 R +2 112 16.28 100 R +2 108 16.28 100 R +8 96 16.28 100 R +2 90 16.28 100 R +2 84 16.28 100 R +8 74 16.28 100 R +4 66 16.28 100 R +4 60 16.28 100 R +8 50 16.28 100 R +2 46 16.28 100 R +4 36 16.28 100 R +2 28 16.28 100 R +4 22 16.28 100 R +6 10 16.28 100 R +2 6 16.28 100 R +4 0 16.28 100 R /Helvetica-Bold findfont dup length dict begin {1 index /FID ne {def} {pop pop} ifelse} forall @@ -48,7 +48,7 @@ currentdict end /Helvetica-ISOLatin1 exch definefont pop /Helvetica-ISOLatin1 findfont 14 scalefont setfont - 4.9 112 moveto + 2.94 112 moveto gsave 270 rotate (gjpqy) stringwidth pop -2 div 0 rmoveto diff --git a/backend/tests/data/eps/code128_escape_latin1.eps b/backend/tests/data/eps/code128_escape_latin1.eps index 8a23881a..3200b6ce 100644 --- a/backend/tests/data/eps/code128_escape_latin1.eps +++ b/backend/tests/data/eps/code128_escape_latin1.eps @@ -2,14 +2,14 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 246 119 +%%BoundingBox: 0 0 246 117 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 1 1 1 setrgbcolor -118.9 0 0 246 R +116.28 0 0 246 R 0 0 0 setrgbcolor -100 18.9 I 0 4 R +100 16.28 I 0 4 R I 6 2 R I 12 2 R I 22 2 R @@ -51,6 +51,6 @@ currentdict end /Helvetica-ISOLatin1 exch definefont pop /Helvetica-ISOLatin1 findfont 14 scalefont setfont - 123 4.9 moveto + 123 2.94 moveto (A\\B\)\(D) stringwidth pop -2 div 0 rmoveto (A\\B\)\(D) show diff --git a/backend/tests/data/eps/code39_fg_bg.eps b/backend/tests/data/eps/code39_fg_bg.eps index 9ac2e8e2..5e46325e 100644 --- a/backend/tests/data/eps/code39_fg_bg.eps +++ b/backend/tests/data/eps/code39_fg_bg.eps @@ -2,14 +2,14 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 128 119 +%%BoundingBox: 0 0 128 117 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 0.99 0.59 0.19 setrgbcolor -118.9 0 0 128 R +116.28 0 0 128 R 0.08 0.48 0.82 setrgbcolor -100 18.9 I 0 2 R +100 16.28 I 0 2 R I 6 2 R I 10 4 R I 16 4 R @@ -35,6 +35,6 @@ I 114 4 R I 120 4 R 126 2 R /Helvetica findfont 14 scalefont setfont - 64 4.9 moveto + 64 2.94 moveto (*123*) stringwidth pop -2 div 0 rmoveto (*123*) show diff --git a/backend/tests/data/eps/code39_fgalpha_bg_cmyk.eps b/backend/tests/data/eps/code39_fgalpha_bg_cmyk.eps index 3cbe8afe..b96b24f8 100644 --- a/backend/tests/data/eps/code39_fgalpha_bg_cmyk.eps +++ b/backend/tests/data/eps/code39_fgalpha_bg_cmyk.eps @@ -2,14 +2,14 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 128 119 +%%BoundingBox: 0 0 128 117 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 0 0.4 0.81 0.01 setcmykcolor -118.9 0 0 128 R +116.28 0 0 128 R 0.9 0.41 0 0.18 setcmykcolor -100 18.9 I 0 2 R +100 16.28 I 0 2 R I 6 2 R I 10 4 R I 16 4 R @@ -35,6 +35,6 @@ I 114 4 R I 120 4 R 126 2 R /Helvetica findfont 14 scalefont setfont - 64 4.9 moveto + 64 2.94 moveto (*123*) stringwidth pop -2 div 0 rmoveto (*123*) show diff --git a/backend/tests/data/eps/code39_nobg_cmyk.eps b/backend/tests/data/eps/code39_nobg_cmyk.eps index de16bff5..e4bca1f8 100644 --- a/backend/tests/data/eps/code39_nobg_cmyk.eps +++ b/backend/tests/data/eps/code39_nobg_cmyk.eps @@ -2,12 +2,12 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 128 119 +%%BoundingBox: 0 0 128 117 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 0.9 0.4 0 0.09 setcmykcolor -100 18.9 I 0 2 R +100 16.28 I 0 2 R I 6 2 R I 10 4 R I 16 4 R @@ -33,6 +33,6 @@ I 114 4 R I 120 4 R 126 2 R /Helvetica findfont 14 scalefont setfont - 64 4.9 moveto + 64 2.94 moveto (*123*) stringwidth pop -2 div 0 rmoveto (*123*) show diff --git a/backend/tests/data/eps/code39_small.eps b/backend/tests/data/eps/code39_small.eps new file mode 100644 index 00000000..f757f9f0 --- /dev/null +++ b/backend/tests/data/eps/code39_small.eps @@ -0,0 +1,40 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Zint 2.12.0.9 +%%Title: Zint Generated Symbol +%%Pages: 0 +%%BoundingBox: 0 0 128 113 +%%EndComments +/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def +/I { 2 copy } bind def +1 1 1 setrgbcolor +112.2 0 0 128 R +0 0 0 setrgbcolor +100 12.2 I 0 2 R +I 6 2 R +I 10 4 R +I 16 4 R +I 22 2 R +I 26 4 R +I 32 2 R +I 38 2 R +I 42 2 R +I 46 4 R +I 52 2 R +I 56 4 R +I 64 2 R +I 68 2 R +I 72 4 R +I 78 4 R +I 84 4 R +I 92 2 R +I 96 2 R +I 100 2 R +I 104 2 R +I 110 2 R +I 114 4 R +I 120 4 R +126 2 R +/Helvetica findfont 10 scalefont setfont + 64 2.1 moveto + (*123*) stringwidth pop -2 div 0 rmoveto + (*123*) show diff --git a/backend/tests/data/eps/dbar_ltd_24724_fig7_bold.eps b/backend/tests/data/eps/dbar_ltd_24724_fig7_bold.eps index 44e48199..3f83a4a2 100644 --- a/backend/tests/data/eps/dbar_ltd_24724_fig7_bold.eps +++ b/backend/tests/data/eps/dbar_ltd_24724_fig7_bold.eps @@ -2,14 +2,14 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 158 119 +%%BoundingBox: 0 0 158 117 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 1 1 1 setrgbcolor -118.9 0 0 158 R +116.28 0 0 158 R 0 0 0 setrgbcolor -100 18.9 I 2 2 R +100 16.28 I 2 2 R I 10 4 R I 18 4 R I 28 4 R @@ -33,6 +33,6 @@ I 132 4 R I 140 4 R 146 2 R /Helvetica-Bold findfont 14 scalefont setfont - 79 4.9 moveto + 79 2.94 moveto (\(01\)15012345678907) stringwidth pop -2 div 0 rmoveto (\(01\)15012345678907) show diff --git a/backend/tests/data/print/emf/code128_aim.emf b/backend/tests/data/print/emf/code128_aim.emf index b0f33736..88521df8 100644 Binary files a/backend/tests/data/print/emf/code128_aim.emf and b/backend/tests/data/print/emf/code128_aim.emf differ diff --git a/backend/tests/data/print/eps/code128_aim.eps b/backend/tests/data/print/eps/code128_aim.eps index d6fe0809..5969fdfa 100644 --- a/backend/tests/data/print/eps/code128_aim.eps +++ b/backend/tests/data/print/eps/code128_aim.eps @@ -2,14 +2,14 @@ %%Creator: Zint 2.12.0.9 %%Title: Zint Generated Symbol %%Pages: 0 -%%BoundingBox: 0 0 136 119 +%%BoundingBox: 0 0 136 117 %%EndComments /R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def /I { 2 copy } bind def 1 1 1 setrgbcolor -118.9 0 0 136 R +116.28 0 0 136 R 0 0 0 setrgbcolor -100 18.9 I 0 4 R +100 16.28 I 0 4 R I 6 2 R I 12 2 R I 22 2 R @@ -29,6 +29,6 @@ I 120 6 R I 128 2 R 132 4 R /Helvetica findfont 14 scalefont setfont - 68 4.9 moveto + 68 2.94 moveto (AIM) stringwidth pop -2 div 0 rmoveto (AIM) show diff --git a/backend/tests/data/print/svg/code128_aim.svg b/backend/tests/data/print/svg/code128_aim.svg index 3e44dcdd..96005e08 100644 --- a/backend/tests/data/print/svg/code128_aim.svg +++ b/backend/tests/data/print/svg/code128_aim.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + AIM diff --git a/backend/tests/data/svg/channel_cmyk_nobg.svg b/backend/tests/data/svg/channel_cmyk_nobg.svg index 4b5e2973..c92aa84e 100644 --- a/backend/tests/data/svg/channel_cmyk_nobg.svg +++ b/backend/tests/data/svg/channel_cmyk_nobg.svg @@ -1,10 +1,10 @@ - + Zint Generated Symbol - + 123 diff --git a/backend/tests/data/svg/code128_amperands.svg b/backend/tests/data/svg/code128_amperands.svg index bc00bea6..80c94a2e 100644 --- a/backend/tests/data/svg/code128_amperands.svg +++ b/backend/tests/data/svg/code128_amperands.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + <>"&' diff --git a/backend/tests/data/svg/code128_egrave_bold.svg b/backend/tests/data/svg/code128_egrave_bold.svg index 31c7fe8b..2dae6fc1 100644 --- a/backend/tests/data/svg/code128_egrave_bold.svg +++ b/backend/tests/data/svg/code128_egrave_bold.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + Égjpqy diff --git a/backend/tests/data/svg/code128_egrave_bold_box3.svg b/backend/tests/data/svg/code128_egrave_bold_box3.svg index a5d72094..71b51f21 100644 --- a/backend/tests/data/svg/code128_egrave_bold_box3.svg +++ b/backend/tests/data/svg/code128_egrave_bold_box3.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + Égjpqy diff --git a/backend/tests/data/svg/code128_egrave_bold_embed.svg b/backend/tests/data/svg/code128_egrave_bold_embed.svg index 9c73d0ef..d963d65f 100644 --- a/backend/tests/data/svg/code128_egrave_bold_embed.svg +++ b/backend/tests/data/svg/code128_egrave_bold_embed.svg @@ -1,12 +1,12 @@ - + Zint Generated Symbol - + - + Égjpqy diff --git a/backend/tests/data/svg/code128_egrave_bold_hvwsp2_box2.svg b/backend/tests/data/svg/code128_egrave_bold_hvwsp2_box2.svg index a839a83d..19bee711 100644 --- a/backend/tests/data/svg/code128_egrave_bold_hvwsp2_box2.svg +++ b/backend/tests/data/svg/code128_egrave_bold_hvwsp2_box2.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + Égjpqy diff --git a/backend/tests/data/svg/code128_egrave_bold_hvwsp3.svg b/backend/tests/data/svg/code128_egrave_bold_hvwsp3.svg index 4d7cffbe..1e98509f 100644 --- a/backend/tests/data/svg/code128_egrave_bold_hvwsp3.svg +++ b/backend/tests/data/svg/code128_egrave_bold_hvwsp3.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + Égjpqy diff --git a/backend/tests/data/svg/code39_small.svg b/backend/tests/data/svg/code39_small.svg index 43daf11e..bea5d3d4 100644 --- a/backend/tests/data/svg/code39_small.svg +++ b/backend/tests/data/svg/code39_small.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + *123* diff --git a/backend/tests/data/svg/dbar_ltd.svg b/backend/tests/data/svg/dbar_ltd.svg index 9aa5347b..b4c7d638 100644 --- a/backend/tests/data/svg/dbar_ltd.svg +++ b/backend/tests/data/svg/dbar_ltd.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (01)00123456789098 diff --git a/backend/tests/data/svg/dpd_compliant.svg b/backend/tests/data/svg/dpd_compliant.svg index 434a6b8d..3f469a00 100644 --- a/backend/tests/data/svg/dpd_compliant.svg +++ b/backend/tests/data/svg/dpd_compliant.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 0081 827 0998 0000 0200 28 101 276 B diff --git a/backend/tests/data/svg/gs1_128_cc_fig12.svg b/backend/tests/data/svg/gs1_128_cc_fig12.svg index 427b8a98..445f4127 100644 --- a/backend/tests/data/svg/gs1_128_cc_fig12.svg +++ b/backend/tests/data/svg/gs1_128_cc_fig12.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (00)030123456789012340 diff --git a/backend/tests/data/svg/telepen_height0.4_rotate_180.svg b/backend/tests/data/svg/telepen_height0.4_rotate_180.svg index 490aca1f..549a1052 100644 --- a/backend/tests/data/svg/telepen_height0.4_rotate_180.svg +++ b/backend/tests/data/svg/telepen_height0.4_rotate_180.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - - - + + + A diff --git a/backend/tests/test_ps.c b/backend/tests/test_ps.c index 1c61eb10..bf38b3dd 100644 --- a/backend/tests/test_ps.c +++ b/backend/tests/test_ps.c @@ -60,54 +60,55 @@ static void test_print(const testCtx *const p_ctx) { /* 4*/ { BARCODE_CODE39, -1, -1, -1, -1, -1, -1, -1, 0, 0, "147AD0", "FC9630", 0, "123", "code39_fg_bg.eps" }, /* 5*/ { BARCODE_CODE39, -1, -1, CMYK_COLOUR, -1, -1, -1, -1, 0, 0, "147AD0EE", "FC9630", 0, "123", "code39_fgalpha_bg_cmyk.eps" }, /* 6*/ { BARCODE_CODE39, -1, -1, CMYK_COLOUR, -1, -1, -1, -1, 0, 0, "90,40,0,9", "FC963000", 0, "123", "code39_nobg_cmyk.eps" }, - /* 7*/ { BARCODE_ULTRA, -1, -1, -1, -1, -1, -1, -1, 0, 0, "147AD0", "FC9630", 0, "123", "ultra_fg_bg.eps" }, - /* 8*/ { BARCODE_ULTRA, -1, 1, BARCODE_BOX, 2, -1, -1, -1, 0, 0, "0000FF", "FF0000", 0, "123", "ultra_fg_bg_box.eps" }, - /* 9*/ { BARCODE_ULTRA, -1, 2, BARCODE_BOX | CMYK_COLOUR, 1, 1, -1, -1, 0, 0, "0000FF", "FF0000", 0, "123", "ultra_fg_bg_box_cmyk.eps" }, - /* 10*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "9501101531000", "ean13_ggs_5.2.2.1-1.eps" }, - /* 11*/ { BARCODE_EANX, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "9501101531000", "ean13_ggs_5.2.2.1-1_gws.eps" }, - /* 12*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "9771384524017+12", "ean13_2addon_ggs_5.2.2.5.1-2.eps" }, - /* 13*/ { BARCODE_EANX, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "9771384524017+12", "ean13_2addon_ggs_5.2.2.5.1-2_gws.eps" }, - /* 14*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "9501234", "ean8_gss_5.2.2.2-1.eps" }, - /* 15*/ { BARCODE_EANX, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "9501234", "ean8_gss_5.2.2.2-1_gws.eps" }, - /* 16*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "98765", "ean5.eps" }, - /* 17*/ { BARCODE_EANX, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "98765", "ean5_gws.eps" }, - /* 18*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "012345678905+24", "upca_2addon_ggs_5.2.6.6-5.eps" }, - /* 19*/ { BARCODE_UPCA, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "012345678905+24", "upca_2addon_ggs_5.2.6.6-5_gws.eps" }, - /* 20*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 90, "012345678905+24", "upca_2addon_ggs_5.2.6.6-5_rotate_90.eps" }, - /* 21*/ { BARCODE_UPCA, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 180, "012345678905+24", "upca_2addon_ggs_5.2.6.6-5_gws_rotate_180.eps" }, - /* 22*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "0123456+12345", "upce_5addon.eps" }, - /* 23*/ { BARCODE_UPCE, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "0123456+12345", "upce_5addon_gws.eps" }, - /* 24*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 270, "0123456+12345", "upce_5addon_rotate_270.eps" }, - /* 25*/ { BARCODE_UPCE, -1, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, -1, 0, 0, "", "", 0, "0123456+12345", "upce_5addon_small_bold.eps" }, - /* 26*/ { BARCODE_UPCE, -1, -1, SMALL_TEXT | BOLD_TEXT | EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "0123456+12345", "upce_5addon_small_bold_gws.eps" }, - /* 27*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "A\\B)ç(D", "code128_escape_latin1.eps" }, - /* 28*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, -1, -1, -1, -1, 0, 0, "", "", 0, "1501234567890", "dbar_ltd_24724_fig7_bold.eps" }, - /* 29*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0.1, 0, "", "", 0, "12", "dotcode_0.1.eps" }, - /* 30*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0.08, 0, "", "", 0, "12", "dotcode_0.1.eps" }, - /* 31*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "12", "dotcode_1.0.eps" }, - /* 32*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0.1, "", "", 0, "12", "dotcode_1.0_ds0.1.eps" }, - /* 33*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 1.1, "", "", 0, "12", "dotcode_1.0_ds1.1.eps" }, - /* 34*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 0, "", "", 0, "12", "dotcode_1.5.eps" }, - /* 35*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 0.4, "", "", 0, "12", "dotcode_1.5_ds0.4.eps" }, - /* 36*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 1.1, "", "", 0, "12", "dotcode_1.5_ds1.1.eps" }, - /* 37*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 2.1, "", "", 0, "12", "dotcode_1.5_ds2.1.eps" }, - /* 38*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 0, "", "", 0, "12", "dotcode_2.0.eps" }, - /* 39*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 0.9, "", "", 0, "12", "dotcode_2.0_ds0.9.eps" }, - /* 40*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 1.1, "", "", 0, "12", "dotcode_2.0_ds1.1.eps" }, - /* 41*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 0, "", "", 0, "12", "dotcode_3.0.eps" }, - /* 42*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 0.4, "", "", 0, "12", "dotcode_3.0_ds0.4.eps" }, - /* 43*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 1.1, "", "", 0, "12", "dotcode_3.0_ds1.1.eps" }, - /* 44*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 0, "", "", 0, "12", "dotcode_3.5.eps" }, - /* 45*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 0.4, "", "", 0, "12", "dotcode_3.5_ds0.4.eps" }, - /* 46*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 1.1, "", "", 0, "12", "dotcode_3.5_ds1.1.eps" }, - /* 47*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 0, "", "", 0, "12", "dotcode_5.0.eps" }, - /* 48*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 0.2, "", "", 0, "12", "dotcode_5.0_ds0.2.eps" }, - /* 49*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 1.1, "", "", 0, "12", "dotcode_5.0_ds1.1.eps" }, - /* 50*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 1.7, "", "", 0, "12", "dotcode_5.0_ds1.7.eps" }, - /* 51*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "FF0000", "0000FF00", 0, "12", "dotcode_no_bg.eps" }, - /* 52*/ { BARCODE_MAXICODE, -1, -1, CMYK_COLOUR, -1, -1, -1, -1, 0, 0, "", "", 270, "12", "maxicode_rotate_270_cmyk.eps" }, - /* 53*/ { BARCODE_MAXICODE, -1, -1, -1, 3, -1, -1, -1, 0, 0, "", "0000FF00", 180, "12", "maxicode_no_bg_hwsp3_rotate_180.eps" }, - /* 54*/ { BARCODE_MAXICODE, -1, -1, -1, -1, -1, -1, -1, 2.4, 0, "", "", 90, "12", "maxicode_2.4_rotate_90.eps" }, + /* 7*/ { BARCODE_CODE39, -1, -1, SMALL_TEXT, -1, -1, -1, -1, 0, 0, "", "", 0, "123", "code39_small.eps" }, + /* 8*/ { BARCODE_ULTRA, -1, -1, -1, -1, -1, -1, -1, 0, 0, "147AD0", "FC9630", 0, "123", "ultra_fg_bg.eps" }, + /* 9*/ { BARCODE_ULTRA, -1, 1, BARCODE_BOX, 2, -1, -1, -1, 0, 0, "0000FF", "FF0000", 0, "123", "ultra_fg_bg_box.eps" }, + /* 10*/ { BARCODE_ULTRA, -1, 2, BARCODE_BOX | CMYK_COLOUR, 1, 1, -1, -1, 0, 0, "0000FF", "FF0000", 0, "123", "ultra_fg_bg_box_cmyk.eps" }, + /* 11*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "9501101531000", "ean13_ggs_5.2.2.1-1.eps" }, + /* 12*/ { BARCODE_EANX, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "9501101531000", "ean13_ggs_5.2.2.1-1_gws.eps" }, + /* 13*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "9771384524017+12", "ean13_2addon_ggs_5.2.2.5.1-2.eps" }, + /* 14*/ { BARCODE_EANX, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "9771384524017+12", "ean13_2addon_ggs_5.2.2.5.1-2_gws.eps" }, + /* 15*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "9501234", "ean8_gss_5.2.2.2-1.eps" }, + /* 16*/ { BARCODE_EANX, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "9501234", "ean8_gss_5.2.2.2-1_gws.eps" }, + /* 17*/ { BARCODE_EANX, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "98765", "ean5.eps" }, + /* 18*/ { BARCODE_EANX, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "98765", "ean5_gws.eps" }, + /* 19*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "012345678905+24", "upca_2addon_ggs_5.2.6.6-5.eps" }, + /* 20*/ { BARCODE_UPCA, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "012345678905+24", "upca_2addon_ggs_5.2.6.6-5_gws.eps" }, + /* 21*/ { BARCODE_UPCA, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 90, "012345678905+24", "upca_2addon_ggs_5.2.6.6-5_rotate_90.eps" }, + /* 22*/ { BARCODE_UPCA, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 180, "012345678905+24", "upca_2addon_ggs_5.2.6.6-5_gws_rotate_180.eps" }, + /* 23*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "0123456+12345", "upce_5addon.eps" }, + /* 24*/ { BARCODE_UPCE, -1, -1, EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "0123456+12345", "upce_5addon_gws.eps" }, + /* 25*/ { BARCODE_UPCE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 270, "0123456+12345", "upce_5addon_rotate_270.eps" }, + /* 26*/ { BARCODE_UPCE, -1, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, -1, 0, 0, "", "", 0, "0123456+12345", "upce_5addon_small_bold.eps" }, + /* 27*/ { BARCODE_UPCE, -1, -1, SMALL_TEXT | BOLD_TEXT | EANUPC_GUARD_WHITESPACE, -1, -1, -1, -1, 0, 0, "", "", 0, "0123456+12345", "upce_5addon_small_bold_gws.eps" }, + /* 28*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "A\\B)ç(D", "code128_escape_latin1.eps" }, + /* 29*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, -1, -1, -1, -1, 0, 0, "", "", 0, "1501234567890", "dbar_ltd_24724_fig7_bold.eps" }, + /* 30*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0.1, 0, "", "", 0, "12", "dotcode_0.1.eps" }, + /* 31*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0.08, 0, "", "", 0, "12", "dotcode_0.1.eps" }, + /* 32*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "12", "dotcode_1.0.eps" }, + /* 33*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0.1, "", "", 0, "12", "dotcode_1.0_ds0.1.eps" }, + /* 34*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 1.1, "", "", 0, "12", "dotcode_1.0_ds1.1.eps" }, + /* 35*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 0, "", "", 0, "12", "dotcode_1.5.eps" }, + /* 36*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 0.4, "", "", 0, "12", "dotcode_1.5_ds0.4.eps" }, + /* 37*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 1.1, "", "", 0, "12", "dotcode_1.5_ds1.1.eps" }, + /* 38*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 2.1, "", "", 0, "12", "dotcode_1.5_ds2.1.eps" }, + /* 39*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 0, "", "", 0, "12", "dotcode_2.0.eps" }, + /* 40*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 0.9, "", "", 0, "12", "dotcode_2.0_ds0.9.eps" }, + /* 41*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 1.1, "", "", 0, "12", "dotcode_2.0_ds1.1.eps" }, + /* 42*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 0, "", "", 0, "12", "dotcode_3.0.eps" }, + /* 43*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 0.4, "", "", 0, "12", "dotcode_3.0_ds0.4.eps" }, + /* 44*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 1.1, "", "", 0, "12", "dotcode_3.0_ds1.1.eps" }, + /* 45*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 0, "", "", 0, "12", "dotcode_3.5.eps" }, + /* 46*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 0.4, "", "", 0, "12", "dotcode_3.5_ds0.4.eps" }, + /* 47*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 1.1, "", "", 0, "12", "dotcode_3.5_ds1.1.eps" }, + /* 48*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 0, "", "", 0, "12", "dotcode_5.0.eps" }, + /* 49*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 0.2, "", "", 0, "12", "dotcode_5.0_ds0.2.eps" }, + /* 50*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 1.1, "", "", 0, "12", "dotcode_5.0_ds1.1.eps" }, + /* 51*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 1.7, "", "", 0, "12", "dotcode_5.0_ds1.7.eps" }, + /* 52*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "FF0000", "0000FF00", 0, "12", "dotcode_no_bg.eps" }, + /* 53*/ { BARCODE_MAXICODE, -1, -1, CMYK_COLOUR, -1, -1, -1, -1, 0, 0, "", "", 270, "12", "maxicode_rotate_270_cmyk.eps" }, + /* 54*/ { BARCODE_MAXICODE, -1, -1, -1, 3, -1, -1, -1, 0, 0, "", "0000FF00", 180, "12", "maxicode_no_bg_hwsp3_rotate_180.eps" }, + /* 55*/ { BARCODE_MAXICODE, -1, -1, -1, -1, -1, -1, -1, 2.4, 0, "", "", 90, "12", "maxicode_2.4_rotate_90.eps" }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; diff --git a/backend/tests/test_vector.c b/backend/tests/test_vector.c index 36344867..ac9f3c19 100644 --- a/backend/tests/test_vector.c +++ b/backend/tests/test_vector.c @@ -79,7 +79,7 @@ static struct zint_vector_circle *find_circle(struct zint_symbol *symbol, float y = rnd3dpf(y); diameter = rnd3dpf(diameter); for (circle = symbol->vector->circles; circle != NULL; circle = circle->next) { - /* printf("x %.8g, y %.8g, diamter %.8g\n", circle->x, circle->y, circle->diameter); */ + /* printf("x %.9g, y %.9g, diamter %.9g\n", circle->x, circle->y, circle->diameter); */ if (rnd3dpf(circle->x) == x && rnd3dpf(circle->y) == y) { if (diameter) { if (rnd3dpf(circle->diameter) == diameter) { @@ -490,7 +490,7 @@ static void test_options(const testCtx *const p_ctx) { }; /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { - /* 0*/ { BARCODE_CODE128, "123456", "7890ab", 0, "A", 0, 1, 46, 92, 118.9 }, + /* 0*/ { BARCODE_CODE128, "123456", "7890ab", 0, "A", 0, 1, 46, 92, 116.28 }, /* 1*/ { BARCODE_CODE128, "12345", NULL, 0, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1 }, /* 2*/ { BARCODE_CODE128, NULL, "1234567", 0, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1 }, /* 3*/ { BARCODE_CODE128, "12345 ", NULL, 0, "A", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1 }, @@ -524,9 +524,9 @@ static void test_options(const testCtx *const p_ctx) { if (ret < ZINT_ERROR) { assert_equal(symbol->rows, data[i].expected_rows, "i:%d symbol->rows %d != %d (%s)\n", i, symbol->rows, data[i].expected_rows, data[i].data); assert_equal(symbol->width, data[i].expected_width, "i:%d symbol->width %d != %d (%s)\n", i, symbol->width, data[i].expected_width, data[i].data); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); } @@ -551,14 +551,14 @@ static void test_buffer_vector(const testCtx *const p_ctx) { float expected_vector_height; }; struct item data[] = { - /* 0*/ { BARCODE_CODE11, "1234567890", "", 50, 1, 108, 216, 118.900002 }, - /* 1*/ { BARCODE_C25STANDARD, "1234567890", "", 50, 1, 117, 234, 118.900002 }, - /* 2*/ { BARCODE_C25INTER, "1234567890", "", 50, 1, 99, 198, 118.900002 }, - /* 3*/ { BARCODE_C25IATA, "1234567890", "", 50, 1, 149, 298, 118.900002 }, - /* 4*/ { BARCODE_C25LOGIC, "1234567890", "", 50, 1, 109, 218, 118.900002 }, - /* 5*/ { BARCODE_C25IND, "1234567890", "", 50, 1, 159, 318, 118.900002 }, - /* 6*/ { BARCODE_CODE39, "1234567890", "", 50, 1, 155, 310, 118.900002 }, - /* 7*/ { BARCODE_EXCODE39, "1234567890", "", 50, 1, 155, 310, 118.900002 }, + /* 0*/ { BARCODE_CODE11, "1234567890", "", 50, 1, 108, 216, 116.28 }, + /* 1*/ { BARCODE_C25STANDARD, "1234567890", "", 50, 1, 117, 234, 116.28 }, + /* 2*/ { BARCODE_C25INTER, "1234567890", "", 50, 1, 99, 198, 116.28 }, + /* 3*/ { BARCODE_C25IATA, "1234567890", "", 50, 1, 149, 298, 116.28 }, + /* 4*/ { BARCODE_C25LOGIC, "1234567890", "", 50, 1, 109, 218, 116.28 }, + /* 5*/ { BARCODE_C25IND, "1234567890", "", 50, 1, 159, 318, 116.28 }, + /* 6*/ { BARCODE_CODE39, "1234567890", "", 50, 1, 155, 310, 116.28 }, + /* 7*/ { BARCODE_EXCODE39, "1234567890", "", 50, 1, 155, 310, 116.28 }, /* 8*/ { BARCODE_EANX, "123456789012", "", 50, 1, 95, 226, 118 }, /* 9*/ { BARCODE_EANX_CHK, "1234567890128", "", 50, 1, 95, 226, 118 }, /* 10*/ { BARCODE_EANX, "123456789012+12", "", 50, 1, 122, 276, 118 }, @@ -575,19 +575,19 @@ static void test_buffer_vector(const testCtx *const p_ctx) { /* 21*/ { BARCODE_EANX_CHK, "1234", "", 50, 1, 47, 104, 118 }, /* 22*/ { BARCODE_EANX, "12", "", 50, 1, 20, 50, 118 }, /* 23*/ { BARCODE_EANX_CHK, "12", "", 50, 1, 20, 50, 118 }, - /* 24*/ { BARCODE_GS1_128, "[01]12345678901231", "", 50, 1, 134, 268, 118.900002 }, - /* 25*/ { BARCODE_CODABAR, "A00000000B", "", 50, 1, 102, 204, 118.900002 }, - /* 26*/ { BARCODE_CODE128, "1234567890", "", 50, 1, 90, 180, 118.900002 }, - /* 27*/ { BARCODE_DPLEIT, "1234567890123", "", 72, 1, 135, 270, 162.89999 }, - /* 28*/ { BARCODE_DPIDENT, "12345678901", "", 72, 1, 117, 234, 162.89999 }, + /* 24*/ { BARCODE_GS1_128, "[01]12345678901231", "", 50, 1, 134, 268, 116.28 }, + /* 25*/ { BARCODE_CODABAR, "A00000000B", "", 50, 1, 102, 204, 116.28 }, + /* 26*/ { BARCODE_CODE128, "1234567890", "", 50, 1, 90, 180, 116.28 }, + /* 27*/ { BARCODE_DPLEIT, "1234567890123", "", 72, 1, 135, 270, 160.28 }, + /* 28*/ { BARCODE_DPIDENT, "12345678901", "", 72, 1, 117, 234, 160.28 }, /* 29*/ { BARCODE_CODE16K, "1234567890", "", 20, 2, 70, 162, 44 }, /* 30*/ { BARCODE_CODE49, "1234567890", "", 20, 2, 70, 162, 44 }, - /* 31*/ { BARCODE_CODE93, "1234567890", "", 50, 1, 127, 254, 118.900002 }, + /* 31*/ { BARCODE_CODE93, "1234567890", "", 50, 1, 127, 254, 116.28 }, /* 32*/ { BARCODE_FLAT, "1234567890", "", 50, 1, 90, 180, 100 }, - /* 33*/ { BARCODE_DBAR_OMN, "1234567890123", "", 50, 1, 96, 192, 118.900002 }, - /* 34*/ { BARCODE_DBAR_LTD, "1234567890123", "", 50, 1, 79, 158, 118.900002 }, - /* 35*/ { BARCODE_DBAR_EXP, "[01]12345678901231", "", 34, 1, 134, 268, 86.9000015 }, - /* 36*/ { BARCODE_TELEPEN, "1234567890", "", 50, 1, 208, 416, 118.900002 }, + /* 33*/ { BARCODE_DBAR_OMN, "1234567890123", "", 50, 1, 96, 192, 116.28 }, + /* 34*/ { BARCODE_DBAR_LTD, "1234567890123", "", 50, 1, 79, 158, 116.28 }, + /* 35*/ { BARCODE_DBAR_EXP, "[01]12345678901231", "", 34, 1, 134, 268, 84.279999 }, + /* 36*/ { BARCODE_TELEPEN, "1234567890", "", 50, 1, 208, 416, 116.28 }, /* 37*/ { BARCODE_UPCA, "12345678901", "", 50, 1, 95, 226, 118 }, /* 38*/ { BARCODE_UPCA_CHK, "123456789012", "", 50, 1, 95, 226, 118 }, /* 39*/ { BARCODE_UPCA, "12345678901+12", "", 50, 1, 124, 276, 118 }, @@ -601,18 +601,18 @@ static void test_buffer_vector(const testCtx *const p_ctx) { /* 47*/ { BARCODE_UPCE, "1234567+12345", "", 50, 1, 105, 238, 118 }, /* 48*/ { BARCODE_UPCE_CHK, "12345670+12345", "", 50, 1, 105, 238, 118 }, /* 49*/ { BARCODE_POSTNET, "12345678901", "", 12, 2, 123, 246, 24 }, - /* 50*/ { BARCODE_MSI_PLESSEY, "1234567890", "", 50, 1, 127, 254, 118.900002 }, + /* 50*/ { BARCODE_MSI_PLESSEY, "1234567890", "", 50, 1, 127, 254, 116.28 }, /* 51*/ { BARCODE_FIM, "A", "", 50, 1, 17, 34, 100 }, - /* 52*/ { BARCODE_LOGMARS, "1234567890", "", 50, 1, 191, 382, 118.900002 }, + /* 52*/ { BARCODE_LOGMARS, "1234567890", "", 50, 1, 191, 382, 116.28 }, /* 53*/ { BARCODE_PHARMA, "123456", "", 50, 1, 58, 116, 100 }, - /* 54*/ { BARCODE_PZN, "123456", "", 50, 1, 142, 284, 118.900002 }, + /* 54*/ { BARCODE_PZN, "123456", "", 50, 1, 142, 284, 116.28 }, /* 55*/ { BARCODE_PHARMA_TWO, "12345678", "", 10, 2, 29, 58, 20 }, /* 56*/ { BARCODE_CEPNET, "12345678", "", 5.375, 2, 93, 186, 10.75 }, /* 57*/ { BARCODE_PDF417, "1234567890", "", 21, 7, 103, 206, 42 }, /* 58*/ { BARCODE_PDF417COMP, "1234567890", "", 21, 7, 69, 138, 42 }, /* 59*/ { BARCODE_MAXICODE, "1234567890", "", 165, 33, 30, 60, 57.7333984 }, /* 60*/ { BARCODE_QRCODE, "1234567890AB", "", 21, 21, 21, 42, 42 }, - /* 61*/ { BARCODE_CODE128AB, "1234567890", "", 50, 1, 145, 290, 118.900002 }, + /* 61*/ { BARCODE_CODE128AB, "1234567890", "", 50, 1, 145, 290, 116.28 }, /* 62*/ { BARCODE_AUSPOST, "12345678901234567890123", "", 8, 3, 133, 266, 16 }, /* 63*/ { BARCODE_AUSREPLY, "12345678", "", 8, 3, 73, 146, 16 }, /* 64*/ { BARCODE_AUSROUTE, "12345678", "", 8, 3, 73, 146, 16 }, @@ -622,28 +622,28 @@ static void test_buffer_vector(const testCtx *const p_ctx) { /* 68*/ { BARCODE_ISBNX, "123456789+12345", "", 50, 1, 149, 330, 118 }, /* 69*/ { BARCODE_RM4SCC, "1234567890", "", 8, 3, 91, 182, 16 }, /* 70*/ { BARCODE_DATAMATRIX, "ABC", "", 10, 10, 10, 20, 20 }, - /* 71*/ { BARCODE_EAN14, "1234567890123", "", 50, 1, 134, 268, 118.900002 }, - /* 72*/ { BARCODE_VIN, "12345678701234567", "", 50, 1, 246, 492, 118.900002 }, + /* 71*/ { BARCODE_EAN14, "1234567890123", "", 50, 1, 134, 268, 116.28 }, + /* 72*/ { BARCODE_VIN, "12345678701234567", "", 50, 1, 246, 492, 116.28 }, /* 73*/ { BARCODE_CODABLOCKF, "1234567890", "", 20, 2, 101, 242, 44 }, - /* 74*/ { BARCODE_NVE18, "12345678901234567", "", 50, 1, 156, 312, 118.900002 }, + /* 74*/ { BARCODE_NVE18, "12345678901234567", "", 50, 1, 156, 312, 116.28 }, /* 75*/ { BARCODE_JAPANPOST, "1234567890", "", 8, 3, 133, 266, 16 }, - /* 76*/ { BARCODE_KOREAPOST, "123456", "", 50, 1, 167, 334, 118.900002 }, + /* 76*/ { BARCODE_KOREAPOST, "123456", "", 50, 1, 167, 334, 116.28 }, /* 77*/ { BARCODE_DBAR_STK, "1234567890123", "", 13, 3, 50, 100, 26 }, /* 78*/ { BARCODE_DBAR_OMNSTK, "1234567890123", "", 69, 5, 50, 100, 138 }, /* 79*/ { BARCODE_DBAR_EXPSTK, "[01]12345678901231", "", 71, 5, 102, 204, 142 }, /* 80*/ { BARCODE_PLANET, "12345678901", "", 12, 2, 123, 246, 24 }, /* 81*/ { BARCODE_MICROPDF417, "1234567890", "", 12, 6, 82, 164, 24 }, /* 82*/ { BARCODE_USPS_IMAIL, "12345678901234567890", "", 8, 3, 129, 258, 16 }, - /* 83*/ { BARCODE_PLESSEY, "1234567890", "", 50, 1, 227, 454, 118.900002 }, - /* 84*/ { BARCODE_TELEPEN_NUM, "1234567890", "", 50, 1, 128, 256, 118.900002 }, - /* 85*/ { BARCODE_ITF14, "1234567890", "", 50, 1, 135, 330, 138.899994 }, + /* 83*/ { BARCODE_PLESSEY, "1234567890", "", 50, 1, 227, 454, 116.28 }, + /* 84*/ { BARCODE_TELEPEN_NUM, "1234567890", "", 50, 1, 128, 256, 116.28 }, + /* 85*/ { BARCODE_ITF14, "1234567890", "", 50, 1, 135, 330, 136.28 }, /* 86*/ { BARCODE_KIX, "123456ABCDE", "", 8, 3, 87, 174, 16 }, /* 87*/ { BARCODE_AZTEC, "1234567890AB", "", 15, 15, 15, 30, 30 }, /* 88*/ { BARCODE_DAFT, "DAFTDAFTDAFTDAFT", "", 8, 3, 31, 62, 16 }, - /* 89*/ { BARCODE_DPD, "0123456789012345678901234567", "", 50, 1, 189, 378, 130.89999 }, + /* 89*/ { BARCODE_DPD, "0123456789012345678901234567", "", 50, 1, 189, 378, 128.28 }, /* 90*/ { BARCODE_MICROQR, "12345", "", 11, 11, 11, 22, 22 }, - /* 91*/ { BARCODE_HIBC_128, "1234567890", "", 50, 1, 123, 246, 118.900002 }, - /* 92*/ { BARCODE_HIBC_39, "1234567890", "", 50, 1, 223, 446, 118.900002 }, + /* 91*/ { BARCODE_HIBC_128, "1234567890", "", 50, 1, 123, 246, 116.28 }, + /* 92*/ { BARCODE_HIBC_39, "1234567890", "", 50, 1, 223, 446, 116.28 }, /* 93*/ { BARCODE_HIBC_DM, "ABC", "", 12, 12, 12, 24, 24 }, /* 94*/ { BARCODE_HIBC_QR, "1234567890AB", "", 21, 21, 21, 42, 42 }, /* 95*/ { BARCODE_HIBC_PDF, "1234567890", "", 24, 8, 103, 206, 48 }, @@ -653,20 +653,20 @@ static void test_buffer_vector(const testCtx *const p_ctx) { /* 99*/ { BARCODE_DOTCODE, "ABC", "", 11, 11, 16, 32, 22 }, /*100*/ { BARCODE_HANXIN, "1234567890AB", "", 23, 23, 23, 46, 46 }, /*101*/ { BARCODE_MAILMARK_2D, "012100123412345678AB19XY1A 0", "", 24, 24, 24, 48, 48 }, - /*102*/ { BARCODE_UPU_S10, "EE876543216CA", "", 50, 1, 156, 312, 118.900002 }, + /*102*/ { BARCODE_UPU_S10, "EE876543216CA", "", 50, 1, 156, 312, 116.28 }, /*103*/ { BARCODE_MAILMARK_4S, "01000000000000000AA00AA0A", "", 10, 3, 155, 310, 20 }, /*104*/ { BARCODE_AZRUNE, "255", "", 11, 11, 11, 22, 22 }, - /*105*/ { BARCODE_CODE32, "12345678", "", 50, 1, 103, 206, 118.900002 }, + /*105*/ { BARCODE_CODE32, "12345678", "", 50, 1, 103, 206, 116.28 }, /*106*/ { BARCODE_EANX_CC, "123456789012", "[20]01", 50, 7, 99, 226, 118 }, /*107*/ { BARCODE_EANX_CC, "123456789012+12", "[20]01", 50, 7, 125, 276, 118 }, /*108*/ { BARCODE_EANX_CC, "123456789012+12345", "[20]01", 50, 7, 152, 330, 118 }, /*109*/ { BARCODE_EANX_CC, "1234567", "[20]01", 50, 8, 72, 162, 118 }, /*110*/ { BARCODE_EANX_CC, "1234567+12", "[20]01", 50, 8, 98, 212, 118 }, /*111*/ { BARCODE_EANX_CC, "1234567+12345", "[20]01", 50, 8, 125, 266, 118 }, - /*112*/ { BARCODE_GS1_128_CC, "[01]12345678901231", "[20]01", 50, 5, 145, 290, 118.900002 }, - /*113*/ { BARCODE_DBAR_OMN_CC, "1234567890123", "[20]01", 21, 5, 100, 200, 60.9000015 }, - /*114*/ { BARCODE_DBAR_LTD_CC, "1234567890123", "[20]01", 19, 6, 79, 158, 56.9000015 }, - /*115*/ { BARCODE_DBAR_EXP_CC, "[01]12345678901231", "[20]01", 41, 5, 134, 268, 100.900002 }, + /*112*/ { BARCODE_GS1_128_CC, "[01]12345678901231", "[20]01", 50, 5, 145, 290, 116.28 }, + /*113*/ { BARCODE_DBAR_OMN_CC, "1234567890123", "[20]01", 21, 5, 100, 200, 58.279999 }, + /*114*/ { BARCODE_DBAR_LTD_CC, "1234567890123", "[20]01", 19, 6, 79, 158, 54.279999 }, + /*115*/ { BARCODE_DBAR_EXP_CC, "[01]12345678901231", "[20]01", 41, 5, 134, 268, 98.279999 }, /*116*/ { BARCODE_UPCA_CC, "12345678901", "[20]01", 50, 7, 99, 226, 118 }, /*117*/ { BARCODE_UPCA_CC, "12345678901+12", "[20]01", 50, 7, 127, 276, 118 }, /*118*/ { BARCODE_UPCA_CC, "12345678901+12345", "[20]01", 50, 7, 154, 330, 118 }, @@ -676,13 +676,13 @@ static void test_buffer_vector(const testCtx *const p_ctx) { /*122*/ { BARCODE_DBAR_STK_CC, "1234567890123", "[20]01", 24, 9, 56, 112, 48 }, /*123*/ { BARCODE_DBAR_OMNSTK_CC, "1234567890123", "[20]01", 80, 11, 56, 112, 160 }, /*124*/ { BARCODE_DBAR_EXPSTK_CC, "[01]12345678901231", "[20]01", 78, 9, 102, 204, 156 }, - /*125*/ { BARCODE_CHANNEL, "01", "", 50, 1, 19, 38, 118.900002 }, + /*125*/ { BARCODE_CHANNEL, "01", "", 50, 1, 19, 38, 116.28 }, /*126*/ { BARCODE_CODEONE, "12345678901234567890", "", 16, 16, 18, 36, 32 }, /*127*/ { BARCODE_GRIDMATRIX, "ABC", "", 18, 18, 18, 36, 36 }, /*128*/ { BARCODE_UPNQR, "1234567890AB", "", 77, 77, 77, 154, 154 }, /*129*/ { BARCODE_ULTRA, "1234567890", "", 13, 13, 18, 36, 26 }, /*130*/ { BARCODE_RMQR, "12345", "", 11, 11, 27, 54, 22 }, - /*131*/ { BARCODE_BC412, "1234567", "", 16.666668, 1, 102, 204, 52.233337 }, + /*131*/ { BARCODE_BC412, "1234567", "", 16.666668, 1, 102, 204, 49.613335 }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -720,19 +720,19 @@ static void test_buffer_vector(const testCtx *const p_ctx) { assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%d) vector NULL\n", i, data[i].symbology); if (p_ctx->generate) { - printf(" /*%3d*/ { %s, \"%s\", \"%s\", %.8g, %d, %d, %.8g, %.8g },\n", + printf(" /*%3d*/ { %s, \"%s\", \"%s\", %.9g, %d, %d, %.9g, %.9g },\n", i, testUtilBarcodeName(data[i].symbology), data[i].data, data[i].composite, symbol->height, symbol->rows, symbol->width, symbol->vector->width, symbol->vector->height); } else { - assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %.8g != %.8g\n", + assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%s) symbol->rows %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); assert_nonzero(check_vectors(symbol, errmsg), "i:%d (%s) %s\n", @@ -1012,13 +1012,13 @@ static void test_upcean_hrt(const testCtx *const p_ctx) { assert_zero(ret, "i:%d ZBarcode_Buffer_Vector(%d) ret %d != 0\n", i, data[i].symbology, ret); assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%d) vector NULL\n", i, data[i].symbology); - assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%s) symbol->rows %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); if (p_ctx->index != -1 && (debug & ZINT_DEBUG_TEST_PRINT)) { @@ -1110,7 +1110,7 @@ static void test_row_separator(const testCtx *const p_ctx) { assert_zero(ret, "i:%d ZBarcode_Buffer_Vector(%d) ret %d != 0\n", i, data[i].symbology, ret); assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%d) vector NULL\n", i, data[i].symbology); - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.8g != %.8g\n", i, data[i].symbology, symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.9g != %.9g\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); @@ -1177,7 +1177,7 @@ static void test_stacking(const testCtx *const p_ctx) { assert_zero(ret, "i:%d ret %d != zero\n", i, ret); assert_nonnull(symbol->bitmap, "i:%d (%d) symbol->bitmap NULL\n", i, data[i].symbology); - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.8g != %.8g\n", i, data[i].symbology, symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.9g != %.9g\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); @@ -1190,7 +1190,7 @@ static void test_stacking(const testCtx *const p_ctx) { assert_zero(ret, "i:%d ZBarcode_Buffer_Vector(%d) ret %d != 0\n", i, data[i].symbology, ret); assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%d) vector NULL\n", i, data[i].symbology); - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.8g != %.8g\n", i, data[i].symbology, symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.9g != %.9g\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); @@ -1227,21 +1227,21 @@ static void test_output_options(const testCtx *const p_ctx) { }; /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { - /* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 118.9, 0, 0, 4 }, - /* 1*/ { BARCODE_CODE128, -1, -1, 2, -1, "A123", 0, 50, 1, 79, 158, 118.9, 0, 0, 4 }, - /* 2*/ { BARCODE_CODE128, -1, -1, 2, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 126.9, 1, 0, 4 }, - /* 3*/ { BARCODE_CODE128, -1, -1, 2, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 126.9, 0, 4, 4 }, - /* 4*/ { BARCODE_CODE128, -1, -1, 2, BARCODE_BOX, "A123", 0, 50, 1, 79, 166, 126.9, 1, 4, 4 }, - /* 5*/ { BARCODE_CODE128, -1, -1, 0, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 118.9, 0, 0, 4 }, - /* 6*/ { BARCODE_CODE128, -1, -1, 0, BARCODE_BOX, "A123", 0, 50, 1, 79, 158, 118.9, 0, 4, 4 }, - /* 7*/ { BARCODE_CODE128, -1, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 118.9, 0, 2, 0 }, - /* 8*/ { BARCODE_CODE128, 1, -1, -1, -1, "A123", 0, 50, 1, 79, 162, 118.9, 1, 2, 0 }, - /* 9*/ { BARCODE_CODE128, 1, 2, -1, -1, "A123", 0, 50, 1, 79, 162, 126.9, 0, 2, 0 }, - /* 10*/ { BARCODE_CODE128, 1, 2, -1, -1, "A123", 0, 50, 1, 79, 162, 126.9, 1, 2, 4 }, - /* 11*/ { BARCODE_CODE128, -1, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 118.9, 0, 6, 8 }, - /* 12*/ { BARCODE_CODE128, 3, -1, 4, BARCODE_BIND, "A123", 0, 50, 1, 79, 170, 134.89999, 1, 6, 8 }, - /* 13*/ { BARCODE_CODE128, 3, -1, 4, BARCODE_BIND, "A123", 0, 50, 1, 79, 170, 134.89999, 0, 14, 8 }, - /* 14*/ { BARCODE_CODE128, 3, -1, 4, BARCODE_BOX, "A123", 0, 50, 1, 79, 186, 134.89999, 1, 14, 8 }, + /* 0*/ { BARCODE_CODE128, -1, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 116.28, 0, 0, 4 }, + /* 1*/ { BARCODE_CODE128, -1, -1, 2, -1, "A123", 0, 50, 1, 79, 158, 116.28, 0, 0, 4 }, + /* 2*/ { BARCODE_CODE128, -1, -1, 2, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 124.28, 1, 0, 4 }, + /* 3*/ { BARCODE_CODE128, -1, -1, 2, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 124.28, 0, 4, 4 }, + /* 4*/ { BARCODE_CODE128, -1, -1, 2, BARCODE_BOX, "A123", 0, 50, 1, 79, 166, 124.28, 1, 4, 4 }, + /* 5*/ { BARCODE_CODE128, -1, -1, 0, BARCODE_BIND, "A123", 0, 50, 1, 79, 158, 116.28, 0, 0, 4 }, + /* 6*/ { BARCODE_CODE128, -1, -1, 0, BARCODE_BOX, "A123", 0, 50, 1, 79, 158, 116.28, 0, 4, 4 }, + /* 7*/ { BARCODE_CODE128, -1, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 116.28, 0, 2, 0 }, + /* 8*/ { BARCODE_CODE128, 1, -1, -1, -1, "A123", 0, 50, 1, 79, 162, 116.28, 1, 2, 0 }, + /* 9*/ { BARCODE_CODE128, 1, 2, -1, -1, "A123", 0, 50, 1, 79, 162, 124.28, 0, 2, 0 }, + /* 10*/ { BARCODE_CODE128, 1, 2, -1, -1, "A123", 0, 50, 1, 79, 162, 124.28, 1, 2, 4 }, + /* 11*/ { BARCODE_CODE128, -1, -1, -1, -1, "A123", 0, 50, 1, 79, 158, 116.28, 0, 6, 8 }, + /* 12*/ { BARCODE_CODE128, 3, -1, 4, BARCODE_BIND, "A123", 0, 50, 1, 79, 170, 132.28, 1, 6, 8 }, + /* 13*/ { BARCODE_CODE128, 3, -1, 4, BARCODE_BIND, "A123", 0, 50, 1, 79, 170, 132.28, 0, 14, 8 }, + /* 14*/ { BARCODE_CODE128, 3, -1, 4, BARCODE_BOX, "A123", 0, 50, 1, 79, 186, 132.28, 1, 14, 8 }, /* 15*/ { BARCODE_CODE128, -1, -1, -1, BARCODE_DOTTY_MODE, "A123", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1, -1, -1, -1, -1 }, /* 16*/ { BARCODE_QRCODE, -1, -1, -1, -1, "A123", 0, 21, 21, 21, 42, 42, 0, 0, 6 }, /* 17*/ { BARCODE_QRCODE, -1, -1, 3, -1, "A123", 0, 21, 21, 21, 42, 42, 0, 0, 6 }, @@ -1275,9 +1275,9 @@ static void test_output_options(const testCtx *const p_ctx) { /* 45*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BIND, "A123", 0, 165, 33, 30, 84, 77.733398, 0, 94, 10 }, /* 46*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BOX, "A123", 0, 165, 33, 30, 104, 77.733398, 1, 94, 10 }, /* 47*/ { BARCODE_MAXICODE, -1, -1, -1, BARCODE_DOTTY_MODE, "A123", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1, -1, -1, -1, -1 }, - /* 48*/ { BARCODE_ITF14, -1, -1, -1, -1, "123", 0, 50, 1, 135, 330, 138.89999, 1, 320, 10 }, - /* 49*/ { BARCODE_ITF14, -1, -1, 0, -1, "123", 0, 50, 1, 135, 330, 138.89999, 1, 320, 10 }, - /* 50*/ { BARCODE_ITF14, -1, -1, 0, BARCODE_BOX, "123", 0, 50, 1, 135, 310, 118.9, 0, 300, 0 }, /* No zero-width/height rectangles */ + /* 48*/ { BARCODE_ITF14, -1, -1, -1, -1, "123", 0, 50, 1, 135, 330, 136.28, 1, 320, 10 }, + /* 49*/ { BARCODE_ITF14, -1, -1, 0, -1, "123", 0, 50, 1, 135, 330, 136.28, 1, 320, 10 }, + /* 50*/ { BARCODE_ITF14, -1, -1, 0, BARCODE_BOX, "123", 0, 50, 1, 135, 310, 116.28, 0, 300, 0 }, /* No zero-width/height rectangles */ }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -1318,13 +1318,13 @@ static void test_output_options(const testCtx *const p_ctx) { testUtilVectorPrint(symbol); } - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.8g != %.8g\n", i, data[i].symbology, symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.9g != %.9g\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); if (data[i].expected_set != -1) { @@ -1389,7 +1389,7 @@ static void test_noncomposite_string_x(const testCtx *const p_ctx) { assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); assert_nonnull(symbol->vector->strings, "i:%d ZBarcode_Buffer_Vector(%d) vector->strings NULL\n", i, data[i].symbology); assert_equal(symbol->vector->strings->x, data[i].expected_string_x, - "i:%d (%s) symbol->vector->strings->x %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->strings->x, data[i].expected_string_x); + "i:%d (%s) symbol->vector->strings->x %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->strings->x, data[i].expected_string_x); ZBarcode_Delete(symbol); } @@ -1453,7 +1453,7 @@ static void test_upcean_whitespace_width(const testCtx *const p_ctx) { } assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); assert_nonnull(symbol->vector->strings, "i:%d ZBarcode_Buffer_Vector(%d) vector->strings NULL\n", i, data[i].symbology); @@ -1462,7 +1462,7 @@ static void test_upcean_whitespace_width(const testCtx *const p_ctx) { string = string->next; } assert_equal(string_cnt, data[i].expected_string_cnt, "i:%d (%s) string_cnt %d != %d\n", i, testUtilBarcodeName(data[i].symbology), string_cnt, data[i].expected_string_cnt); - assert_equal(string->y, data[i].expected_string_y, "i:%d (%s) string->y %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), string->y, data[i].expected_string_y); + assert_equal(string->y, data[i].expected_string_y, "i:%d (%s) string->y %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), string->y, data[i].expected_string_y); ZBarcode_Delete(symbol); } @@ -1550,7 +1550,7 @@ static void test_scale(const testCtx *const p_ctx) { testUtilVectorPrint(symbol); } - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.8g != %.8g\n", i, data[i].symbology, symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.9g != %.9g\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); @@ -1665,13 +1665,13 @@ static void test_guard_descent(const testCtx *const p_ctx) { testUtilVectorPrint(symbol); } - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.8g != %.8g\n", i, data[i].symbology, symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.9g != %.9g\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); rect = find_rect(symbol, data[i].expected_set_x, data[i].expected_set_y, data[i].expected_set_width, data[i].expected_set_height); @@ -1710,23 +1710,23 @@ static void test_quiet_zones(const testCtx *const p_ctx) { }; /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { - /* 0*/ { BARCODE_CODE11, -1, -1, -1, -1, "1234", "", 0, 50, 1, 62, 124, 118.9, 0, 0, 2, 100 }, - /* 1*/ { BARCODE_CODE11, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 62, 164, 118.9, 20, 0, 2, 100 }, - /* 2*/ { BARCODE_CODE11, BARCODE_QUIET_ZONES | BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 62, 124, 118.9, 0, 0, 2, 100 }, /* BARCODE_NO_QUIET_ZONES trumps BARCODE_QUIET_ZONES */ - /* 3*/ { BARCODE_C25STANDARD, -1, -1, -1, -1, "1234", "", 0, 50, 1, 57, 114, 118.9, 0, 0, 8, 100 }, - /* 4*/ { BARCODE_C25STANDARD, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 57, 154, 118.9, 20, 0, 8, 100 }, - /* 5*/ { BARCODE_C25INTER, -1, -1, -1, -1, "1234", "", 0, 50, 1, 45, 90, 118.9, 0, 0, 2, 100 }, - /* 6*/ { BARCODE_C25INTER, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 45, 130, 118.9, 20, 0, 2, 100 }, - /* 7*/ { BARCODE_C25IATA, -1, -1, -1, -1, "1234", "", 0, 50, 1, 65, 130, 118.9, 0, 0, 2, 100 }, - /* 8*/ { BARCODE_C25IATA, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 65, 170, 118.9, 20, 0, 2, 100 }, - /* 9*/ { BARCODE_C25LOGIC, -1, -1, -1, -1, "1234", "", 0, 50, 1, 49, 98, 118.9, 0, 0, 2, 100 }, - /* 10*/ { BARCODE_C25LOGIC, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 49, 138, 118.9, 20, 0, 2, 100 }, - /* 11*/ { BARCODE_C25IND, -1, -1, -1, -1, "1234", "", 0, 50, 1, 75, 150, 118.9, 0, 0, 6, 100 }, - /* 12*/ { BARCODE_C25IND, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 75, 190, 118.9, 20, 0, 6, 100 }, - /* 13*/ { BARCODE_CODE39, -1, -1, -1, -1, "1234", "", 0, 50, 1, 77, 154, 118.9, 0, 0, 2, 100 }, - /* 14*/ { BARCODE_CODE39, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 77, 194, 118.9, 20, 0, 2, 100 }, - /* 15*/ { BARCODE_EXCODE39, -1, -1, -1, -1, "1234", "", 0, 50, 1, 77, 154, 118.9, 0, 0, 2, 100 }, - /* 16*/ { BARCODE_EXCODE39, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 77, 194, 118.9, 20, 0, 2, 100 }, + /* 0*/ { BARCODE_CODE11, -1, -1, -1, -1, "1234", "", 0, 50, 1, 62, 124, 116.28, 0, 0, 2, 100 }, + /* 1*/ { BARCODE_CODE11, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 62, 164, 116.28, 20, 0, 2, 100 }, + /* 2*/ { BARCODE_CODE11, BARCODE_QUIET_ZONES | BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 62, 124, 116.28, 0, 0, 2, 100 }, /* BARCODE_NO_QUIET_ZONES trumps BARCODE_QUIET_ZONES */ + /* 3*/ { BARCODE_C25STANDARD, -1, -1, -1, -1, "1234", "", 0, 50, 1, 57, 114, 116.28, 0, 0, 8, 100 }, + /* 4*/ { BARCODE_C25STANDARD, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 57, 154, 116.28, 20, 0, 8, 100 }, + /* 5*/ { BARCODE_C25INTER, -1, -1, -1, -1, "1234", "", 0, 50, 1, 45, 90, 116.28, 0, 0, 2, 100 }, + /* 6*/ { BARCODE_C25INTER, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 45, 130, 116.28, 20, 0, 2, 100 }, + /* 7*/ { BARCODE_C25IATA, -1, -1, -1, -1, "1234", "", 0, 50, 1, 65, 130, 116.28, 0, 0, 2, 100 }, + /* 8*/ { BARCODE_C25IATA, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 65, 170, 116.28, 20, 0, 2, 100 }, + /* 9*/ { BARCODE_C25LOGIC, -1, -1, -1, -1, "1234", "", 0, 50, 1, 49, 98, 116.28, 0, 0, 2, 100 }, + /* 10*/ { BARCODE_C25LOGIC, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 49, 138, 116.28, 20, 0, 2, 100 }, + /* 11*/ { BARCODE_C25IND, -1, -1, -1, -1, "1234", "", 0, 50, 1, 75, 150, 116.28, 0, 0, 6, 100 }, + /* 12*/ { BARCODE_C25IND, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 75, 190, 116.28, 20, 0, 6, 100 }, + /* 13*/ { BARCODE_CODE39, -1, -1, -1, -1, "1234", "", 0, 50, 1, 77, 154, 116.28, 0, 0, 2, 100 }, + /* 14*/ { BARCODE_CODE39, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 77, 194, 116.28, 20, 0, 2, 100 }, + /* 15*/ { BARCODE_EXCODE39, -1, -1, -1, -1, "1234", "", 0, 50, 1, 77, 154, 116.28, 0, 0, 2, 100 }, + /* 16*/ { BARCODE_EXCODE39, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 77, 194, 116.28, 20, 0, 2, 100 }, /* 17*/ { BARCODE_EANX, -1, -1, -1, -1, "023456789012", "", 0, 50, 1, 95, 226, 118, 22, 0, 2, 110 }, /* 18*/ { BARCODE_EANX, BARCODE_QUIET_ZONES, -1, -1, -1, "023456789012", "", 0, 50, 1, 95, 226, 118, 22, 0, 2, 110 }, /* 19*/ { BARCODE_EANX, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "023456789012", "", 0, 50, 1, 95, 212, 118, 22, 0, 2, 110 }, @@ -1751,38 +1751,38 @@ static void test_quiet_zones(const testCtx *const p_ctx) { /* 38*/ { BARCODE_EANX, -1, -1, -1, -1, "02", "", 0, 50, 1, 20, 50, 118, 36, 18, 4, 100 }, /* EAN-2 */ /* 39*/ { BARCODE_EANX, BARCODE_QUIET_ZONES, -1, -1, -1, "02", "", 0, 50, 1, 20, 50, 118, 36, 18, 4, 100 }, /* EAN-2 */ /* 40*/ { BARCODE_EANX, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "02", "", 0, 50, 1, 20, 40, 118, 36, 18, 4, 100 }, /* EAN-2 - only width changes */ - /* 41*/ { BARCODE_GS1_128, -1, -1, -1, -1, "[20]02", "", 0, 50, 1, 68, 136, 118.9, 0, 0, 4, 100 }, - /* 42*/ { BARCODE_GS1_128, BARCODE_QUIET_ZONES, -1, -1, -1, "[20]02", "", 0, 50, 1, 68, 176, 118.9, 20, 0, 4, 100 }, - /* 43*/ { BARCODE_CODABAR, -1, -1, -1, -1, "A0B", "", 0, 50, 1, 32, 64, 118.9, 0, 0, 2, 100 }, - /* 44*/ { BARCODE_CODABAR, BARCODE_QUIET_ZONES, -1, -1, -1, "A0B", "", 0, 50, 1, 32, 104, 118.9, 20, 0, 2, 100 }, - /* 45*/ { BARCODE_CODE128, -1, -1, -1, -1, "1234", "", 0, 50, 1, 57, 114, 118.9, 0, 0, 4, 100 }, - /* 46*/ { BARCODE_CODE128, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 57, 154, 118.9, 20, 0, 4, 100 }, - /* 47*/ { BARCODE_DPLEIT, -1, -1, -1, -1, "1234", "", 0, 72, 1, 135, 270, 162.89999, 0, 0, 2, 144 }, - /* 48*/ { BARCODE_DPLEIT, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 72, 1, 135, 310, 162.89999, 20, 0, 2, 144 }, - /* 49*/ { BARCODE_DPIDENT, -1, -1, -1, -1, "1234", "", 0, 72, 1, 117, 234, 162.89999, 0, 0, 2, 144 }, - /* 50*/ { BARCODE_DPIDENT, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 72, 1, 117, 274, 162.89999, 20, 0, 2, 144 }, + /* 41*/ { BARCODE_GS1_128, -1, -1, -1, -1, "[20]02", "", 0, 50, 1, 68, 136, 116.28, 0, 0, 4, 100 }, + /* 42*/ { BARCODE_GS1_128, BARCODE_QUIET_ZONES, -1, -1, -1, "[20]02", "", 0, 50, 1, 68, 176, 116.28, 20, 0, 4, 100 }, + /* 43*/ { BARCODE_CODABAR, -1, -1, -1, -1, "A0B", "", 0, 50, 1, 32, 64, 116.28, 0, 0, 2, 100 }, + /* 44*/ { BARCODE_CODABAR, BARCODE_QUIET_ZONES, -1, -1, -1, "A0B", "", 0, 50, 1, 32, 104, 116.28, 20, 0, 2, 100 }, + /* 45*/ { BARCODE_CODE128, -1, -1, -1, -1, "1234", "", 0, 50, 1, 57, 114, 116.28, 0, 0, 4, 100 }, + /* 46*/ { BARCODE_CODE128, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 57, 154, 116.28, 20, 0, 4, 100 }, + /* 47*/ { BARCODE_DPLEIT, -1, -1, -1, -1, "1234", "", 0, 72, 1, 135, 270, 160.28, 0, 0, 2, 144 }, + /* 48*/ { BARCODE_DPLEIT, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 72, 1, 135, 310, 160.28, 20, 0, 2, 144 }, + /* 49*/ { BARCODE_DPIDENT, -1, -1, -1, -1, "1234", "", 0, 72, 1, 117, 234, 160.28, 0, 0, 2, 144 }, + /* 50*/ { BARCODE_DPIDENT, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 72, 1, 117, 274, 160.28, 20, 0, 2, 144 }, /* 51*/ { BARCODE_CODE16K, -1, -1, -1, -1, "1234", "", 0, 20, 2, 70, 162, 44, 20, 2, 6, 19 }, /* 52*/ { BARCODE_CODE16K, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 20, 2, 70, 162, 44, 20, 2, 6, 19 }, /* 53*/ { BARCODE_CODE16K, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 20, 2, 70, 140, 44, 0, 2, 6, 19 }, /* 54*/ { BARCODE_CODE49, -1, -1, -1, -1, "1234", "", 0, 20, 2, 70, 162, 44, 20, 2, 2, 19 }, /* 55*/ { BARCODE_CODE49, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 20, 2, 70, 162, 44, 20, 2, 2, 19 }, /* 56*/ { BARCODE_CODE49, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 20, 2, 70, 140, 44, 0, 2, 2, 19 }, - /* 57*/ { BARCODE_CODE93, -1, -1, -1, -1, "1234", "", 0, 50, 1, 73, 146, 118.9, 0, 0, 2, 100 }, - /* 58*/ { BARCODE_CODE93, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 73, 186, 118.9, 20, 0, 2, 100 }, + /* 57*/ { BARCODE_CODE93, -1, -1, -1, -1, "1234", "", 0, 50, 1, 73, 146, 116.28, 0, 0, 2, 100 }, + /* 58*/ { BARCODE_CODE93, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 73, 186, 116.28, 20, 0, 2, 100 }, /* 59*/ { BARCODE_FLAT, -1, -1, -1, -1, "1234", "", 0, 50, 1, 36, 72, 100, 0, 0, 2, 100 }, /* 60*/ { BARCODE_FLAT, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 36, 72, 100, 0, 0, 2, 100 }, /* 61*/ { BARCODE_FLAT, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 36, 72, 100, 0, 0, 2, 100 }, - /* 62*/ { BARCODE_DBAR_OMN, -1, -1, -1, -1, "1234", "", 0, 50, 1, 96, 192, 118.9, 2, 0, 2, 100 }, - /* 63*/ { BARCODE_DBAR_OMN, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 96, 192, 118.9, 2, 0, 2, 100 }, - /* 64*/ { BARCODE_DBAR_OMN, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 96, 192, 118.9, 2, 0, 2, 100 }, - /* 65*/ { BARCODE_DBAR_LTD, -1, -1, -1, -1, "1234", "", 0, 50, 1, 79, 158, 118.9, 2, 0, 2, 100 }, - /* 66*/ { BARCODE_DBAR_LTD, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 79, 158, 118.9, 2, 0, 2, 100 }, - /* 67*/ { BARCODE_DBAR_LTD, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 79, 158, 118.9, 2, 0, 2, 100 }, - /* 68*/ { BARCODE_DBAR_EXP, -1, -1, -1, -1, "[20]02", "", 0, 34, 1, 102, 204, 86.900002, 2, 0, 2, 68 }, - /* 69*/ { BARCODE_DBAR_EXP, BARCODE_QUIET_ZONES, -1, -1, -1, "[20]02", "", 0, 34, 1, 102, 204, 86.900002, 2, 0, 2, 68 }, - /* 70*/ { BARCODE_DBAR_EXP, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "[20]02", "", 0, 34, 1, 102, 204, 86.900002, 2, 0, 2, 68 }, - /* 71*/ { BARCODE_TELEPEN, -1, -1, -1, -1, "1234", "", 0, 50, 1, 112, 224, 118.9, 0, 0, 2, 100 }, - /* 72*/ { BARCODE_TELEPEN, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 112, 264, 118.9, 20, 0, 2, 100 }, + /* 62*/ { BARCODE_DBAR_OMN, -1, -1, -1, -1, "1234", "", 0, 50, 1, 96, 192, 116.28, 2, 0, 2, 100 }, + /* 63*/ { BARCODE_DBAR_OMN, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 96, 192, 116.28, 2, 0, 2, 100 }, + /* 64*/ { BARCODE_DBAR_OMN, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 96, 192, 116.28, 2, 0, 2, 100 }, + /* 65*/ { BARCODE_DBAR_LTD, -1, -1, -1, -1, "1234", "", 0, 50, 1, 79, 158, 116.28, 2, 0, 2, 100 }, + /* 66*/ { BARCODE_DBAR_LTD, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 79, 158, 116.28, 2, 0, 2, 100 }, + /* 67*/ { BARCODE_DBAR_LTD, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 79, 158, 116.28, 2, 0, 2, 100 }, + /* 68*/ { BARCODE_DBAR_EXP, -1, -1, -1, -1, "[20]02", "", 0, 34, 1, 102, 204, 84.279999, 2, 0, 2, 68 }, + /* 69*/ { BARCODE_DBAR_EXP, BARCODE_QUIET_ZONES, -1, -1, -1, "[20]02", "", 0, 34, 1, 102, 204, 84.279999, 2, 0, 2, 68 }, + /* 70*/ { BARCODE_DBAR_EXP, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "[20]02", "", 0, 34, 1, 102, 204, 84.279999, 2, 0, 2, 68 }, + /* 71*/ { BARCODE_TELEPEN, -1, -1, -1, -1, "1234", "", 0, 50, 1, 112, 224, 116.28, 0, 0, 2, 100 }, + /* 72*/ { BARCODE_TELEPEN, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 112, 264, 116.28, 20, 0, 2, 100 }, /* 73*/ { BARCODE_UPCA, -1, -1, -1, -1, "01457137763", "", 0, 50, 1, 95, 226, 118, 18, 0, 2, 110 }, /* 74*/ { BARCODE_UPCA, BARCODE_QUIET_ZONES, -1, -1, -1, "01457137763", "", 0, 50, 1, 95, 226, 118, 18, 0, 2, 110 }, /* 75*/ { BARCODE_UPCA, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "01457137763", "", 0, 50, 1, 95, 226, 118, 18, 0, 2, 110 }, @@ -1821,16 +1821,16 @@ static void test_quiet_zones(const testCtx *const p_ctx) { /*108*/ { BARCODE_UPCE, BARCODE_NO_QUIET_ZONES, -1, -1, 0, "8145713+12345", "", 0, 50, 1, 105, 210, 110, 208, 18, 2, 82 }, /* Hide text */ /*109*/ { BARCODE_POSTNET, -1, -1, -1, -1, "12345", "", 0, 12, 2, 63, 126, 24, 0, 0, 2, 24 }, /*110*/ { BARCODE_POSTNET, BARCODE_QUIET_ZONES, -1, -1, -1, "12345", "", 0, 12, 2, 63, 146, 30.4, 10, 3.2, 2, 24 }, - /*111*/ { BARCODE_MSI_PLESSEY, -1, -1, -1, -1, "1234", "", 0, 50, 1, 55, 110, 118.9, 0, 0, 4, 100 }, - /*112*/ { BARCODE_MSI_PLESSEY, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 55, 158, 118.9, 24, 0, 4, 100 }, + /*111*/ { BARCODE_MSI_PLESSEY, -1, -1, -1, -1, "1234", "", 0, 50, 1, 55, 110, 116.28, 0, 0, 4, 100 }, + /*112*/ { BARCODE_MSI_PLESSEY, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 55, 158, 116.28, 24, 0, 4, 100 }, /*113*/ { BARCODE_FIM, -1, -1, -1, -1, "A", "", 0, 50, 1, 17, 34, 100, 0, 0, 2, 100 }, /*114*/ { BARCODE_FIM, BARCODE_QUIET_ZONES, -1, -1, -1, "A", "", 0, 50, 1, 17, 50.955414, 100, 10.585987, 0, 2, 100 }, - /*115*/ { BARCODE_LOGMARS, -1, -1, -1, -1, "1234", "", 0, 50, 1, 95, 190, 118.9, 0, 0, 2, 100 }, - /*116*/ { BARCODE_LOGMARS, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 95, 230, 118.9, 20, 0, 2, 100 }, + /*115*/ { BARCODE_LOGMARS, -1, -1, -1, -1, "1234", "", 0, 50, 1, 95, 190, 116.28, 0, 0, 2, 100 }, + /*116*/ { BARCODE_LOGMARS, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 95, 230, 116.28, 20, 0, 2, 100 }, /*117*/ { BARCODE_PHARMA, -1, -1, -1, -1, "1234", "", 0, 50, 1, 38, 76, 100, 0, 0, 2, 100 }, /*118*/ { BARCODE_PHARMA, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 38, 100, 100, 12, 0, 2, 100 }, - /*119*/ { BARCODE_PZN, -1, -1, -1, -1, "1234", "", 0, 50, 1, 142, 284, 118.9, 0, 0, 2, 100 }, - /*120*/ { BARCODE_PZN, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 142, 324, 118.9, 20, 0, 2, 100 }, + /*119*/ { BARCODE_PZN, -1, -1, -1, -1, "1234", "", 0, 50, 1, 142, 284, 116.28, 0, 0, 2, 100 }, + /*120*/ { BARCODE_PZN, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 142, 324, 116.28, 20, 0, 2, 100 }, /*121*/ { BARCODE_PHARMA_TWO, -1, -1, -1, -1, "1234", "", 0, 10, 2, 13, 26, 20, 8, 0, 2, 10 }, /*122*/ { BARCODE_PHARMA_TWO, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 10, 2, 13, 50, 20, 20, 0, 2, 10 }, /*123*/ { BARCODE_CEPNET, -1, -1, -1, -1, "12345678", "", 0, 5.375, 2, 93, 186, 10.75, 0, 0, 2, 10.75 }, @@ -1843,8 +1843,8 @@ static void test_quiet_zones(const testCtx *const p_ctx) { /*130*/ { BARCODE_MAXICODE, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 165, 33, 30, 64, 61.733398, 31, 30.866699, 16.430941, 0 }, /*131*/ { BARCODE_QRCODE, -1, -1, -1, -1, "1234", "", 0, 21, 21, 21, 42, 42, 0, 0, 14, 2 }, /*132*/ { BARCODE_QRCODE, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 21, 21, 21, 58, 58, 8, 8, 14, 2 }, - /*133*/ { BARCODE_CODE128AB, -1, -1, -1, -1, "1234", "", 0, 50, 1, 79, 158, 118.9, 0, 0, 4, 100 }, - /*134*/ { BARCODE_CODE128AB, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 79, 198, 118.9, 20, 0, 4, 100 }, + /*133*/ { BARCODE_CODE128AB, -1, -1, -1, -1, "1234", "", 0, 50, 1, 79, 158, 116.28, 0, 0, 4, 100 }, + /*134*/ { BARCODE_CODE128AB, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 79, 198, 116.28, 20, 0, 4, 100 }, /*135*/ { BARCODE_AUSPOST, -1, -1, -1, -1, "12345678", "", 0, 8, 3, 73, 146, 16, 0, 0, 2, 10 }, /*136*/ { BARCODE_AUSPOST, BARCODE_QUIET_ZONES, -1, -1, -1, "12345678", "", 0, 8, 3, 73, 186, 29.333332, 20, 6.6666665, 2, 10 }, /*137*/ { BARCODE_AUSREPLY, -1, -1, -1, -1, "1234", "", 0, 8, 3, 73, 146, 16, 0, 0, 2, 10 }, @@ -1860,19 +1860,19 @@ static void test_quiet_zones(const testCtx *const p_ctx) { /*147*/ { BARCODE_RM4SCC, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 8, 3, 43, 98.283463, 28.283464, 6.1417322, 6.1417322, 2, 10 }, /*148*/ { BARCODE_DATAMATRIX, -1, -1, -1, -1, "1234", "", 0, 10, 10, 10, 20, 20, 0, 0, 2, 2 }, /*149*/ { BARCODE_DATAMATRIX, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 10, 10, 10, 24, 24, 2, 2, 2, 2 }, - /*150*/ { BARCODE_EAN14, -1, -1, -1, -1, "1234", "", 0, 50, 1, 134, 268, 118.9, 0, 0, 4, 100 }, - /*151*/ { BARCODE_EAN14, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 134, 308, 118.9, 20, 0, 4, 100 }, - /*152*/ { BARCODE_VIN, -1, -1, -1, -1, "12345678701234567", "", 0, 50, 1, 246, 492, 118.9, 0, 0, 2, 100 }, - /*153*/ { BARCODE_VIN, BARCODE_QUIET_ZONES, -1, -1, -1, "12345678701234567", "", 0, 50, 1, 246, 532, 118.9, 20, 0, 2, 100 }, + /*150*/ { BARCODE_EAN14, -1, -1, -1, -1, "1234", "", 0, 50, 1, 134, 268, 116.28, 0, 0, 4, 100 }, + /*151*/ { BARCODE_EAN14, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 134, 308, 116.28, 20, 0, 4, 100 }, + /*152*/ { BARCODE_VIN, -1, -1, -1, -1, "12345678701234567", "", 0, 50, 1, 246, 492, 116.28, 0, 0, 2, 100 }, + /*153*/ { BARCODE_VIN, BARCODE_QUIET_ZONES, -1, -1, -1, "12345678701234567", "", 0, 50, 1, 246, 532, 116.28, 20, 0, 2, 100 }, /*154*/ { BARCODE_CODABLOCKF, -1, -1, -1, -1, "1234", "", 0, 20, 2, 101, 242, 44, 20, 2, 4, 40 }, /*155*/ { BARCODE_CODABLOCKF, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 20, 2, 101, 242, 44, 20, 2, 4, 40 }, /*156*/ { BARCODE_CODABLOCKF, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 20, 2, 101, 202, 44, 0, 2, 4, 40 }, - /*157*/ { BARCODE_NVE18, -1, -1, -1, -1, "1234", "", 0, 50, 1, 156, 312, 118.9, 0, 0, 4, 100 }, - /*158*/ { BARCODE_NVE18, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 156, 352, 118.9, 20, 0, 4, 100 }, + /*157*/ { BARCODE_NVE18, -1, -1, -1, -1, "1234", "", 0, 50, 1, 156, 312, 116.28, 0, 0, 4, 100 }, + /*158*/ { BARCODE_NVE18, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 156, 352, 116.28, 20, 0, 4, 100 }, /*159*/ { BARCODE_JAPANPOST, -1, -1, -1, -1, "1234", "", 0, 8, 3, 133, 266, 16, 0, 0, 2, 16 }, /*160*/ { BARCODE_JAPANPOST, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 8, 3, 133, 279.33334, 29.333332, 6.6666665, 6.6666665, 2, 16 }, - /*161*/ { BARCODE_KOREAPOST, -1, -1, -1, -1, "1234", "", 0, 50, 1, 167, 334, 118.9, 8, 0, 2, 100 }, - /*162*/ { BARCODE_KOREAPOST, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 167, 374, 118.9, 28, 0, 2, 100 }, + /*161*/ { BARCODE_KOREAPOST, -1, -1, -1, -1, "1234", "", 0, 50, 1, 167, 334, 116.28, 8, 0, 2, 100 }, + /*162*/ { BARCODE_KOREAPOST, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 167, 374, 116.28, 28, 0, 2, 100 }, /*163*/ { BARCODE_DBAR_STK, -1, -1, -1, -1, "1234", "", 0, 13, 3, 50, 100, 26, 2, 0, 2, 10 }, /*164*/ { BARCODE_DBAR_STK, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 13, 3, 50, 100, 26, 2, 0, 2, 10 }, /*165*/ { BARCODE_DBAR_STK, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 13, 3, 50, 100, 26, 2, 0, 2, 10 }, @@ -1888,13 +1888,13 @@ static void test_quiet_zones(const testCtx *const p_ctx) { /*175*/ { BARCODE_MICROPDF417, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 22, 11, 38, 80, 48, 2, 2, 4, 4 }, /*176*/ { BARCODE_USPS_IMAIL, -1, -1, -1, -1, "12345678901234567890", "", 0, 8, 3, 129, 258, 16, 0, 0, 2, 10 }, /*177*/ { BARCODE_USPS_IMAIL, BARCODE_QUIET_ZONES, -1, -1, -1, "12345678901234567890", "", 0, 8, 3, 129, 277.5, 20.056, 9.75, 2.0280001, 2, 10 }, - /*178*/ { BARCODE_PLESSEY, -1, -1, -1, -1, "1234", "", 0, 50, 1, 131, 262, 118.9, 0, 0, 6, 100 }, - /*179*/ { BARCODE_PLESSEY, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 131, 310, 118.9, 24, 0, 6, 100 }, - /*180*/ { BARCODE_TELEPEN_NUM, -1, -1, -1, -1, "1234", "", 0, 50, 1, 80, 160, 118.9, 0, 0, 2, 100 }, - /*181*/ { BARCODE_TELEPEN_NUM, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 80, 200, 118.9, 20, 0, 2, 100 }, - /*182*/ { BARCODE_ITF14, -1, -1, -1, -1, "1234", "", 0, 50, 1, 135, 330, 138.89999, 30, 10, 2, 100 }, - /*183*/ { BARCODE_ITF14, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 135, 330, 138.89999, 30, 10, 2, 100 }, - /*184*/ { BARCODE_ITF14, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 135, 290, 138.89999, 10, 10, 2, 100 }, + /*178*/ { BARCODE_PLESSEY, -1, -1, -1, -1, "1234", "", 0, 50, 1, 131, 262, 116.28, 0, 0, 6, 100 }, + /*179*/ { BARCODE_PLESSEY, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 131, 310, 116.28, 24, 0, 6, 100 }, + /*180*/ { BARCODE_TELEPEN_NUM, -1, -1, -1, -1, "1234", "", 0, 50, 1, 80, 160, 116.28, 0, 0, 2, 100 }, + /*181*/ { BARCODE_TELEPEN_NUM, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 80, 200, 116.28, 20, 0, 2, 100 }, + /*182*/ { BARCODE_ITF14, -1, -1, -1, -1, "1234", "", 0, 50, 1, 135, 330, 136.28, 30, 10, 2, 100 }, + /*183*/ { BARCODE_ITF14, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 135, 330, 136.28, 30, 10, 2, 100 }, + /*184*/ { BARCODE_ITF14, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 135, 290, 136.28, 10, 10, 2, 100 }, /*185*/ { BARCODE_KIX, -1, -1, -1, -1, "1234", "", 0, 8, 3, 31, 62, 16, 8, 0, 2, 10 }, /*186*/ { BARCODE_KIX, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 8, 3, 31, 74.283463, 28.283464, 14.141732, 6.1417322, 2, 10 }, /*187*/ { BARCODE_AZTEC, -1, -1, -1, -1, "1234", "", 0, 15, 15, 15, 30, 30, 6, 0, 6, 2 }, @@ -1903,14 +1903,14 @@ static void test_quiet_zones(const testCtx *const p_ctx) { /*190*/ { BARCODE_DAFT, -1, -1, -1, -1, "FADT", "", 0, 8, 3, 7, 14, 16, 0, 0, 2, 16 }, /*191*/ { BARCODE_DAFT, BARCODE_QUIET_ZONES, -1, -1, -1, "FADT", "", 0, 8, 3, 7, 14, 16, 0, 0, 2, 16 }, /*192*/ { BARCODE_DAFT, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "FADT", "", 0, 8, 3, 7, 14, 16, 0, 0, 2, 16 }, - /*193*/ { BARCODE_DPD, -1, -1, -1, -1, "1234567890123456789012345678", "", 0, 50, 1, 189, 378, 130.89999, 0, 6, 4, 100 }, - /*194*/ { BARCODE_DPD, BARCODE_QUIET_ZONES, -1, -1, -1, "1234567890123456789012345678", "", 0, 50, 1, 189, 428, 130.89999, 25, 6, 4, 100 }, + /*193*/ { BARCODE_DPD, -1, -1, -1, -1, "1234567890123456789012345678", "", 0, 50, 1, 189, 378, 128.28, 0, 6, 4, 100 }, + /*194*/ { BARCODE_DPD, BARCODE_QUIET_ZONES, -1, -1, -1, "1234567890123456789012345678", "", 0, 50, 1, 189, 428, 128.28, 25, 6, 4, 100 }, /*195*/ { BARCODE_MICROQR, -1, -1, -1, -1, "1234", "", 0, 11, 11, 11, 22, 22, 0, 0, 14, 2 }, /*196*/ { BARCODE_MICROQR, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 11, 11, 11, 30, 30, 4, 4, 14, 2 }, - /*197*/ { BARCODE_HIBC_128, -1, -1, -1, -1, "1234", "", 0, 50, 1, 90, 180, 118.9, 0, 0, 4, 100 }, - /*198*/ { BARCODE_HIBC_128, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 90, 220, 118.9, 20, 0, 4, 100 }, - /*199*/ { BARCODE_HIBC_39, -1, -1, -1, -1, "1234", "", 0, 50, 1, 127, 254, 118.9, 0, 0, 2, 100 }, - /*200*/ { BARCODE_HIBC_39, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 127, 294, 118.9, 20, 0, 2, 100 }, + /*197*/ { BARCODE_HIBC_128, -1, -1, -1, -1, "1234", "", 0, 50, 1, 90, 180, 116.28, 0, 0, 4, 100 }, + /*198*/ { BARCODE_HIBC_128, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 90, 220, 116.28, 20, 0, 4, 100 }, + /*199*/ { BARCODE_HIBC_39, -1, -1, -1, -1, "1234", "", 0, 50, 1, 127, 254, 116.28, 0, 0, 2, 100 }, + /*200*/ { BARCODE_HIBC_39, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 127, 294, 116.28, 20, 0, 2, 100 }, /*201*/ { BARCODE_HIBC_DM, -1, -1, -1, -1, "1234", "", 0, 12, 12, 12, 24, 24, 0, 0, 2, 2 }, /*202*/ { BARCODE_HIBC_DM, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 12, 12, 12, 28, 28, 2, 2, 2, 2 }, /*203*/ { BARCODE_HIBC_QR, -1, -1, -1, -1, "1234", "", 0, 21, 21, 21, 42, 42, 0, 0, 14, 2 }, @@ -1931,41 +1931,41 @@ static void test_quiet_zones(const testCtx *const p_ctx) { /*218*/ { BARCODE_HANXIN, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 23, 23, 23, 58, 58, 6, 6, 14, 2 }, /*219*/ { BARCODE_MAILMARK_2D, -1, -1, -1, -1, "012100123412345678AB19XY1A 0", "", 0, 24, 24, 24, 48, 48, 0, 0, 2, 2 }, /*220*/ { BARCODE_MAILMARK_2D, BARCODE_QUIET_ZONES, -1, -1, -1, "012100123412345678AB19XY1A 0", "", 0, 24, 24, 24, 64, 64, 8, 8, 2, 2 }, - /*221*/ { BARCODE_UPU_S10, -1, -1, -1, -1, "EE876543216CA", "", 0, 50, 1, 156, 312, 118.9, 0, 0, 4, 100 }, - /*222*/ { BARCODE_UPU_S10, BARCODE_QUIET_ZONES, -1, -1, -1, "EE876543216CA", "", 0, 50, 1, 156, 352, 118.9, 20, 0, 4, 100 }, + /*221*/ { BARCODE_UPU_S10, -1, -1, -1, -1, "EE876543216CA", "", 0, 50, 1, 156, 312, 116.28, 0, 0, 4, 100 }, + /*222*/ { BARCODE_UPU_S10, BARCODE_QUIET_ZONES, -1, -1, -1, "EE876543216CA", "", 0, 50, 1, 156, 352, 116.28, 20, 0, 4, 100 }, /*223*/ { BARCODE_MAILMARK_4S, -1, -1, -1, -1, "01000000000000000AA00AA0A", "", 0, 10, 3, 155, 310, 20, 0, 0, 2, 20 }, /*224*/ { BARCODE_MAILMARK_4S, BARCODE_QUIET_ZONES, -1, -1, -1, "01000000000000000AA00AA0A", "", 0, 10, 3, 155, 322.28348, 32.283463, 6.1417322, 6.1417322, 2, 20 }, /*225*/ { BARCODE_AZRUNE, -1, -1, -1, -1, "123", "", 0, 11, 11, 11, 22, 22, 0, 0, 8, 2 }, /*226*/ { BARCODE_AZRUNE, BARCODE_QUIET_ZONES, -1, -1, -1, "123", "", 0, 11, 11, 11, 22, 22, 0, 0, 8, 2 }, /*227*/ { BARCODE_AZRUNE, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "123", "", 0, 11, 11, 11, 22, 22, 0, 0, 8, 2 }, - /*228*/ { BARCODE_CODE32, -1, -1, -1, -1, "1234", "", 0, 50, 1, 103, 206, 118.9, 0, 0, 2, 100 }, - /*229*/ { BARCODE_CODE32, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 103, 246, 118.9, 20, 0, 2, 100 }, + /*228*/ { BARCODE_CODE32, -1, -1, -1, -1, "1234", "", 0, 50, 1, 103, 206, 116.28, 0, 0, 2, 100 }, + /*229*/ { BARCODE_CODE32, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 103, 246, 116.28, 20, 0, 2, 100 }, /*230*/ { BARCODE_EANX_CC, -1, -1, -1, -1, "023456789012", "", 0, 50, 7, 99, 226, 118, 26, 24, 2, 86 }, /*231*/ { BARCODE_EANX_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "023456789012", "", 0, 50, 7, 99, 226, 118, 26, 24, 2, 86 }, /*232*/ { BARCODE_EANX_CC, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "023456789012", "", 0, 50, 7, 99, 214, 118, 26, 24, 2, 86 }, /*233*/ { BARCODE_EANX_CC, -1, -1, -1, 0, "023456789012", "", 0, 50, 7, 99, 226, 110, 26, 24, 2, 86 }, /* Hide text */ /*234*/ { BARCODE_EANX_CC, BARCODE_QUIET_ZONES, -1, -1, 0, "023456789012", "", 0, 50, 7, 99, 226, 110, 26, 24, 2, 86 }, /* Hide text */ /*235*/ { BARCODE_EANX_CC, BARCODE_NO_QUIET_ZONES, -1, -1, 0, "023456789012", "", 0, 50, 7, 99, 198, 110, 10, 24, 2, 86 }, /* Hide text */ - /*236*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[20]02", "", 0, 50, 5, 99, 198, 118.9, 24, 14, 4, 86 }, /* CC-A */ - /*237*/ { BARCODE_GS1_128_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "[20]02", "", 0, 50, 5, 99, 204, 118.9, 26, 14, 4, 86 }, - /*238*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[91]1", "", 0, 50, 5, 100, 200, 118.9, 20, 14, 4, 86 }, /* CC-A */ - /*239*/ { BARCODE_GS1_128_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "[91]1", "", 0, 50, 5, 100, 222, 118.9, 22, 14, 4, 86 }, - /*240*/ { BARCODE_GS1_128_CC, -1, 2, -1, -1, "[91]1", "", 0, 50, 6, 100, 200, 118.9, 20, 18, 4, 82 }, /* CC-B */ - /*241*/ { BARCODE_GS1_128_CC, BARCODE_QUIET_ZONES, 2, -1, -1, "[91]1", "", 0, 50, 6, 100, 222, 118.9, 22, 18, 4, 82 }, - /*242*/ { BARCODE_GS1_128_CC, -1, 3, -1, -1, "[20]02", "", 0, 50, 15, 86, 172, 118.9, 14, 80, 4, 20 }, /* CC-C */ - /*243*/ { BARCODE_GS1_128_CC, BARCODE_QUIET_ZONES, 3, -1, -1, "[20]02", "", 0, 50, 15, 86, 198, 118.9, 20, 80, 4, 20 }, - /*244*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "1234", "", 0, 21, 5, 100, 200, 60.900002, 10, 14, 2, 28 }, /* CC-A */ - /*245*/ { BARCODE_DBAR_OMN_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 21, 5, 100, 202, 60.900002, 12, 14, 2, 28 }, - /*246*/ { BARCODE_DBAR_OMN_CC, -1, 2, -1, -1, "1234", "", 0, 23, 6, 100, 200, 64.900002, 10, 18, 2, 28 }, /* CC-B */ - /*247*/ { BARCODE_DBAR_OMN_CC, BARCODE_QUIET_ZONES, 2, -1, -1, "1234", "", 0, 23, 6, 100, 202, 64.900002, 12, 18, 2, 28 }, - /*248*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "1234", "", 0, 19, 6, 79, 158, 56.900002, 2, 18, 2, 20 }, /* CC-A */ - /*249*/ { BARCODE_DBAR_LTD_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 19, 6, 79, 158, 56.900002, 2, 18, 2, 20 }, /* Same */ - /*250*/ { BARCODE_DBAR_LTD_CC, -1, 2, -1, -1, "1234", "", 0, 23, 8, 88, 176, 64.900002, 20, 26, 2, 20 }, /* CC-B */ - /*251*/ { BARCODE_DBAR_LTD_CC, BARCODE_QUIET_ZONES, 2, -1, -1, "1234", "", 0, 23, 8, 88, 178, 64.900002, 22, 26, 2, 20 }, - /*252*/ { BARCODE_DBAR_EXP_CC, -1, -1, -1, -1, "[20]12", "", 0, 41, 5, 102, 204, 100.9, 2, 14, 2, 68 }, /* CC-A */ - /*253*/ { BARCODE_DBAR_EXP_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "[20]12", "", 0, 41, 5, 102, 204, 100.9, 2, 14, 2, 68 }, /* Same */ - /*254*/ { BARCODE_DBAR_EXP_CC, -1, 2, -1, -1, "[20]12", "", 0, 43, 6, 102, 204, 104.9, 2, 18, 2, 68 }, /* CC-B */ - /*255*/ { BARCODE_DBAR_EXP_CC, BARCODE_QUIET_ZONES, 2, -1, -1, "[20]12", "", 0, 43, 6, 102, 204, 104.9, 2, 18, 2, 68 }, /* Same */ + /*236*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[20]02", "", 0, 50, 5, 99, 198, 116.28, 24, 14, 4, 86 }, /* CC-A */ + /*237*/ { BARCODE_GS1_128_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "[20]02", "", 0, 50, 5, 99, 204, 116.28, 26, 14, 4, 86 }, + /*238*/ { BARCODE_GS1_128_CC, -1, -1, -1, -1, "[91]1", "", 0, 50, 5, 100, 200, 116.28, 20, 14, 4, 86 }, /* CC-A */ + /*239*/ { BARCODE_GS1_128_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "[91]1", "", 0, 50, 5, 100, 222, 116.28, 22, 14, 4, 86 }, + /*240*/ { BARCODE_GS1_128_CC, -1, 2, -1, -1, "[91]1", "", 0, 50, 6, 100, 200, 116.28, 20, 18, 4, 82 }, /* CC-B */ + /*241*/ { BARCODE_GS1_128_CC, BARCODE_QUIET_ZONES, 2, -1, -1, "[91]1", "", 0, 50, 6, 100, 222, 116.28, 22, 18, 4, 82 }, + /*242*/ { BARCODE_GS1_128_CC, -1, 3, -1, -1, "[20]02", "", 0, 50, 15, 86, 172, 116.28, 14, 80, 4, 20 }, /* CC-C */ + /*243*/ { BARCODE_GS1_128_CC, BARCODE_QUIET_ZONES, 3, -1, -1, "[20]02", "", 0, 50, 15, 86, 198, 116.28, 20, 80, 4, 20 }, + /*244*/ { BARCODE_DBAR_OMN_CC, -1, -1, -1, -1, "1234", "", 0, 21, 5, 100, 200, 58.279999, 10, 14, 2, 28 }, /* CC-A */ + /*245*/ { BARCODE_DBAR_OMN_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 21, 5, 100, 202, 58.279999, 12, 14, 2, 28 }, + /*246*/ { BARCODE_DBAR_OMN_CC, -1, 2, -1, -1, "1234", "", 0, 23, 6, 100, 200, 62.279999, 10, 18, 2, 28 }, /* CC-B */ + /*247*/ { BARCODE_DBAR_OMN_CC, BARCODE_QUIET_ZONES, 2, -1, -1, "1234", "", 0, 23, 6, 100, 202, 62.279999, 12, 18, 2, 28 }, + /*248*/ { BARCODE_DBAR_LTD_CC, -1, -1, -1, -1, "1234", "", 0, 19, 6, 79, 158, 54.279999, 2, 18, 2, 20 }, /* CC-A */ + /*249*/ { BARCODE_DBAR_LTD_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 19, 6, 79, 158, 54.279999, 2, 18, 2, 20 }, /* Same */ + /*250*/ { BARCODE_DBAR_LTD_CC, -1, 2, -1, -1, "1234", "", 0, 23, 8, 88, 176, 62.279999, 20, 26, 2, 20 }, /* CC-B */ + /*251*/ { BARCODE_DBAR_LTD_CC, BARCODE_QUIET_ZONES, 2, -1, -1, "1234", "", 0, 23, 8, 88, 178, 62.279999, 22, 26, 2, 20 }, + /*252*/ { BARCODE_DBAR_EXP_CC, -1, -1, -1, -1, "[20]12", "", 0, 41, 5, 102, 204, 98.279999, 2, 14, 2, 68 }, /* CC-A */ + /*253*/ { BARCODE_DBAR_EXP_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "[20]12", "", 0, 41, 5, 102, 204, 98.279999, 2, 14, 2, 68 }, /* Same */ + /*254*/ { BARCODE_DBAR_EXP_CC, -1, 2, -1, -1, "[20]12", "", 0, 43, 6, 102, 204, 102.28, 2, 18, 2, 68 }, /* CC-B */ + /*255*/ { BARCODE_DBAR_EXP_CC, BARCODE_QUIET_ZONES, 2, -1, -1, "[20]12", "", 0, 43, 6, 102, 204, 102.28, 2, 18, 2, 68 }, /* Same */ /*256*/ { BARCODE_UPCA_CC, -1, -1, -1, -1, "01457137763", "", 0, 50, 7, 99, 226, 118, 18, 20, 2, 90 }, /*257*/ { BARCODE_UPCA_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "01457137763", "", 0, 50, 7, 99, 226, 118, 18, 20, 2, 90 }, /*258*/ { BARCODE_UPCA_CC, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "01457137763", "", 0, 50, 7, 99, 226, 118, 18, 20, 2, 90 }, @@ -1990,8 +1990,8 @@ static void test_quiet_zones(const testCtx *const p_ctx) { /*277*/ { BARCODE_DBAR_EXPSTK_CC, BARCODE_QUIET_ZONES, -1, -1, -1, "[20]12", "", 0, 41, 5, 102, 204, 82, 2, 14, 2, 68 }, /* Same */ /*278*/ { BARCODE_DBAR_EXPSTK_CC, -1, 2, -1, -1, "[20]12", "", 0, 43, 6, 102, 204, 86, 2, 18, 2, 68 }, /* CC-B */ /*279*/ { BARCODE_DBAR_EXPSTK_CC, BARCODE_QUIET_ZONES, 2, -1, -1, "[20]12", "", 0, 43, 6, 102, 204, 86, 2, 18, 2, 68 }, /* Same */ - /*280*/ { BARCODE_CHANNEL, -1, -1, -1, -1, "1234", "", 0, 50, 1, 27, 54, 118.9, 0, 0, 2, 100 }, - /*281*/ { BARCODE_CHANNEL, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 27, 60, 118.9, 2, 0, 2, 100 }, + /*280*/ { BARCODE_CHANNEL, -1, -1, -1, -1, "1234", "", 0, 50, 1, 27, 54, 116.28, 0, 0, 2, 100 }, + /*281*/ { BARCODE_CHANNEL, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 50, 1, 27, 60, 116.28, 2, 0, 2, 100 }, /*282*/ { BARCODE_CODEONE, -1, -1, -1, -1, "1234", "", 0, 16, 16, 18, 36, 32, 0, 0, 2, 2 }, /* Versions A to H - no quiet zone */ /*283*/ { BARCODE_CODEONE, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 16, 16, 18, 36, 32, 0, 0, 2, 2 }, /*284*/ { BARCODE_CODEONE, BARCODE_NO_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 16, 16, 18, 36, 32, 0, 0, 2, 2 }, @@ -2005,8 +2005,8 @@ static void test_quiet_zones(const testCtx *const p_ctx) { /*292*/ { BARCODE_ULTRA, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 13, 13, 15, 34, 30, 2, 2, 30, 2 }, /*293*/ { BARCODE_RMQR, -1, -1, -1, -1, "1234", "", 0, 11, 11, 27, 54, 22, 0, 0, 14, 2 }, /*294*/ { BARCODE_RMQR, BARCODE_QUIET_ZONES, -1, -1, -1, "1234", "", 0, 11, 11, 27, 62, 30, 4, 4, 14, 2 }, - /*295*/ { BARCODE_BC412, -1, -1, -1, -1, "1234567", "", 0, 16.666668, 1, 102, 204, 52.233337, 0, 0, 2, 33.333336 }, - /*296*/ { BARCODE_BC412, BARCODE_QUIET_ZONES, -1, -1, -1, "1234567", "", 0, 16.666668, 1, 102, 244, 52.233337, 20, 0, 2, 33.333336 }, + /*295*/ { BARCODE_BC412, -1, -1, -1, -1, "1234567", "", 0, 16.666668, 1, 102, 204, 49.613335, 0, 0, 2, 33.333336 }, + /*296*/ { BARCODE_BC412, BARCODE_QUIET_ZONES, -1, -1, -1, "1234567", "", 0, 16.666668, 1, 102, 244, 49.613335, 20, 0, 2, 33.333336 }, }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -2054,13 +2054,13 @@ static void test_quiet_zones(const testCtx *const p_ctx) { testUtilVectorPrint(symbol); } - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.8g != %.8g\n", i, data[i].symbology, symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.9g != %.9g\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); if (symbol->symbology == BARCODE_MAXICODE || symbol->symbology == BARCODE_DOTCODE) { @@ -2106,51 +2106,52 @@ static void test_text_gap(const testCtx *const p_ctx) { }; /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ struct item data[] = { - /* 0*/ { BARCODE_CODE11, -1, -1, -1, 0, 0, "1234", "", 0, 50, 1, 62, 124, 118.9, 62.0, 114.0, -1, -1 }, /* Default */ - /* 1*/ { BARCODE_CODE11, -1, -1, -1, 0.1, 0, "1234", "", 0, 50, 1, 62, 124, 117.7, 62.0, 112.8, -1, -1 }, - /* 2*/ { BARCODE_CODE11, -1, -1, -1, 0.2, 0, "1234", "", 0, 50, 1, 62, 124, 117.9, 62.0, 113, -1, -1 }, - /* 3*/ { BARCODE_CODE11, -1, -1, -1, 0.3, 0, "1234", "", 0, 50, 1, 62, 124, 118.1, 62.0, 113.2, -1, -1 }, - /* 4*/ { BARCODE_CODE11, -1, -1, -1, 0.4, 0, "1234", "", 0, 50, 1, 62, 124, 118.3, 62.0, 113.4, -1, -1 }, - /* 5*/ { BARCODE_CODE11, -1, -1, -1, 0.5, 0, "1234", "", 0, 50, 1, 62, 124, 118.5, 62.0, 113.6, -1, -1 }, - /* 6*/ { BARCODE_CODE11, -1, -1, -1, 0.6, 0, "1234", "", 0, 50, 1, 62, 124, 118.7, 62.0, 113.799995, -1, -1 }, - /* 7*/ { BARCODE_CODE11, -1, -1, -1, 0.7, 0, "1234", "", 0, 50, 1, 62, 124, 118.9, 62.0, 114, -1, -1 }, - /* 8*/ { BARCODE_CODE11, -1, -1, -1, 0.75, 0, "1234", "", 0, 50, 1, 62, 124, 119, 62.0, 114.1, -1, -1 }, - /* 9*/ { BARCODE_CODE11, -1, -1, -1, 0.8, 0, "1234", "", 0, 50, 1, 62, 124, 119.1, 62.0, 114.2, -1, -1 }, - /* 10*/ { BARCODE_CODE11, -1, -1, -1, 0.9, 0, "1234", "", 0, 50, 1, 62, 124, 119.3, 62.0, 114.4, -1, -1 }, - /* 11*/ { BARCODE_CODE11, -1, -1, -1, 1.0, 0, "1234", "", 0, 50, 1, 62, 124, 119.5, 62.0, 114.6, -1, -1 }, /* Same as default */ - /* 12*/ { BARCODE_CODE11, -1, -1, -1, 1.1, 0, "1234", "", 0, 50, 1, 62, 124, 119.7, 62.0, 114.799995, -1, -1 }, - /* 13*/ { BARCODE_CODE11, -1, -1, -1, 1.5, 0, "1234", "", 0, 50, 1, 62, 124, 120.5, 62.0, 115.6, -1, -1 }, - /* 14*/ { BARCODE_CODE11, -1, -1, -1, 2.0, 0, "1234", "", 0, 50, 1, 62, 124, 121.5, 62.0, 116.6, -1, -1 }, - /* 15*/ { BARCODE_CODE11, -1, -1, -1, 3.0, 0, "1234", "", 0, 50, 1, 62, 124, 123.5, 62.0, 118.6, -1, -1 }, - /* 16*/ { BARCODE_CODE11, -1, -1, -1, 4.0, 0, "1234", "", 0, 50, 1, 62, 124, 125.5, 62.0, 120.6, -1, -1 }, - /* 17*/ { BARCODE_CODE11, -1, -1, -1, 5.0, 0, "1234", "", 0, 50, 1, 62, 124, 127.5, 62.0, 122.6, -1, -1 }, - /* 18*/ { BARCODE_CODE11, -1, -1, -1, 0, 3.0, "1234", "", 0, 50, 1, 62, 372, 356.7, 186.0, 342.0, -1, -1 }, /* Scale default */ - /* 19*/ { BARCODE_CODE11, -1, -1, -1, 0.1, 3.0, "1234", "", 0, 50, 1, 62, 372, 353.09998, 186.0, 338.4, -1, -1 }, /* Scale */ - /* 20*/ { BARCODE_UPCA, -1, -1, -1, 0, 0, "01457130763", "", 0, 50, 1, 95, 226, 118, 74.0, 117.2, -1, -1 }, /* Default */ - /* 21*/ { BARCODE_UPCA, -1, -1, -1, 0.1, 0, "01457130763", "", 0, 50, 1, 95, 226, 116.2, 74.0, 115.4, -1, -1 }, - /* 22*/ { BARCODE_UPCA, -1, -1, -1, 0.6, 0, "01457130763", "", 0, 50, 1, 95, 226, 117.2, 74.0, 116.4, -1, -1 }, - /* 23*/ { BARCODE_UPCA, -1, -1, -1, 0.7, 0, "01457130763", "", 0, 50, 1, 95, 226, 117.4, 74.0, 116.6, -1, -1 }, - /* 24*/ { BARCODE_UPCA, -1, -1, -1, 0.75, 0, "01457130763", "", 0, 50, 1, 95, 226, 117.5, 74.0, 116.7, -1, -1 }, - /* 25*/ { BARCODE_UPCA, -1, -1, -1, 0.8, 0, "01457130763", "", 0, 50, 1, 95, 226, 117.6, 74.0, 116.8, -1, -1 }, - /* 26*/ { BARCODE_UPCA, -1, -1, -1, 1.0, 0, "01457130763", "", 0, 50, 1, 95, 226, 118, 74.0, 117.2, -1, -1 }, /* Same as default */ - /* 27*/ { BARCODE_UPCA, -1, -1, -1, 1.6, 0, "01457130763", "", 0, 50, 1, 95, 226, 119.2, 74.0, 118.4, -1, -1 }, - /* 28*/ { BARCODE_UPCA, -1, -1, -1, 1.6, 2.5, "01457130763", "", 0, 50, 1, 95, 565, 298, 185.0, 296.0, -1, -1 }, /* Scale */ - /* 29*/ { BARCODE_UPCA, -1, -1, -1, 0, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 118, 74.0, 117.2, -1, -1 }, /* Default */ - /* 30*/ { BARCODE_UPCA, -1, -1, -1, 0, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 118, 230.0, 18, 4.0, 82 }, /* Default */ - /* 31*/ { BARCODE_UPCA, -1, -1, -1, 0.1, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 116.2, 230.0, 16.2, 4.0, 83.8 }, - /* 32*/ { BARCODE_UPCA, -1, -1, -1, 0.75, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 117.5, 230.0, 17.5, 4.0, 82.5 }, - /* 33*/ { BARCODE_UPCA, -1, -1, -1, 0.9, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 117.8, 230.0, 17.8, 4.0, 82.2 }, - /* 34*/ { BARCODE_UPCA, -1, -1, -1, 1.0, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 118, 74.0, 117.2, -1, -1 }, /* Same as default */ - /* 35*/ { BARCODE_UPCA, -1, -1, -1, 4.2, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 124.4, 230.0, 24.4, 4.0, 75.6 }, - /* 36*/ { BARCODE_UPCA_CC, -1, -1, -1, 0, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 118, 74.0, 117.2, -1, -1 }, /* Default */ - /* 37*/ { BARCODE_UPCA_CC, -1, -1, -1, 0.1, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 116.2, 74.0, 115.4, -1, -1 }, - /* 38*/ { BARCODE_UPCA_CC, -1, -1, -1, 0, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 118, 236.0, 42, 4.0, 58 }, /* Default */ - /* 39*/ { BARCODE_UPCA_CC, -1, -1, -1, 0.1, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 116.2, 236.0, 40.2, 4.0, 59.8 }, - /* 40*/ { BARCODE_UPCA_CC, -1, -1, -1, 0.75, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 117.5, 236.0, 41.5, 4.0, 58.5 }, - /* 41*/ { BARCODE_UPCA_CC, -1, -1, -1, 0, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 118, 236.0, 42, 4.0, 58 }, /* Same as default */ - /* 42*/ { BARCODE_UPCA_CC, -1, -1, -1, 1.5, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 119.0, 236.0, 43.0, 4.0, 57.0 }, - /* 43*/ { BARCODE_UPCA_CC, -1, -1, 0, 0, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 110, 236.0, 42, 4.0, 58 }, /* Hide text default */ - /* 44*/ { BARCODE_UPCA_CC, -1, -1, 0, 1.5, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 110, 236.0, 43.0, 4.0, 57.0 }, /* Hide text */ + /* 0*/ { BARCODE_CODE11, -1, -1, -1, 0, 0, "1234", "", 0, 50, 1, 62, 124, 116.28, 62.0, 113.3444, -1, -1 }, /* Default */ + /* 1*/ { BARCODE_CODE11, -1, -1, -1, 0.1, 0, "1234", "", 0, 50, 1, 62, 124, 114.479996, 62.0, 111.5444, -1, -1 }, + /* 2*/ { BARCODE_CODE11, -1, -1, -1, 0.2, 0, "1234", "", 0, 50, 1, 62, 124, 114.68, 62.0, 111.7444, -1, -1 }, + /* 3*/ { BARCODE_CODE11, -1, -1, -1, 0.3, 0, "1234", "", 0, 50, 1, 62, 124, 114.88, 62.0, 111.9444, -1, -1 }, + /* 4*/ { BARCODE_CODE11, -1, -1, -1, 0.4, 0, "1234", "", 0, 50, 1, 62, 124, 115.08, 62.0, 112.1444, -1, -1 }, + /* 5*/ { BARCODE_CODE11, -1, -1, -1, 0.5, 0, "1234", "", 0, 50, 1, 62, 124, 115.28, 62.0, 112.3444, -1, -1 }, + /* 6*/ { BARCODE_CODE11, -1, -1, -1, 0.6, 0, "1234", "", 0, 50, 1, 62, 124, 115.479996, 62.0, 112.5444, -1, -1 }, + /* 7*/ { BARCODE_CODE11, -1, -1, -1, 0.7, 0, "1234", "", 0, 50, 1, 62, 124, 115.68, 62.0, 112.7444, -1, -1 }, + /* 8*/ { BARCODE_CODE11, -1, -1, -1, 0.75, 0, "1234", "", 0, 50, 1, 62, 124, 115.78, 62.0, 112.8444, -1, -1 }, + /* 9*/ { BARCODE_CODE11, -1, -1, -1, 0.8, 0, "1234", "", 0, 50, 1, 62, 124, 115.88, 62.0, 112.9444, -1, -1 }, + /* 10*/ { BARCODE_CODE11, -1, -1, -1, 0.9, 0, "1234", "", 0, 50, 1, 62, 124, 116.08, 62.0, 113.1444, -1, -1 }, + /* 11*/ { BARCODE_CODE11, -1, -1, -1, 1.0, 0, "1234", "", 0, 50, 1, 62, 124, 116.28, 62.0, 113.3444, -1, -1 }, /* Same as default */ + /* 12*/ { BARCODE_CODE11, -1, -1, -1, 1.1, 0, "1234", "", 0, 50, 1, 62, 124, 116.48, 62.0, 113.5444, -1, -1 }, + /* 13*/ { BARCODE_CODE11, -1, -1, -1, 1.5, 0, "1234", "", 0, 50, 1, 62, 124, 117.28, 62.0, 114.3444, -1, -1 }, + /* 14*/ { BARCODE_CODE11, -1, -1, -1, 2.0, 0, "1234", "", 0, 50, 1, 62, 124, 118.28, 62.0, 115.3444, -1, -1 }, + /* 15*/ { BARCODE_CODE11, -1, -1, -1, 3.0, 0, "1234", "", 0, 50, 1, 62, 124, 120.28, 62.0, 117.3444, -1, -1 }, + /* 16*/ { BARCODE_CODE11, -1, -1, -1, 4.0, 0, "1234", "", 0, 50, 1, 62, 124, 122.28, 62.0, 119.3444, -1, -1 }, + /* 17*/ { BARCODE_CODE11, -1, -1, -1, 5.0, 0, "1234", "", 0, 50, 1, 62, 124, 124.28, 62.0, 121.3444, -1, -1 }, + /* 18*/ { BARCODE_CODE11, -1, -1, -1, 10.0, 0, "1234", "", 0, 50, 1, 62, 124, 134.28, 62.0, 131.3444, -1, -1 }, + /* 19*/ { BARCODE_CODE11, -1, -1, -1, 0, 3.0, "1234", "", 0, 50, 1, 62, 372, 348.839996, 186.0, 340.0332, -1, -1 }, /* Scale default */ + /* 20*/ { BARCODE_CODE11, -1, -1, -1, 0.1, 3.0, "1234", "", 0, 50, 1, 62, 372, 343.44, 186.0, 334.6332, -1, -1 }, /* Scale */ + /* 21*/ { BARCODE_UPCA, -1, -1, -1, 0, 0, "01457130763", "", 0, 50, 1, 95, 226, 118, 74.0, 117.2, -1, -1 }, /* Default */ + /* 22*/ { BARCODE_UPCA, -1, -1, -1, 0.1, 0, "01457130763", "", 0, 50, 1, 95, 226, 116.2, 74.0, 115.4, -1, -1 }, + /* 23*/ { BARCODE_UPCA, -1, -1, -1, 0.6, 0, "01457130763", "", 0, 50, 1, 95, 226, 117.2, 74.0, 116.4, -1, -1 }, + /* 24*/ { BARCODE_UPCA, -1, -1, -1, 0.7, 0, "01457130763", "", 0, 50, 1, 95, 226, 117.4, 74.0, 116.6, -1, -1 }, + /* 25*/ { BARCODE_UPCA, -1, -1, -1, 0.75, 0, "01457130763", "", 0, 50, 1, 95, 226, 117.5, 74.0, 116.7, -1, -1 }, + /* 26*/ { BARCODE_UPCA, -1, -1, -1, 0.8, 0, "01457130763", "", 0, 50, 1, 95, 226, 117.6, 74.0, 116.8, -1, -1 }, + /* 27*/ { BARCODE_UPCA, -1, -1, -1, 1.0, 0, "01457130763", "", 0, 50, 1, 95, 226, 118, 74.0, 117.2, -1, -1 }, /* Same as default */ + /* 28*/ { BARCODE_UPCA, -1, -1, -1, 1.6, 0, "01457130763", "", 0, 50, 1, 95, 226, 119.2, 74.0, 118.4, -1, -1 }, + /* 29*/ { BARCODE_UPCA, -1, -1, -1, 1.6, 2.5, "01457130763", "", 0, 50, 1, 95, 565, 298, 185.0, 296.0, -1, -1 }, /* Scale */ + /* 30*/ { BARCODE_UPCA, -1, -1, -1, 0, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 118, 74.0, 117.2, -1, -1 }, /* Default */ + /* 31*/ { BARCODE_UPCA, -1, -1, -1, 0, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 118, 230.0, 18, 4.0, 82 }, /* Default */ + /* 32*/ { BARCODE_UPCA, -1, -1, -1, 0.1, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 116.2, 230.0, 16.2, 4.0, 83.8 }, + /* 33*/ { BARCODE_UPCA, -1, -1, -1, 0.75, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 117.5, 230.0, 17.5, 4.0, 82.5 }, + /* 34*/ { BARCODE_UPCA, -1, -1, -1, 0.9, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 117.8, 230.0, 17.8, 4.0, 82.2 }, + /* 35*/ { BARCODE_UPCA, -1, -1, -1, 1.0, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 118, 74.0, 117.2, -1, -1 }, /* Same as default */ + /* 36*/ { BARCODE_UPCA, -1, -1, -1, 4.2, 0, "01457130763+10", "", 0, 50, 1, 124, 276, 124.4, 230.0, 24.4, 4.0, 75.6 }, + /* 37*/ { BARCODE_UPCA_CC, -1, -1, -1, 0, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 118, 74.0, 117.2, -1, -1 }, /* Default */ + /* 38*/ { BARCODE_UPCA_CC, -1, -1, -1, 0.1, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 116.2, 74.0, 115.4, -1, -1 }, + /* 39*/ { BARCODE_UPCA_CC, -1, -1, -1, 0, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 118, 236.0, 42, 4.0, 58 }, /* Default */ + /* 40*/ { BARCODE_UPCA_CC, -1, -1, -1, 0.1, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 116.2, 236.0, 40.2, 4.0, 59.8 }, + /* 41*/ { BARCODE_UPCA_CC, -1, -1, -1, 0.75, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 117.5, 236.0, 41.5, 4.0, 58.5 }, + /* 42*/ { BARCODE_UPCA_CC, -1, -1, -1, 0, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 118, 236.0, 42, 4.0, 58 }, /* Same as default */ + /* 43*/ { BARCODE_UPCA_CC, -1, -1, -1, 1.5, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 119.0, 236.0, 43.0, 4.0, 57.0 }, + /* 44*/ { BARCODE_UPCA_CC, -1, -1, 0, 0, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 110, 236.0, 42, 4.0, 58 }, /* Hide text default */ + /* 45*/ { BARCODE_UPCA_CC, -1, -1, 0, 1.5, 0, "01457130763+10", "[91]12", 0, 50, 7, 127, 276, 110, 236.0, 43.0, 4.0, 57.0 }, /* Hide text */ }; int data_size = ARRAY_SIZE(data); int i, length, ret; @@ -2199,13 +2200,13 @@ static void test_text_gap(const testCtx *const p_ctx) { testUtilVectorPrint(symbol); } - assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.8g != %.8g\n", i, data[i].symbology, symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%d) symbol->height %.9g != %.9g\n", i, data[i].symbology, symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%d) symbol->rows %d != %d\n", i, data[i].symbology, symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%d) symbol->width %d != %d\n", i, data[i].symbology, symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); if (data[i].expected_set_width == -1.0f) { @@ -2904,17 +2905,17 @@ static void test_height(const testCtx *const p_ctx) { assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%s) vector NULL\n", i, testUtilBarcodeName(data[i].symbology)); if (p_ctx->generate) { - printf(" /*%3d*/ { %s, %s, %.5g, \"%s\", \"%s\", %s, %.8g, %d, %d, %.8g, %.8g, \"%s\" },\n", + printf(" /*%3d*/ { %s, %s, %.5g, \"%s\", \"%s\", %s, %.9g, %d, %d, %.9g, %.9g, \"%s\" },\n", i, testUtilBarcodeName(data[i].symbology), testUtilOutputOptionsName(data[i].output_options), data[i].height, data[i].data, data[i].composite, testUtilErrorName(data[i].ret), symbol->height, symbol->rows, symbol->width, symbol->vector->width, symbol->vector->height, data[i].comment); } else { - assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%s) symbol->rows %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); } @@ -3064,18 +3065,18 @@ static void test_height_per_row(const testCtx *const p_ctx) { assert_nonnull(symbol->vector, "i:%d ZBarcode_Buffer_Vector(%s) vector NULL\n", i, testUtilBarcodeName(data[i].symbology)); if (p_ctx->generate) { - printf(" /*%3d*/ { %s, %s, %d, %d, %d, %.5g, %.5g, \"%s\", \"%s\", %s, %.8g, %d, %d, %.8g, %.8g, \"%s\" },\n", + printf(" /*%3d*/ { %s, %s, %d, %d, %d, %.5g, %.5g, \"%s\", \"%s\", %s, %.9g, %d, %d, %.9g, %.9g, \"%s\" },\n", i, testUtilBarcodeName(data[i].symbology), testUtilInputModeName(data[i].input_mode), data[i].option_1, data[i].option_2, data[i].option_3, data[i].height, data[i].scale, data[i].data, data[i].composite, testUtilErrorName(data[i].ret), symbol->height, symbol->rows, symbol->width, symbol->vector->width, symbol->vector->height, data[i].comment); } else { - assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %.8g != %.8g\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); + assert_equal(symbol->height, data[i].expected_height, "i:%d (%s) symbol->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->height, data[i].expected_height); assert_equal(symbol->rows, data[i].expected_rows, "i:%d (%s) symbol->rows %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->rows, data[i].expected_rows); assert_equal(symbol->width, data[i].expected_width, "i:%d (%s) symbol->width %d != %d\n", i, testUtilBarcodeName(data[i].symbology), symbol->width, data[i].expected_width); - assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.8g != %.8g\n", + assert_equal(symbol->vector->width, data[i].expected_vector_width, "i:%d (%s) symbol->vector->width %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->width, data[i].expected_vector_width); - assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.8g != %.8g\n", + assert_equal(symbol->vector->height, data[i].expected_vector_height, "i:%d (%s) symbol->vector->height %.9g != %.9g\n", i, testUtilBarcodeName(data[i].symbology), symbol->vector->height, data[i].expected_vector_height); } diff --git a/backend/vector.c b/backend/vector.c index 51773978..67143081 100644 --- a/backend/vector.c +++ b/backend/vector.c @@ -395,7 +395,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ int hide_text; int i, r; int block_width = 0; - int text_height; /* Font pixel size (so whole integers) */ + int font_height; /* Font pixel size (so whole integers) */ float text_gap; /* Gap between barcode and text */ float guard_descent; const int upcean_guard_whitespace = !(symbol->output_options & BARCODE_NO_QUIET_ZONES) @@ -404,12 +404,13 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ const int no_extend = is_codablockf || symbol->symbology == BARCODE_DPD; float large_bar_height; - const float descent_factor = 0.1f; /* Assuming descent roughly 10% of font size */ + const float descent = 1.32779717f; /* Arimo value for normal text (font height 7) */ + const float descent_small = 0.948426545f; /* Arimo value for SMALL_TEXT (font height 5) */ /* For UPC/EAN only */ float addon_row_yposn; float addon_row_height; - int upcae_outside_text_height = 0; /* UPC-A/E outside digits font size */ + int upcae_outside_font_height = 0; /* UPC-A/E outside digits font size */ /* Note using "ascender" to mean height above digits as "ascent" usually measured from baseline */ const float digit_ascender_factor = 0.22f; /* Assuming digit ascender height roughly 22% of font size */ float digit_ascender = 0.0f; /* Avoid gcc -Wmaybe-uninitialized */ @@ -477,19 +478,20 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ /* Note font sizes scaled by 2 so really twice these values */ if (upceanflag) { /* Note BOLD_TEXT ignored for UPCEAN by svg/emf/ps/qzint */ - text_height = symbol->output_options & SMALL_TEXT ? 7 : 10; - digit_ascender = text_height * digit_ascender_factor; - antialias_fudge = text_height * antialias_fudge_factor; + font_height = symbol->output_options & SMALL_TEXT ? 7 : 10; + digit_ascender = font_height * digit_ascender_factor; + antialias_fudge = font_height * antialias_fudge_factor; /* Although font size 7 (for normal) seems small it meets GS1 General Spec (GGS) Section 5.2.5: "the size of the first and last digits should be reduced to a maximum width equivalent to four modules" */ - upcae_outside_text_height = symbol->output_options & SMALL_TEXT ? 6 : 7; + upcae_outside_font_height = symbol->output_options & SMALL_TEXT ? 6 : 7; /* Note default now 1.0 (GGS 5.2.5 "Normally the minimum is one module") but was 0.5 (absolute minimum) */ text_gap = (symbol->text_gap ? symbol->text_gap : 1.0f) - digit_ascender; /* Guard bar height (none for EAN-2 and EAN-5) */ guard_descent = upceanflag >= 6 ? symbol->guard_descent : 0.0f; } else { - text_height = symbol->output_options & SMALL_TEXT ? 6 : 7; - text_gap = symbol->text_gap ? symbol->text_gap : text_height * 0.1f; + font_height = symbol->output_options & SMALL_TEXT ? 5 : 7; + antialias_fudge = font_height * antialias_fudge_factor; + text_gap = symbol->text_gap ? symbol->text_gap : 1.0f; guard_descent = 0.0f; } @@ -498,12 +500,12 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ } else { if (upceanflag) { /* Add fudge for anti-aliasing of digit bottoms */ - textoffset = text_height + text_gap + antialias_fudge; + textoffset = font_height + text_gap + antialias_fudge; if (textoffset < guard_descent) { textoffset = guard_descent; } } else { - textoffset = text_height * 1.25f + text_gap; /* Allow +25% for characters descending below baseline */ + textoffset = font_height + text_gap + antialias_fudge; } } @@ -607,11 +609,11 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ && module_is_set(symbol, r, i + block_width) == fill; block_width++); if ((r == (symbol->rows - 1)) && (i > main_width) && (addon_latch == 0)) { - addon_text_yposn = yposn + text_height - digit_ascender; + addon_text_yposn = yposn + font_height - digit_ascender; if (addon_text_yposn < 0.0f) { addon_text_yposn = 0.0f; } - addon_row_yposn = yposn + text_height + text_gap + antialias_fudge; + addon_row_yposn = yposn + font_height + text_gap + antialias_fudge; addon_row_height = row_height - (addon_row_yposn - yposn); if (upceanflag != 12 && upceanflag != 6) { /* UPC-A/E add-ons don't descend */ addon_row_height += guard_descent; @@ -639,7 +641,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ } else { yposn = yoffset; if (upceanflag && !hide_text) { /* EAN-2, EAN-5 (standalone add-ons) */ - yposn += text_height + text_gap + antialias_fudge; + yposn += font_height + text_gap + antialias_fudge; } for (r = 0; r < symbol->rows; r++) { const float row_height = symbol->row_height[r] ? symbol->row_height[r] : large_bar_height; @@ -736,18 +738,18 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ float text_yposn; float textwidth; - text_yposn = yoffset + symbol->height + text_height + text_gap; /* Calculated to bottom of text */ + text_yposn = yoffset + symbol->height + font_height + text_gap; /* Calculated to bottom of text */ if (upceanflag) { /* Allow for anti-aliasing if UPC/EAN */ if (upceanflag >= 6) { text_yposn -= antialias_fudge; } else { /* EAN-2/5 */ - text_yposn = yoffset + text_height - digit_ascender; + text_yposn = yoffset + font_height - digit_ascender; if (text_yposn < 0.0f) { text_yposn = 0.0f; } } } else { /* Else adjust to baseline */ - text_yposn -= text_height * descent_factor; + text_yposn -= symbol->output_options & SMALL_TEXT ? descent_small : descent; } if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))) { text_yposn += symbol->border_width; /* Note not needed for BARCODE_BIND_TOP */ @@ -763,26 +765,26 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ if (upceanflag == 6) { /* UPC-E */ text_xposn = -(5.0f - 0.35f) + xoffset; textwidth = 6.2f; - if (!vector_add_string(symbol, textparts[0], 1, text_xposn, text_yposn, upcae_outside_text_height, + if (!vector_add_string(symbol, textparts[0], 1, text_xposn, text_yposn, upcae_outside_font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY; text_xposn = (24.0f + 0.5f) + xoffset; textwidth = 6.0f * 8.5f; - if (!vector_add_string(symbol, textparts[1], 6, text_xposn, text_yposn, text_height, textwidth, + if (!vector_add_string(symbol, textparts[1], 6, text_xposn, text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; text_xposn = (51.0f - 0.35f) + 3.0f + xoffset; textwidth = 6.2f; - if (!vector_add_string(symbol, textparts[2], 1, text_xposn, text_yposn, upcae_outside_text_height, + if (!vector_add_string(symbol, textparts[2], 1, text_xposn, text_yposn, upcae_outside_font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; if (addon_len) { text_xposn = (addon_len == 2 ? 61.0f : 75.0f) + xoffset + addon_gap; textwidth = addon_len * 8.5f; - if (!vector_add_string(symbol, addon, addon_len, text_xposn, addon_text_yposn, text_height, + if (!vector_add_string(symbol, addon, addon_len, text_xposn, addon_text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; if (upcean_guard_whitespace) { text_xposn = (addon_len == 2 ? 70.0f : 97.0f) - 0.2f + xoffset + addon_gap; textwidth = 8.5f; if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn, - text_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; + font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; } } @@ -791,90 +793,90 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ text_xposn = -0.75f + xoffset; textwidth = 8.5f; if (!vector_add_string(symbol, (const unsigned char *) "<", 1, text_xposn, text_yposn, - text_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY; + font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY; } text_xposn = (17.0f + 0.5f) + xoffset; textwidth = 4.0f * 8.5f; - if (!vector_add_string(symbol, textparts[0], 4, text_xposn, text_yposn, text_height, textwidth, + if (!vector_add_string(symbol, textparts[0], 4, text_xposn, text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; text_xposn = (50.0f - 0.5f) + xoffset; - if (!vector_add_string(symbol, textparts[1], 4, text_xposn, text_yposn, text_height, textwidth, + if (!vector_add_string(symbol, textparts[1], 4, text_xposn, text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; if (addon_len) { text_xposn = (addon_len == 2 ? 77.0f : 91.0f) + xoffset + addon_gap; textwidth = addon_len * 8.5f; - if (!vector_add_string(symbol, addon, addon_len, text_xposn, addon_text_yposn, text_height, + if (!vector_add_string(symbol, addon, addon_len, text_xposn, addon_text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; if (upcean_guard_whitespace) { text_xposn = (addon_len == 2 ? 86.0f : 113.0f) - 0.2f + xoffset + addon_gap; textwidth = 8.5f; if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn, - text_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; + font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; } } else if (upcean_guard_whitespace) { text_xposn = (68.0f - 0.2f) + xoffset; textwidth = 8.5f; if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, text_yposn, - text_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; + font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; } } else if (upceanflag == 12) { /* UPC-A */ text_xposn = -(5.0f - 0.35f) + xoffset; textwidth = 6.2f; - if (!vector_add_string(symbol, textparts[0], 1, text_xposn, text_yposn, upcae_outside_text_height, + if (!vector_add_string(symbol, textparts[0], 1, text_xposn, text_yposn, upcae_outside_font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY; text_xposn = (27.0f + 1.0f) + xoffset; textwidth = 5.0f * 8.5f; - if (!vector_add_string(symbol, textparts[1], 5, text_xposn, text_yposn, text_height, textwidth, + if (!vector_add_string(symbol, textparts[1], 5, text_xposn, text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; text_xposn = 67.0f + xoffset; - if (!vector_add_string(symbol, textparts[2], 5, text_xposn, text_yposn, text_height, textwidth, + if (!vector_add_string(symbol, textparts[2], 5, text_xposn, text_yposn, font_height, textwidth, 0 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; text_xposn = (95.0f - 0.35f) + 5.0f + xoffset; textwidth = 6.2f; - if (!vector_add_string(symbol, textparts[3], 1, text_xposn, text_yposn, upcae_outside_text_height, + if (!vector_add_string(symbol, textparts[3], 1, text_xposn, text_yposn, upcae_outside_font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; if (addon_len) { text_xposn = (addon_len == 2 ? 105.0f : 119.0f) + xoffset + addon_gap; textwidth = addon_len * 8.5f; - if (!vector_add_string(symbol, addon, addon_len, text_xposn, addon_text_yposn, text_height, + if (!vector_add_string(symbol, addon, addon_len, text_xposn, addon_text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; if (upcean_guard_whitespace) { text_xposn = (addon_len == 2 ? 114.0f : 141.0f) - 0.2f + xoffset + addon_gap; textwidth = 8.5f; if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn, - text_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; + font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; } } } else { /* EAN-13 */ text_xposn = -(5.0f - 0.1f) + xoffset; textwidth = 8.5f; - if (!vector_add_string(symbol, textparts[0], 1, text_xposn, text_yposn, text_height, textwidth, + if (!vector_add_string(symbol, textparts[0], 1, text_xposn, text_yposn, font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY; text_xposn = (24.0f + 0.5f) + xoffset; textwidth = 6.0f * 8.5f; - if (!vector_add_string(symbol, textparts[1], 6, text_xposn, text_yposn, text_height, textwidth, + if (!vector_add_string(symbol, textparts[1], 6, text_xposn, text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; text_xposn = (71.0f - 0.5f) + xoffset; - if (!vector_add_string(symbol, textparts[2], 6, text_xposn, text_yposn, text_height, textwidth, + if (!vector_add_string(symbol, textparts[2], 6, text_xposn, text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; if (addon_len) { text_xposn = (addon_len == 2 ? 105.0f : 119.0f) + xoffset + addon_gap; textwidth = addon_len * 8.5f; - if (!vector_add_string(symbol, addon, addon_len, text_xposn, addon_text_yposn, text_height, + if (!vector_add_string(symbol, addon, addon_len, text_xposn, addon_text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; if (upcean_guard_whitespace) { text_xposn = (addon_len == 2 ? 114.0f : 141.0f) + xoffset + addon_gap; textwidth = 8.5f; if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn, - text_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; + font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; } } else if (upcean_guard_whitespace) { text_xposn = 96.0f + xoffset; textwidth = 8.5f; if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, text_yposn, - text_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; + font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; } } @@ -885,19 +887,19 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ /* Put at top (and centered) */ text_xposn = main_width / 2.0f + xoffset; textwidth = addon_len * 8.5f; - if (!vector_add_string(symbol, symbol->text, addon_len, text_xposn, text_yposn, text_height, + if (!vector_add_string(symbol, symbol->text, addon_len, text_xposn, text_yposn, font_height, textwidth, 0 /*centre align*/, &last_string)) return ZINT_ERROR_MEMORY; if (upcean_guard_whitespace) { text_xposn = (addon_len == 2 ? 18.75f : 45.75f) + xoffset + addon_gap; textwidth = 8.5f; if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, text_yposn, - text_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; + font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY; } } else { /* Put normal human readable text at the bottom (and centered) */ text_xposn = main_width / 2.0f + xoffset + comp_xoffset; - if (!vector_add_string(symbol, symbol->text, -1, text_xposn, text_yposn, text_height, symbol->width, 0, + if (!vector_add_string(symbol, symbol->text, -1, text_xposn, text_yposn, font_height, symbol->width, 0, &last_string)) return ZINT_ERROR_MEMORY; } } diff --git a/docs/images/bc412.svg b/docs/images/bc412.svg index 35c3b272..c8235282 100644 --- a/docs/images/bc412.svg +++ b/docs/images/bc412.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + AQQ45670 diff --git a/docs/images/c25iata.svg b/docs/images/c25iata.svg index 5753ad6f..ea8fca8c 100644 --- a/docs/images/c25iata.svg +++ b/docs/images/c25iata.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 9212320967 diff --git a/docs/images/c25ind.svg b/docs/images/c25ind.svg index c543234a..488cdf18 100644 --- a/docs/images/c25ind.svg +++ b/docs/images/c25ind.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 9212320967 diff --git a/docs/images/c25inter.svg b/docs/images/c25inter.svg index ddad9858..805b5bf7 100644 --- a/docs/images/c25inter.svg +++ b/docs/images/c25inter.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 9212320967 diff --git a/docs/images/c25logic.svg b/docs/images/c25logic.svg index 76d54864..b4271266 100644 --- a/docs/images/c25logic.svg +++ b/docs/images/c25logic.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 9212320967 diff --git a/docs/images/c25standard.svg b/docs/images/c25standard.svg index 78c3d6af..5014b98b 100644 --- a/docs/images/c25standard.svg +++ b/docs/images/c25standard.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 9212320967 diff --git a/docs/images/channel.svg b/docs/images/channel.svg index c65c4840..dbf95ff9 100644 --- a/docs/images/channel.svg +++ b/docs/images/channel.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 453678 diff --git a/docs/images/codabar.svg b/docs/images/codabar.svg index 935b13ae..8ae43f0d 100644 --- a/docs/images/codabar.svg +++ b/docs/images/codabar.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + A37859B diff --git a/docs/images/code11.svg b/docs/images/code11.svg index 106f2d8b..eab36b97 100644 --- a/docs/images/code11.svg +++ b/docs/images/code11.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 921232096769 diff --git a/docs/images/code128.svg b/docs/images/code128.svg index 5e1bfdaa..7fe22e88 100644 --- a/docs/images/code128.svg +++ b/docs/images/code128.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 130170X178 diff --git a/docs/images/code128_box.svg b/docs/images/code128_box.svg index 647f4c51..2394aa65 100644 --- a/docs/images/code128_box.svg +++ b/docs/images/code128_box.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + This Text diff --git a/docs/images/code128_embedfont.svg b/docs/images/code128_embedfont.svg index 7c8a5b51..bc957675 100644 --- a/docs/images/code128_embedfont.svg +++ b/docs/images/code128_embedfont.svg @@ -1,12 +1,12 @@ - + Zint Generated Symbol - + - + Áccent diff --git a/docs/images/code128_green.svg b/docs/images/code128_green.svg index 0ecb4555..5218a552 100644 --- a/docs/images/code128_green.svg +++ b/docs/images/code128_green.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + This Text diff --git a/docs/images/code128_green_alpha.svg b/docs/images/code128_green_alpha.svg index 289cbabe..e48672e8 100644 --- a/docs/images/code128_green_alpha.svg +++ b/docs/images/code128_green_alpha.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + This Text diff --git a/docs/images/code128_rotate90.svg b/docs/images/code128_rotate90.svg index 5d5d5c49..da4b27d0 100644 --- a/docs/images/code128_rotate90.svg +++ b/docs/images/code128_rotate90.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - - - + + + This Text diff --git a/docs/images/code128_small_bold.svg b/docs/images/code128_small_bold.svg index 0c5a3f57..d6ad4336 100644 --- a/docs/images/code128_small_bold.svg +++ b/docs/images/code128_small_bold.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + This Text diff --git a/docs/images/code128_stacked.svg b/docs/images/code128_stacked.svg index a1e22a07..bd5a5102 100644 --- a/docs/images/code128_stacked.svg +++ b/docs/images/code128_stacked.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + That diff --git a/docs/images/code128_textgap.svg b/docs/images/code128_textgap.svg index f930df68..cb928107 100644 --- a/docs/images/code128_textgap.svg +++ b/docs/images/code128_textgap.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + Áccent diff --git a/docs/images/code128ab.svg b/docs/images/code128ab.svg index 8312711d..4e78b868 100644 --- a/docs/images/code128ab.svg +++ b/docs/images/code128ab.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 130170X178 diff --git a/docs/images/code32.svg b/docs/images/code32.svg index a2c52fe1..240e05bc 100644 --- a/docs/images/code32.svg +++ b/docs/images/code32.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + A143523126 diff --git a/docs/images/code39.svg b/docs/images/code39.svg index d1c6760e..69c63a94 100644 --- a/docs/images/code39.svg +++ b/docs/images/code39.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + *1AB* diff --git a/docs/images/code93.svg b/docs/images/code93.svg index 0fad312b..1afc7247 100644 --- a/docs/images/code93.svg +++ b/docs/images/code93.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + C93 diff --git a/docs/images/dbar_exp.svg b/docs/images/dbar_exp.svg index 3e952e40..e6592919 100644 --- a/docs/images/dbar_exp.svg +++ b/docs/images/dbar_exp.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (01)98898765432106(3202)012345(15)991231 diff --git a/docs/images/dbar_ltd.svg b/docs/images/dbar_ltd.svg index 63d6168b..17e26898 100644 --- a/docs/images/dbar_ltd.svg +++ b/docs/images/dbar_ltd.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (01)09501101530010 diff --git a/docs/images/dbar_omn.svg b/docs/images/dbar_omn.svg index adae95dd..fb8c36bd 100644 --- a/docs/images/dbar_omn.svg +++ b/docs/images/dbar_omn.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (01)09501101530010 diff --git a/docs/images/dbar_truncated.svg b/docs/images/dbar_truncated.svg index e67fea7e..133a140c 100644 --- a/docs/images/dbar_truncated.svg +++ b/docs/images/dbar_truncated.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (01)09501101530010 diff --git a/docs/images/dpd.svg b/docs/images/dpd.svg index 25ff238e..2353e4ee 100644 --- a/docs/images/dpd.svg +++ b/docs/images/dpd.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 0003 932 0621 9912 3456 78 101 040 9 diff --git a/docs/images/dpident.svg b/docs/images/dpident.svg index 3fbb2e4e..d945b1a8 100644 --- a/docs/images/dpident.svg +++ b/docs/images/dpident.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 91.23 2.096.712 7 diff --git a/docs/images/dpleit.svg b/docs/images/dpleit.svg index 101e89b4..599ea6e0 100644 --- a/docs/images/dpleit.svg +++ b/docs/images/dpleit.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 92123.209.671.456 diff --git a/docs/images/ean14.svg b/docs/images/ean14.svg index 56095715..60630bb3 100644 --- a/docs/images/ean14.svg +++ b/docs/images/ean14.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (01)98898765432106 diff --git a/docs/images/excode39.svg b/docs/images/excode39.svg index a6a0386c..ee3fe941 100644 --- a/docs/images/excode39.svg +++ b/docs/images/excode39.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 123.45fd diff --git a/docs/images/gs1_128.svg b/docs/images/gs1_128.svg index c3f09c07..ddd9ae56 100644 --- a/docs/images/gs1_128.svg +++ b/docs/images/gs1_128.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (01)98898765432106(3202)012345(15)991231 diff --git a/docs/images/gs1_128_cc_c.svg b/docs/images/gs1_128_cc_c.svg index 9a54f6de..25957888 100644 --- a/docs/images/gs1_128_cc_c.svg +++ b/docs/images/gs1_128_cc_c.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (01)03312345678903 diff --git a/docs/images/gui_appearance.png b/docs/images/gui_appearance.png index 78b39da4..e4484ce1 100644 Binary files a/docs/images/gui_appearance.png and b/docs/images/gui_appearance.png differ diff --git a/docs/images/gui_aztec.png b/docs/images/gui_aztec.png index 07e6ef1f..05182e9c 100644 Binary files a/docs/images/gui_aztec.png and b/docs/images/gui_aztec.png differ diff --git a/docs/images/gui_cli_equivalent.png b/docs/images/gui_cli_equivalent.png index cfe57909..11723dc6 100644 Binary files a/docs/images/gui_cli_equivalent.png and b/docs/images/gui_cli_equivalent.png differ diff --git a/docs/images/gui_composite.png b/docs/images/gui_composite.png index 8570a793..6224ceb6 100644 Binary files a/docs/images/gui_composite.png and b/docs/images/gui_composite.png differ diff --git a/docs/images/gui_data_dialog.png b/docs/images/gui_data_dialog.png index b07e1b44..5318e244 100644 Binary files a/docs/images/gui_data_dialog.png and b/docs/images/gui_data_dialog.png differ diff --git a/docs/images/gui_export.png b/docs/images/gui_export.png index b7623cfe..b2e6f07b 100644 Binary files a/docs/images/gui_export.png and b/docs/images/gui_export.png differ diff --git a/docs/images/gui_main.png b/docs/images/gui_main.png index 97167ad6..894b2d48 100644 Binary files a/docs/images/gui_main.png and b/docs/images/gui_main.png differ diff --git a/docs/images/gui_menus.png b/docs/images/gui_menus.png index b51c1bd2..6c5303a4 100644 Binary files a/docs/images/gui_menus.png and b/docs/images/gui_menus.png differ diff --git a/docs/images/gui_scaling.png b/docs/images/gui_scaling.png index f008bcf2..25bc43ed 100644 Binary files a/docs/images/gui_scaling.png and b/docs/images/gui_scaling.png differ diff --git a/docs/images/gui_segs.png b/docs/images/gui_segs.png index 2c5e6569..b434942b 100644 Binary files a/docs/images/gui_segs.png and b/docs/images/gui_segs.png differ diff --git a/docs/images/gui_sequence.png b/docs/images/gui_sequence.png index 701af04c..907951ad 100644 Binary files a/docs/images/gui_sequence.png and b/docs/images/gui_sequence.png differ diff --git a/docs/images/gui_set_printing_scale.png b/docs/images/gui_set_printing_scale.png index 6bac06a6..c76387a0 100644 Binary files a/docs/images/gui_set_printing_scale.png and b/docs/images/gui_set_printing_scale.png differ diff --git a/docs/images/hibc_128.svg b/docs/images/hibc_128.svg index 9926f003..649c8a65 100644 --- a/docs/images/hibc_128.svg +++ b/docs/images/hibc_128.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + *+A123BJC5D6E71G* diff --git a/docs/images/hibc_39.svg b/docs/images/hibc_39.svg index 79fed9ab..7869b661 100644 --- a/docs/images/hibc_39.svg +++ b/docs/images/hibc_39.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + *+14352312J* diff --git a/docs/images/itf14.svg b/docs/images/itf14.svg index 2a87efe2..462721b1 100644 --- a/docs/images/itf14.svg +++ b/docs/images/itf14.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 92123209671459 diff --git a/docs/images/itf14_border0.svg b/docs/images/itf14_border0.svg index 4cf0ff5a..88da8b90 100644 --- a/docs/images/itf14_border0.svg +++ b/docs/images/itf14_border0.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 92123209671459 diff --git a/docs/images/koreapost.svg b/docs/images/koreapost.svg index 9646ddb4..552acd5f 100644 --- a/docs/images/koreapost.svg +++ b/docs/images/koreapost.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 9234570 diff --git a/docs/images/logmars.svg b/docs/images/logmars.svg index dd251e67..894ea7eb 100644 --- a/docs/images/logmars.svg +++ b/docs/images/logmars.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 12345/ABCDET diff --git a/docs/images/msi_plessey.svg b/docs/images/msi_plessey.svg index 040ac99e..0c53b871 100644 --- a/docs/images/msi_plessey.svg +++ b/docs/images/msi_plessey.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 650291 diff --git a/docs/images/nve18.svg b/docs/images/nve18.svg index 6781bb1b..4fc0e5eb 100644 --- a/docs/images/nve18.svg +++ b/docs/images/nve18.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + (00)376123450000010039 diff --git a/docs/images/plessey.svg b/docs/images/plessey.svg index 61debfd6..6dbe98d3 100644 --- a/docs/images/plessey.svg +++ b/docs/images/plessey.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + C64 diff --git a/docs/images/pzn.svg b/docs/images/pzn.svg index 837b975f..15475960 100644 --- a/docs/images/pzn.svg +++ b/docs/images/pzn.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + PZN - 27580899 diff --git a/docs/images/telepen.svg b/docs/images/telepen.svg index 5522713e..2ce4076d 100644 --- a/docs/images/telepen.svg +++ b/docs/images/telepen.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + Z80 diff --git a/docs/images/telepen_num.svg b/docs/images/telepen_num.svg index c3cb1eed..78110fd3 100644 --- a/docs/images/telepen_num.svg +++ b/docs/images/telepen_num.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 466X33 diff --git a/docs/images/upu_s10.svg b/docs/images/upu_s10.svg index 8a34a4d6..30e3a9c5 100644 --- a/docs/images/upu_s10.svg +++ b/docs/images/upu_s10.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + EE 876 543 216 CA diff --git a/docs/images/vin.svg b/docs/images/vin.svg index 3e785a61..c09b935a 100644 --- a/docs/images/vin.svg +++ b/docs/images/vin.svg @@ -1,11 +1,11 @@ - + Zint Generated Symbol - + - + 2FTPX28L0XCA15511 diff --git a/docs/manual.pmd b/docs/manual.pmd index cd02ca85..f3a58d2e 100644 --- a/docs/manual.pmd +++ b/docs/manual.pmd @@ -241,10 +241,10 @@ Below is a brief guide to Zint Barcode Studio. tab](images/gui_main.png) This is the main window of Zint Barcode Studio. The top of the window shows a -preview of the barcode which the current settings would create. These settings +preview of the barcode that the current settings would create. These settings can be changed using the controls below. The text box in the `"Data to Encode"` groupbox on this first Data tab allows you to enter the data to be encoded. When -you are happy with your settings you can use the `"Save As"` button to save the +you are happy with your settings you can use the `"Save..."` button to save the resulting image to a file. The `"Symbology"` drop-down box gives access to all of the symbologies supported @@ -268,9 +268,9 @@ barcode to defaults. The `"BMP"` and `"SVG"` buttons at the bottom will copy the image to the clipboard in BMP format and SVG format respectively. Further copy-to-clipboard formats are available by clicking the `"Menu"` button, along with -`"CLI Equivalent"`, `"Save As"`, `"Factory Reset"`, `"Help"`, `"About"` and -`"Quit"` options. Most of the options are also available in a context menu by -right-clicking the preview. +`"CLI Equivalent..."`, `"Save As..."`, `"Factory Reset..."`, `"Help"`, +`"About..."` and `"Quit"` options. Most of the options are also available in a +context menu by right-clicking the preview. ![Zint Barcode Studio main menu (left) and context menu (right)](images/gui_menus.png) @@ -1318,17 +1318,25 @@ zint -b 58 --binary -d "UTF-8 data" Data can be batch processed by reading from a text file and producing a separate barcode image for each line of text in that file. To do this use the -`--batch` switch. To select the input file from which to read data use the `-i` -option. Zint will automatically detect the end of a line of text (in either +`--batch` switch together with `-i` to select the input file from which to read +data. For example + +```bash +zint -b EANX --batch -i ean13nos.txt +``` + +where `"ean13nos.txt"` contains a list of EAN-13 numbers (GTINs), each on its +own line. Zint will automatically detect the end of a line of text (in either Unix or Windows formatted text files) and produce a symbol each time it finds -this. Input files should end with a line feed character - if this is not present -then Zint will not encode the last line of text, and will warn you that there -is a problem. +this. + +Input files should end with a line feed character - if this is not present then +Zint will not encode the last line of text, and will warn you that there is a +problem. By default Zint will output numbered filenames starting with `00001.png`, -`00002.png` etc. To change this behaviour use the `-o` option in combination -with `--batch` using special characters in the output filename as shown in the -table below: +`00002.png` etc. To change this behaviour specify the `-o` option using special +characters in the output filename as shown in the table below: Input Character Interpretation --------------- ------------------------------------------ @@ -1339,15 +1347,21 @@ Any other Insert literally Table: {#tbl:batch_filename_formatting tag=": Batch Filename Formatting"} +For instance + +```bash +zint -b EANX --batch -i ean13nos.txt -o file~~~.svg +``` + The following table shows some examples to clarify this method: Input Filenames Generated ------------------ --------------------------------------------------- -`-o file~~~.svg` `file001.svg`, `file002.svg`, `file003.svg` -`-o @@@@bar.png` `***1.png`, `***2.png`, `***3.png` (except Windows) -`-o @@@@bar.png` `+++1.png`, `+++2.png`, `+++3.png` (on Windows) -`-o my~~~bar.eps` `my001.bar.eps`, `my002.bar.eps`, `my003bar.eps` -`-o t@es~t~.png` `t*es0t1.png`, `t*es0t2.png`, `t*es0t3.png` +----------------- --------------------------------------------------------- +`-o file~~~.svg` `"file001.svg"`, `"file002.svg"`, `"file003.svg"` +`-o @@@@bar.png` `"***1.png"`, `"***2.png"`, `"***3.png"` (except Windows) +`-o @@@@bar.png` `"+++1.png"`, `"+++2.png"`, `"+++3.png"` (on Windows) +`-o my~~~bar.eps` `"my001bar.eps"`, `"my002bar.eps"`, `"my003bar.eps"` +`-o t#es~t~.png` `"t es0t1.png"`, `"t es0t2.png"`, `"t es0t3.png"` Table: {#tbl:batch_filename_examples tag=": Batch Filename Examples"} @@ -1356,11 +1370,14 @@ a large number of barcodes: Input Filenames Generated -------------------- ------------------------------------------------------ -`-o dir~/file~~~.svg` `dir0/file001.svg`, `dir0/file002.svg`, ... - , `dir0/file999.svg`, `dir1/file000.svg`, ... +`-o dir~/file~~~.svg` `"dir0/file001.svg"`, `"dir0/file002.svg"`, ... + , `"dir0/file999.svg"`, `"dir1/file000.svg"`, ... Table: {#tbl:batch_dir_examples tag=": Batch Directory Examples"} +For an alternative method of naming output files see the `--mirror` option in +[4.13 Automatic Filenames] below. + ## 4.12 Direct Output The finished image files can be output directly to stdout for use as part of a @@ -1409,7 +1426,9 @@ characters, for example, and may be shortened if the data input is long. To set the output file format use the `--filetype` option as detailed above in [4.12 Direct Output]. To output to a specific directory use the `-o` option -giving the name of the directory (any filename will be ignored). +giving the name of the directory (any filename will be ignored, unless +`--filetype` is not specified, in which case the filename's extension will be +used). ## 4.14 Working with Dots @@ -1489,7 +1508,8 @@ be used together if required, but only for vector output. The gap between the barcode and the text can be adjusted using the `--textgap` option, where the gap is given as a multiple of the X-dimension (maximum 10X). A -zero value uses the default gap. +zero value uses the default gap (1X). Note that a very small gap may cause +accented texts to overlap with the barcode: ![`zint -d "Áccent" --textgap=0.1`](images/code128_textgap.svg) @@ -1851,8 +1871,8 @@ Variable Name Type Meaning Default Value dotty mode (in X-dimensions). -`text_gap` float Gap between barcode and 0 (font-specific - text (HRT) in X-dimensions. default) +`text_gap` float Gap between barcode and 0 (default 1X) + text (HRT) in X-dimensions. `guard_descent` float Height of guard bar 5.0 descent (EAN/UPC only) in diff --git a/docs/manual.txt b/docs/manual.txt index ca9c9b96..8739d583 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -408,10 +408,10 @@ Below is a brief guide to Zint Barcode Studio. [Zint Barcode Studio on startup - main window with Data tab] This is the main window of Zint Barcode Studio. The top of the window shows a -preview of the barcode which the current settings would create. These settings +preview of the barcode that the current settings would create. These settings can be changed using the controls below. The text box in the "Data to Encode" groupbox on this first Data tab allows you to enter the data to be encoded. When -you are happy with your settings you can use the "Save As" button to save the +you are happy with your settings you can use the "Save..." button to save the resulting image to a file. The "Symbology" drop-down box gives access to all of the symbologies supported @@ -433,9 +433,9 @@ reset all settings for the barcode to defaults. The "BMP" and "SVG" buttons at the bottom will copy the image to the clipboard in BMP format and SVG format respectively. Further copy-to-clipboard formats are -available by clicking the "Menu" button, along with "CLI Equivalent", "Save As", -"Factory Reset", "Help", "About" and "Quit" options. Most of the options are -also available in a context menu by right-clicking the preview. +available by clicking the "Menu" button, along with "CLI Equivalent...", +"Save As...", "Factory Reset...", "Help", "About..." and "Quit" options. Most of +the options are also available in a context menu by right-clicking the preview. [Zint Barcode Studio main menu (left) and context menu (right)] @@ -1379,16 +1379,22 @@ by default and do not support ECI. In this case supply UTF-8 data and use the Data can be batch processed by reading from a text file and producing a separate barcode image for each line of text in that file. To do this use the --batch -switch. To select the input file from which to read data use the -i option. Zint -will automatically detect the end of a line of text (in either Unix or Windows -formatted text files) and produce a symbol each time it finds this. Input files -should end with a line feed character - if this is not present then Zint will -not encode the last line of text, and will warn you that there is a problem. +switch together with -i to select the input file from which to read data. For +example + + zint -b EANX --batch -i ean13nos.txt + +where "ean13nos.txt" contains a list of EAN-13 numbers (GTINs), each on its own +line. Zint will automatically detect the end of a line of text (in either Unix +or Windows formatted text files) and produce a symbol each time it finds this. + +Input files should end with a line feed character - if this is not present then +Zint will not encode the last line of text, and will warn you that there is a +problem. By default Zint will output numbered filenames starting with 00001.png, -00002.png etc. To change this behaviour use the -o option in combination with ---batch using special characters in the output filename as shown in the table -below: +00002.png etc. To change this behaviour specify the -o option using special +characters in the output filename as shown in the table below: Input Character Interpretation ----------------- ---------------------------------------- @@ -1399,15 +1405,19 @@ below: : Table : Batch Filename Formatting: +For instance + + zint -b EANX --batch -i ean13nos.txt -o file~~~.svg + The following table shows some examples to clarify this method: Input Filenames Generated - ----------------- ----------------------------------------------- - -o file~~~.svg file001.svg, file002.svg, file003.svg - -o @@@@bar.png ***1.png, ***2.png, ***3.png (except Windows) - -o @@@@bar.png +++1.png, +++2.png, +++3.png (on Windows) - -o my~~~bar.eps my001.bar.eps, my002.bar.eps, my003bar.eps - -o t@es~t~.png t*es0t1.png, t*es0t2.png, t*es0t3.png + ----------------- ----------------------------------------------------- + -o file~~~.svg "file001.svg", "file002.svg", "file003.svg" + -o @@@@bar.png "***1.png", "***2.png", "***3.png" (except Windows) + -o @@@@bar.png "+++1.png", "+++2.png", "+++3.png" (on Windows) + -o my~~~bar.eps "my001bar.eps", "my002bar.eps", "my003bar.eps" + -o t#es~t~.png "t es0t1.png", "t es0t2.png", "t es0t3.png" : Table : Batch Filename Examples: @@ -1415,12 +1425,15 @@ The special characters can span directories also, which is useful when creating a large number of barcodes: Input Filenames Generated - --------------------- ----------------------------------------- - -o dir~/file~~~.svg dir0/file001.svg, dir0/file002.svg, … - , dir0/file999.svg, dir1/file000.svg, … + --------------------- --------------------------------------------- + -o dir~/file~~~.svg "dir0/file001.svg", "dir0/file002.svg", … + , "dir0/file999.svg", "dir1/file000.svg", … : Table : Batch Directory Examples: +For an alternative method of naming output files see the --mirror option in 4.13 +Automatic Filenames below. + 4.12 Direct Output The finished image files can be output directly to stdout for use as part of a @@ -1468,7 +1481,8 @@ characters, for example, and may be shortened if the data input is long. To set the output file format use the --filetype option as detailed above in 4.12 Direct Output. To output to a specific directory use the -o option giving -the name of the directory (any filename will be ignored). +the name of the directory (any filename will be ignored, unless --filetype is +not specified, in which case the filename’s extension will be used). 4.14 Working with Dots @@ -1540,7 +1554,8 @@ together if required, but only for vector output. The gap between the barcode and the text can be adjusted using the --textgap option, where the gap is given as a multiple of the X-dimension (maximum 10X). A -zero value uses the default gap. +zero value uses the default gap (1X). Note that a very small gap may cause +accented texts to overlap with the barcode: [zint -d "Áccent" --textgap=0.1] @@ -1876,8 +1891,8 @@ encoding stages. The zint_symbol structure consists of the following variables: dotty mode (in X-dimensions). - text_gap float Gap between barcode and text 0 (font-specific - (HRT) in X-dimensions. default) + text_gap float Gap between barcode and text 0 (default 1X) + (HRT) in X-dimensions. guard_descent float Height of guard bar descent 5.0 (EAN/UPC only) in @@ -4887,8 +4902,8 @@ OPTIONS --textgap=NUMBER Adjust the gap between the barcode and the Human Readable Text (HRT). NUMBER - is in multiples of the X-dimension, and may be floating-point. Maximum is 5; - zero results in the default being used. + is in multiples of the X-dimension, and may be floating-point. Maximum is + 10; zero results in the default 1X being used. --vers=INTEGER @@ -4962,6 +4977,10 @@ EXIT STATUS Success (including when given informational options -h | --help, -e | --ecinos, -t | --types, -v | --version). +1 + Human Readable Text was truncated (maximum 159 bytes) + (ZINT_WARN_HRT_TRUNCATED) + 2 Invalid option given but overridden by Zint (ZINT_WARN_INVALID_OPTION) @@ -5001,6 +5020,9 @@ EXIT STATUS 14 Error counterpart of warning if --werror given (ZINT_ERROR_NONCOMPLIANT) +15 + Error counterpart of warning if --werror given (ZINT_ERROR_HRT_TRUNCATED) + EXAMPLES Create “out.png” (or “out.gif” if zint built without PNG support) in the current @@ -5012,11 +5034,11 @@ Create “qr.svg” in the current directory, as a QR Code symbol. zint -b QRCode -d 'This Text' -o 'qr.svg' -Use batch mode to read from an input file “ean_nos.txt” containing 13-digit +Use batch mode to read from an input file “ean13nos.txt” containing 13-digit GTINs, to create a series of EAN-13 barcodes, formatting the output filenames to “ean001.gif”, “ean002.gif” etc. using the special character “~”. - zint -b EANX --batch -i 'ean_nos.txt' -o 'ean~~~.gif' + zint -b EANX --batch -i 'ean13nos.txt' -o 'ean~~~.gif' BUGS diff --git a/docs/zint.1 b/docs/zint.1 index b8632745..8a0b92ab 100644 --- a/docs/zint.1 +++ b/docs/zint.1 @@ -458,7 +458,7 @@ The numbers or names can be used with \f[V]-b\f[R] | Adjust the gap between the barcode and the Human Readable Text (HRT). \f[I]NUMBER\f[R] is in multiples of the X-dimension, and may be floating-point. -Maximum is 5; zero results in the default being used. +Maximum is 10; zero results in the default 1X being used. .TP \f[V]--vers=INTEGER\f[R] Set the symbol version (size, check digits, other options) to @@ -543,6 +543,10 @@ Success (including when given informational options \f[V]-h\f[R] | \f[V]--help\f[R], \f[V]-e\f[R] | \f[V]--ecinos\f[R], \f[V]-t\f[R] | \f[V]--types\f[R], \f[V]-v\f[R] | \f[V]--version\f[R]). .TP +\f[V]1\f[R] +Human Readable Text was truncated (maximum 159 bytes) +(\f[V]ZINT_WARN_HRT_TRUNCATED\f[R]) +.TP \f[V]2\f[R] Invalid option given but overridden by Zint (\f[V]ZINT_WARN_INVALID_OPTION\f[R]) @@ -586,6 +590,10 @@ Error counterpart of warning if \f[V]--werror\f[R] given \f[V]14\f[R] Error counterpart of warning if \f[V]--werror\f[R] given (\f[V]ZINT_ERROR_NONCOMPLIANT\f[R]) +.TP +\f[V]15\f[R] +Error counterpart of warning if \f[V]--werror\f[R] given +(\f[V]ZINT_ERROR_HRT_TRUNCATED\f[R]) .SH EXAMPLES .PP Create \[lq]out.png\[rq] (or \[lq]out.gif\[rq] if zint built without PNG @@ -605,7 +613,7 @@ zint -b QRCode -d \[aq]This Text\[aq] -o \[aq]qr.svg\[aq] \f[R] .fi .PP -Use batch mode to read from an input file \[lq]ean_nos.txt\[rq] +Use batch mode to read from an input file \[lq]ean13nos.txt\[rq] containing 13-digit GTINs, to create a series of EAN-13 barcodes, formatting the output filenames to \[lq]ean001.gif\[rq], \[lq]ean002.gif\[rq] etc. @@ -613,7 +621,7 @@ using the special character \[lq]\[ti]\[rq]. .IP .nf \f[C] -zint -b EANX --batch -i \[aq]ean_nos.txt\[aq] -o \[aq]ean\[ti]\[ti]\[ti].gif\[aq] +zint -b EANX --batch -i \[aq]ean13nos.txt\[aq] -o \[aq]ean\[ti]\[ti]\[ti].gif\[aq] \f[R] .fi .SH BUGS diff --git a/docs/zint.1.pmd b/docs/zint.1.pmd index 25ecc8c8..7cb977ab 100644 --- a/docs/zint.1.pmd +++ b/docs/zint.1.pmd @@ -364,7 +364,7 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S `--textgap=NUMBER` : Adjust the gap between the barcode and the Human Readable Text (HRT). *NUMBER* is in multiples of the X-dimension, - and may be floating-point. Maximum is 5; zero results in the default being used. + and may be floating-point. Maximum is 10; zero results in the default 1X being used. `--vers=INTEGER` @@ -437,6 +437,9 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S : Success (including when given informational options `-h` | `--help`, `-e` | `--ecinos`, `-t` | `--types`, `-v` | `--version`). +`1` +: Human Readable Text was truncated (maximum 159 bytes) (`ZINT_WARN_HRT_TRUNCATED`) + `2` : Invalid option given but overridden by Zint (`ZINT_WARN_INVALID_OPTION`) @@ -476,6 +479,9 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S `14` : Error counterpart of warning if `--werror` given (`ZINT_ERROR_NONCOMPLIANT`) +`15` +: Error counterpart of warning if `--werror` given (`ZINT_ERROR_HRT_TRUNCATED`) + # EXAMPLES Create "out.png" (or "out.gif" if zint built without PNG support) in the current directory, as a Code 128 symbol. @@ -490,11 +496,11 @@ Create "qr.svg" in the current directory, as a QR Code symbol. zint -b QRCode -d 'This Text' -o 'qr.svg' ``` -Use batch mode to read from an input file "ean_nos.txt" containing 13-digit GTINs, to create a series of EAN-13 +Use batch mode to read from an input file "ean13nos.txt" containing 13-digit GTINs, to create a series of EAN-13 barcodes, formatting the output filenames to "ean001.gif", "ean002.gif" etc. using the special character "~". ```bash -zint -b EANX --batch -i 'ean_nos.txt' -o 'ean~~~.gif' +zint -b EANX --batch -i 'ean13nos.txt' -o 'ean~~~.gif' ``` # BUGS diff --git a/frontend_qt/mainWindow.ui b/frontend_qt/mainWindow.ui index 92c75fd1..0cad61fb 100644 --- a/frontend_qt/mainWindow.ui +++ b/frontend_qt/mainWindow.ui @@ -1936,7 +1936,7 @@ the barcode in X-dimensions - Set text gap to zero (default) + Set text gap to zero (default 1X) diff --git a/frontend_qt/mainwindow.cpp b/frontend_qt/mainwindow.cpp index c4580190..93260a3b 100644 --- a/frontend_qt/mainwindow.cpp +++ b/frontend_qt/mainwindow.cpp @@ -1683,7 +1683,8 @@ void MainWindow::change_options() chkComposite->setText(tr("Add &2D Component")); combobox_item_enabled(cmbCompType, 3, false); // CC-C btype->setItemText(0, tr("No border")); - combobox_item_enabled(cmbFontSetting, 1, true); + combobox_item_enabled(cmbFontSetting, 1, true); // Reset bold options + combobox_item_enabled(cmbFontSetting, 3, true); m_lblHeightPerRow = nullptr; m_spnHeightPerRow = nullptr; m_btnHeightPerRowDisable = nullptr;