From 25807ad43c5c6dd7f04999865aee337876e6ac90 Mon Sep 17 00:00:00 2001 From: gitlost Date: Sat, 1 Jan 2022 15:24:59 +0000 Subject: [PATCH] Matrix symbols: change horizontal boundary bars to appear outside any vertical whitespace, as they're decorative rather than functional (#247) Allow for dot overspill in height of vertical box sides (dotty mode) Move is_dotty(), is_fixed_ratio() from library.c to common.c --- ChangeLog | 6 + backend/common.c | 43 +++++++ backend/common.h | 2 + backend/library.c | 43 ------- backend/raster.c | 20 ++- .../data/bmp/ultracode_fg_bg_hvwsp1_box1.bmp | Bin 774 -> 774 bytes .../tests/data/emf/ultracode_fg_bg_box2.emf | Bin 2940 -> 2940 bytes .../tests/data/eps/ultra_fg_bg_box_cmyk.eps | 8 +- .../tests/data/gif/ultra_fgbg_hvwsp1_box1.gif | Bin 324 -> 330 bytes .../data/pcx/ultra_fg_bg_hvwsp1_box1.pcx | Bin 2068 -> 2100 bytes .../png/datamatrix_2.0_hvwsp1_bind1_dotty.png | Bin 191 -> 190 bytes .../tests/data/png/maxicode_hvwsp1_box2.png | Bin 2149 -> 2147 bytes .../tests/data/png/maxicode_vwsp1_bind1.png | Bin 2064 -> 2061 bytes .../data/png/ultra_fgalpha_hvwsp1_box1.png | Bin 248 -> 246 bytes backend/tests/data/png/ultra_hvwsp1_box1.png | Bin 214 -> 219 bytes .../svg/datamatrix_hvwsp1_bind1_dotty.svg | 4 +- .../data/svg/datamatrix_vwsp1_bind1_dotty.svg | 4 +- .../tests/data/svg/maxicode_vwsp1_bind1.svg | 4 +- .../tests/data/svg/ultra_fgbg_hvwsp2_box3.svg | 8 +- .../tests/data/tif/ultra_fgbg_hvwsp1_box1.tif | Bin 506 -> 502 bytes backend/tests/test_raster.c | 119 ++++++++++-------- backend/tests/test_vector.c | 52 ++++---- backend/vector.c | 64 +++++----- docs/manual.txt | 7 +- 24 files changed, 217 insertions(+), 167 deletions(-) diff --git a/ChangeLog b/ChangeLog index 332361e4..bad5d32e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,9 @@ Version 2.10.0.9 (dev) not released yet NOTE: previously was silently truncated - PDF417: return warning if specified cols increased NOTE: previously no warning was returned +- Matrix symbols: horizontal boundary bars appear outside any vertical + whitespace + NOTE: previously appeared inside vertical whitespace Changes ------- @@ -47,6 +50,8 @@ Changes - DATAMATRIX: new algorithm for (near-)optimal encoding, props Alex Geller - CLI/GUI/Tcl: add --fast option to select faster but less optimal DATAMATRIX algorithm (previous default) +- Matrix symbols: change horizontal boundary bars to appear outside any + vertical whitespace, as they're decorative rather than functional (#247) Bugs ---- @@ -69,6 +74,7 @@ Bugs - DATAMATRIX: fix mis-encoding of non-encodables in X12 and EDIFACT modes, props Alex Geller - DATAMATRIX: fix mis-encoding of FNC1/GS in EDIFACT in GS1 mode +- Allow for dot overspill in height of vertical box sides (dotty mode) Version 2.10.0 2021-08-14 diff --git a/backend/common.c b/backend/common.c index 00a46df6..2d1ae2cb 100644 --- a/backend/common.c +++ b/backend/common.c @@ -298,6 +298,49 @@ INTERNAL int is_composite(const int symbology) { return symbology >= BARCODE_EANX_CC && symbology <= BARCODE_DBAR_EXPSTK_CC; } +/* Returns 1 if symbology is a matrix design renderable as dots */ +INTERNAL int is_dotty(const int symbology) { + + switch (symbology) { + /* Note MAXICODE and ULTRA absent */ + case BARCODE_QRCODE: + case BARCODE_DATAMATRIX: + case BARCODE_MICROQR: + case BARCODE_HIBC_DM: + case BARCODE_AZTEC: + case BARCODE_HIBC_QR: + case BARCODE_HIBC_AZTEC: + case BARCODE_AZRUNE: + case BARCODE_CODEONE: + case BARCODE_GRIDMATRIX: + case BARCODE_HANXIN: + case BARCODE_DOTCODE: + case BARCODE_UPNQR: + case BARCODE_RMQR: + return 1; + break; + } + + return 0; +} + +/* Returns 1 if symbology has fixed aspect ratio (matrix design) */ +INTERNAL int is_fixed_ratio(const int symbology) { + + if (is_dotty(symbology)) { + return 1; + } + + switch (symbology) { + case BARCODE_MAXICODE: + case BARCODE_ULTRA: + return 1; + break; + } + + return 0; +} + /* Whether next two characters are digits */ INTERNAL int is_twodigits(const unsigned char source[], const int length, const int position) { if ((position + 1 < length) && (source[position] >= '0') && (source[position] <= '9') diff --git a/backend/common.h b/backend/common.h index 84ac4a42..724f2a08 100644 --- a/backend/common.h +++ b/backend/common.h @@ -168,6 +168,8 @@ extern "C" { INTERNAL int is_stackable(const int symbology); INTERNAL int is_extendable(const int symbology); INTERNAL int is_composite(const int symbology); + INTERNAL int is_dotty(const int symbology); + INTERNAL int is_fixed_ratio(const int symbology); INTERNAL int is_twodigits(const unsigned char source[], const int length, const int position); diff --git a/backend/library.c b/backend/library.c index c823ba5c..e4f87103 100644 --- a/backend/library.c +++ b/backend/library.c @@ -393,49 +393,6 @@ static int gs1_compliant(const int symbology) { return check_force_gs1(symbology); } -static int is_dotty(const int symbology) { - /* Returns 1 if symbology is a matrix design renderable as dots */ - - switch (symbology) { - /* Note MAXICODE and ULTRA absent */ - case BARCODE_QRCODE: - case BARCODE_DATAMATRIX: - case BARCODE_MICROQR: - case BARCODE_HIBC_DM: - case BARCODE_AZTEC: - case BARCODE_HIBC_QR: - case BARCODE_HIBC_AZTEC: - case BARCODE_AZRUNE: - case BARCODE_CODEONE: - case BARCODE_GRIDMATRIX: - case BARCODE_HANXIN: - case BARCODE_DOTCODE: - case BARCODE_UPNQR: - case BARCODE_RMQR: - return 1; - break; - } - - return 0; -} - -static int is_fixed_ratio(const int symbology) { - /* Returns 1 if symbology has fixed aspect ratio (matrix design) */ - - if (is_dotty(symbology)) { - return 1; - } - - switch (symbology) { - case BARCODE_MAXICODE: - case BARCODE_ULTRA: - return 1; - break; - } - - return 0; -} - static int supports_eci(const int symbology) { /* Returns 1 if symbology can encode the ECI character */ diff --git a/backend/raster.c b/backend/raster.c index e2f615cc..25ce22fc 100644 --- a/backend/raster.c +++ b/backend/raster.c @@ -668,9 +668,14 @@ static void draw_bind_box(const struct zint_symbol *symbol, unsigned char *pixel const int xoffset_si, const int yoffset_si, const int symbol_height_si, const int dot_overspill_si, const int image_width, const int image_height, const int si) { if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))) { + const int horz_outside = is_fixed_ratio(symbol->symbology); const int bwidth_si = symbol->border_width * si; - const int ybind_top = yoffset_si - bwidth_si; - const int ybind_bot = yoffset_si + symbol_height_si + dot_overspill_si; + int ybind_top = yoffset_si - bwidth_si; + int ybind_bot = yoffset_si + symbol_height_si + dot_overspill_si; + if (horz_outside) { + ybind_top = 0; + ybind_bot = image_height - bwidth_si; + } /* Horizontal boundary bars */ if ((symbol->output_options & BARCODE_BOX) || (symbol->symbology != BARCODE_CODABLOCKF && symbol->symbology != BARCODE_HIBC_BLOCKF)) { @@ -686,9 +691,14 @@ static void draw_bind_box(const struct zint_symbol *symbol, unsigned char *pixel if (symbol->output_options & BARCODE_BOX) { /* Vertical side bars */ const int xbox_right = image_width - bwidth_si; - draw_bar(pixelbuf, 0, bwidth_si, yoffset_si, symbol_height_si, image_width, image_height, DEFAULT_INK); - draw_bar(pixelbuf, xbox_right, bwidth_si, yoffset_si, symbol_height_si, image_width, image_height, - DEFAULT_INK); + int box_top = yoffset_si; + int box_height = symbol_height_si + dot_overspill_si; + if (horz_outside) { + box_top = bwidth_si; + box_height = image_height - bwidth_si * 2; + } + draw_bar(pixelbuf, 0, bwidth_si, box_top, box_height, image_width, image_height, DEFAULT_INK); + draw_bar(pixelbuf, xbox_right, bwidth_si, box_top, box_height, image_width, image_height, DEFAULT_INK); } } } diff --git a/backend/tests/data/bmp/ultracode_fg_bg_hvwsp1_box1.bmp b/backend/tests/data/bmp/ultracode_fg_bg_hvwsp1_box1.bmp index e8eca02aa012149ae464f44f1f91d762e5ed821c..59fe78fc5cfecead0102e61dd760f3a3760156c6 100644 GIT binary patch delta 92 ucmZo;Yh#-bH?d7ii2)VNWMBXy6fkk0^v0u~7*$aOfgCJK8D>sw(EBC5z&oDKQT@$7MWNqtU;7UpdtW?s0xSx diff --git a/backend/tests/data/emf/ultracode_fg_bg_box2.emf b/backend/tests/data/emf/ultracode_fg_bg_box2.emf index 915704f9f1e0c7817b50d7302e6a747899734749..807a675e1fad02862c16ac3aaf7ccea061bdf92b 100644 GIT binary patch delta 94 zcmew(_D5{P9L7KfAkYC~79iFJVhJDy0W}~7iE9BdvN%W`2!rHd;u=sfkb1SvZyEbJ E0lZ%b9RL6T delta 94 zcmew(_D5{P9L7Kv1_lNlAm#vKZ6KBaVh~UQVvx8R5F?9&)PeMXnYPZZ z5G>`51y`l*Z5tARJ|ERuo{^k%PgHpZdpU4@Nq;3xOm_!*k9Kcyivo=|kC9;oRAgp0 zXmgN-1a^Nok)M8C20D19rv#~pW;(V`w>GzxC%U-5zQF^kiaI>5Rgzz9V8mE|bp^;& zZp@U4&nJOCMY4njJZQWo+fk_B;jOf*PMF=?$!vU}nbY3g@`vLk$4=EaUM3xImPJ6n zXx##KdPES~fI#P7y|U8~nU090CN8W9qZea}eI6A<{) DK9_>7 delta 299 zcmV+`0o4A=0>lCnM@dFFH(?|IA^`FL0RI300094y6C{7>g1tEF&Ab1cB8+5do~VL} zXzP;d#SQ~OjC4^L#&PI6o6k0iS!T7HAh+xNfWiY&U<|NEJluc>Eckp~UlFhZl(NgM zA^c^J%UW?dNbvD^(PvdUbhodcf)p#-CjrX@65v}v`onQ$byyaTtswz->g1#wb~I$z2MuvVu7I>u4S z%W{MzeQHClfNM?7R|45Q+uh!1*J+aFPEp(7&+EtJ$I5!8&Lz>r+g)_l_`>aD($62J xbe@>0<3@=R9eBpHh;l-Y%Oz5}UT8FtZV{tLVIU7eiX2JO6or#0Q>sh=06U-7iWUF> diff --git a/backend/tests/data/pcx/ultra_fg_bg_hvwsp1_box1.pcx b/backend/tests/data/pcx/ultra_fg_bg_hvwsp1_box1.pcx index 060a6de63b3daacbd354a45e1c785789a9d8e272..f6ee116345ace01a3404c3a9054be5f16e5aed79 100644 GIT binary patch delta 83 zcmbOtuti`(quT!;3_u7b5B>kba0tjc#PH?+As`Ehw{dzZ`@~gTau^a&tq=nM0_ico delta 54 pcmdlYFhyWOBR9hjh9Ccd7)VZR5Sz@xA++&`2fGAJ3@n4B1_0Mb9IF5T diff --git a/backend/tests/data/png/datamatrix_2.0_hvwsp1_bind1_dotty.png b/backend/tests/data/png/datamatrix_2.0_hvwsp1_bind1_dotty.png index fe9d172405d97848e8d0696279ad0e6d93452221..d8f0f8d5fe1850f2d6968a8ffd16b04993740f2d 100644 GIT binary patch delta 144 zcmV;B0B`@l0loo{Hh*(TL_t&-(~Xfa3Ist21Phb?hWJ7=)BCv>%rTlQx1C5)G$_*D z-TmQdzKxlg0g|M}*E}nqX015yANkvXXu0mjfVrxer diff --git a/backend/tests/data/png/maxicode_hvwsp1_box2.png b/backend/tests/data/png/maxicode_hvwsp1_box2.png index fece2091b5bb21c1fdfffb51dc5069c6a380486e..b9a53890e14b0a8b29bbb3b33f36319696e7870b 100644 GIT binary patch delta 2061 zcmV+o2=e#k5aSS#HUSusH#>ijnPCPZ1{HevqNqNse)Tb^jBAD)`i8!t{~h!Q>#pX8 z{{7JJp<0T&6ncWXTZqR5x;R18FGQO_mow~!g;3qr(Ro^4x8MNp%5Jz9;e7JcRrex% z?-V06)yw!S!u=~%56>ce&zBSIKE6(~h|Z$x0cH_Cx;jDo<=amsqIZ9RG!{z4Hqm)n z=2`IWSRBgkh~C*B9}Yl{fxD{cOL9!PuO52eJCF5;0m#A0JKytd^BHB+C-2_;s8XN) zng9bcdH2JQ*zKV6w9K<0c?aMK@0NGkJ5T%2^9k{6-5*3%7Z zr)8c6DYGTSLtpLzz0-fKI@8Jl9#Kr|PQYq}7OJgpf!?}pCPa%sV`gZq@g zl(&bXfA7#PIW7gJ(>`PzF7Yk}rs^R?yQIDlm><53TSez-nP)+MI}*Zp$3J(BgOegS zcXaS1MR@LX5|~L5o(-Ep=V_T|!8^47Wszpox0>W1Mn?;rb76ncQF?wZ3_4Ez&xJw9 z%ZhWcJ#?Oyc@{*|BS|wNtasdlIO7P|`ip%4aW)fF0eF>Ci#LDt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EyFnr;ru8|n#VD6)2c6yXhW0-@v-ICkMRsz?@g*lkJGKHPGB@BLDa{X_IC905S z5Hj!O(~WW&-OW)m3V*swa^swrU70y>OI|V~UqAuP@DyKAD{k;hp5^N-p!uRowra)W z0?FEZIi}U@Q>AXT+69)VLZU&)T`w42nK|GJnHb3ZCuV0U>clwqf@&zKF)L44Wu>bfj=iAT zQ)+0-^IBQy+KHp(4zNTO5)Hyb_ocbRtMjtr2*Kk0+W8y2>;C@i@%#g5N`bW&-vH+T O0000EMm$gHCR(PX5w%#sGwzA_F%=O215!uAusbT ztSl5!N;DW!m~=>au&SUO#;jHt)OnFMI#@0~Dq?19B1A;vfJ3002ov JPDHLkV1h!7KSlrm delta 157 zcmV;O0Am040r&xsV}F22L_t(2&yCVc5yLK z^Ng0Jd*1BX`C`hbPy%dhJhB_N?Z(8Y!3lU{(@`4Ql#R(F;v`Ns_AOlxD^o|Lh0A*v zHjG?jx89gK3Z&p{Y&^m#&EHJ#CPppT{oS{)!~Z?pm$Uu*02E;KvZLHLIiCOk002ov JPDHLkV1m)FO9=n~ delta 150 zcmV;H0BQf*0oDPKNPl@rL_t(2&yCX22}3aqLs6}8XVENLK`VIuewDtq!9;&P27}{B zmzn>ZO$RxfGAfh+i;YKiujsht-i;YJ(rTKc(UlXGi?0)7Q?C!po|K&0-a7nJ~ - - + + diff --git a/backend/tests/data/svg/datamatrix_vwsp1_bind1_dotty.svg b/backend/tests/data/svg/datamatrix_vwsp1_bind1_dotty.svg index 0c3108c9..2a1dd1d6 100644 --- a/backend/tests/data/svg/datamatrix_vwsp1_bind1_dotty.svg +++ b/backend/tests/data/svg/datamatrix_vwsp1_bind1_dotty.svg @@ -8,8 +8,8 @@ - - + + diff --git a/backend/tests/data/svg/maxicode_vwsp1_bind1.svg b/backend/tests/data/svg/maxicode_vwsp1_bind1.svg index 6aaf1974..d4d10d24 100644 --- a/backend/tests/data/svg/maxicode_vwsp1_bind1.svg +++ b/backend/tests/data/svg/maxicode_vwsp1_bind1.svg @@ -8,8 +8,8 @@ - - + + diff --git a/backend/tests/data/svg/ultra_fgbg_hvwsp2_box3.svg b/backend/tests/data/svg/ultra_fgbg_hvwsp2_box3.svg index 2c4d23b2..4f4b84b9 100644 --- a/backend/tests/data/svg/ultra_fgbg_hvwsp2_box3.svg +++ b/backend/tests/data/svg/ultra_fgbg_hvwsp2_box3.svg @@ -173,9 +173,9 @@ - - - - + + + + diff --git a/backend/tests/data/tif/ultra_fgbg_hvwsp1_box1.tif b/backend/tests/data/tif/ultra_fgbg_hvwsp1_box1.tif index c2d02c46146dc75469656c2225f2f157aa72738c..d199ed98ebbee36ce138168de2a045599404ea37 100644 GIT binary patch delta 318 zcmeyx{EfNZ(^HG#0|Ns?gIYp>g^Cz2dyB(GfgLGkvfPc%j{C3g(y0qN%)R%1slU4=Rr%jcN%}UOia+_=0iw#Wf z<-6mOu32CG_TGEO^{maFdE$&}%N`nR(U!HUGUhm+A-pH&Q}sm2Cm+82`m!lJZCAR= z%vXOeyf2u1LG4DZty%M`Y0q9>w=7w4R{Lgp+0MB~`)pw9~0FW`_?8 z4+8@uGXo>g%W6P8nTavL@CA?|#mEX4Yy-+jL)m>mwgyx&6HtuYmviuz`i5<;*!gR%ZloSg+j+E(2 z`5a|n4c@_UM$lN)Ej6IS%~N5br^=!r+cSQ%GKkN5gdJ=kT&86t}gPsMGZu-eZcUoUwzSyAWTch>HC(CyR&WjgTTkow} zmc6aXebM^6ec!csnQ|vw^Za__x3AS}y{VE*EB|iU^m^{y8;>vE6X(-c=q#!X 1 - /* 33*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 2, 2 }, - /* 34*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 41, 1 }, - /* 35*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 40, 2 }, - /* 36*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 1, 1 }, - /* 37*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 2, 2 }, - /* 38*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_BIND | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 59, 1, 2, 2 }, - /* 39*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 59, 59, 1, 9, 9 }, - /* 40*/ { BARCODE_QRCODE, 1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 59, 0, 9, 9 }, - /* 41*/ { BARCODE_QRCODE, 1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 59, 1, 0, 0 }, - /* 42*/ { BARCODE_QRCODE, 1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 59, 1, 9, 11 }, - /* 43*/ { BARCODE_QRCODE, 1, 1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 63, 0, 0, 0 }, - /* 44*/ { BARCODE_QRCODE, 1, 1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 63, 1, 9, 13 }, - /* 45*/ { BARCODE_QRCODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 21, 21, 21, 42, 42, 1, 1, 1 }, - /* 46*/ { BARCODE_QRCODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 21, 21, 21, 42, 42, 0, 2, 2 }, - /* 47*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 1, 1 }, - /* 48*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 2, 2 }, - /* 49*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 180, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 41, 1 }, - /* 50*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 180, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 40, 2 }, - /* 51*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 0, 4, 4 }, - /* 52*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 1, 4, 14 }, - /* 53*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 270, 0, "A123", 0, 165, 33, 30, 298, 299, 1, 4, 4 }, - /* 54*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 270, 0, "A123", 0, 165, 33, 30, 298, 299, 0, 4, 14 }, - /* 55*/ { BARCODE_MAXICODE, -1, -1, 5, -1, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 0, 0, 0 }, - /* 56*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299, 298 + 50 * 2, 1, 0, 0 }, - /* 57*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299, 298 + 50 * 2, 0, 50, 0 }, - /* 58*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299, 298 + 50 * 2, 0, 347, 50 }, - /* 59*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299, 298 + 50 * 2, 1, 348, 50 }, - /* 60*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BOX, 0, 0, "A123", 0, 165, 33, 30, 299 + 50 * 2, 298 + 50 * 2, 1, 50, 0 }, - /* 61*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BOX, 0, 0, "A123", 0, 165, 33, 30, 299 + 50 * 2, 298 + 50 * 2, 0, 347, 50 }, - /* 62*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 1, 0, 14 }, - /* 63*/ { BARCODE_MAXICODE, 6, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299 + 60 * 2, 298, 0, 0, 14 }, - /* 64*/ { BARCODE_MAXICODE, 6, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299 + 60 * 2, 298, 0, 0, 47 }, - /* 65*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299 + 60 * 2, 298 + 50 * 2, 1, 0, 47 }, - /* 66*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299 + 60 * 2, 298 + 50 * 2, 0, 50, 0 }, - /* 67*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BOX, 0, 0, "A123", 0, 165, 33, 30, 299 + (60 + 50) * 2, 298 + 50 * 2, 1, 50, 0 }, - /* 68*/ { BARCODE_MAXICODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0, "A123", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1, -1, -1, -1, -1 }, - /* 69*/ { BARCODE_MAXICODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 0, 4, 4 }, - /* 70*/ { BARCODE_MAXICODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 1, 4, 14 }, - /* 71*/ { BARCODE_MAXICODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 270, 0, "A123", 0, 165, 33, 30, 298, 299, 1, 4, 4 }, - /* 72*/ { BARCODE_MAXICODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 270, 0, "A123", 0, 165, 33, 30, 298, 299, 0, 4, 14 }, - /* 73*/ { BARCODE_ITF14, -1, -1, -1, -1, 0, 0, "123", 0, 50, 1, 135, 330, 136, 1, 110, 0 }, - /* 74*/ { BARCODE_ITF14, -1, -1, -1, -1, 90, 0, "123", 0, 50, 1, 135, 136, 330, 1, 0, 110 }, - /* 75*/ { BARCODE_ITF14, -1, -1, 0, -1, 0, 0, "123", 0, 50, 1, 135, 330, 136, 1, 110, 0 }, - /* 76*/ { BARCODE_ITF14, -1, -1, 0, BARCODE_BOX, 0, 0, "123", 0, 50, 1, 135, 310, 116, 0, 100, 0 }, - /* 77*/ { BARCODE_ITF14, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "123", 0, 50, 1, 135, 330, 136, 1, 110, 0 }, - /* 78*/ { BARCODE_ITF14, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 90, 0, "123", 0, 50, 1, 135, 136, 330, 1, 0, 110 }, + /* 25*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BIND, 0, 0, "A123", 0, 21, 21, 21, 42, 54, 1, 6, 0 }, + /* 26*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BIND | BARCODE_QUIET_ZONES, 0, 0, "A123", 0, 21, 21, 21, 58, 70, 0, 6, 0 }, + /* 27*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BOX | BARCODE_QUIET_ZONES, 0, 0, "A123", 0, 21, 21, 21, 70, 70, 1, 6, 0 }, + /* 28*/ { BARCODE_QRCODE, -1, -1, -1, -1, 0, 0, "A123", 0, 21, 21, 21, 42, 42, 1, 0, 0 }, + /* 29*/ { BARCODE_QRCODE, 5, -1, -1, -1, 0, 0, "A123", 0, 21, 21, 21, 62, 42, 0, 0, 0 }, + /* 30*/ { BARCODE_QRCODE, 5, -1, 6, -1, 0, 0, "A123", 0, 21, 21, 21, 62, 42, 0, 0, 0 }, + /* 31*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND, 0, 0, "A123", 0, 21, 21, 21, 62, 66, 1, 0, 0 }, + /* 32*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND, 0, 0, "A123", 0, 21, 21, 21, 62, 66, 0, 12, 0 }, + /* 33*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BOX, 0, 0, "A123", 0, 21, 21, 21, 86, 66, 1, 12, 0 }, + /* 34*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND, 0, 0, "A123", 0, 21, 21, 21, 62, 66, 1, 12, 10 }, + /* 35*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND | BARCODE_QUIET_ZONES, 0, 0, "A123", 0, 21, 21, 21, 78, 82, 0, 12, 10 }, + /* 36*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND | BARCODE_QUIET_ZONES, 0, 0, "A123", 0, 21, 21, 21, 78, 82, 1, 20, 19 }, + /* 37*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BOX | BARCODE_QUIET_ZONES, 0, 0, "A123", 0, 21, 21, 21, 102, 82, 0, 20, 19 }, + /* 38*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 1, 1 }, + /* 39*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0.5, "A123", 0, 21, 21, 21, 43, 43, 1, 1, 1 }, // Scale 0.5 -> 1 + /* 40*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 2, 2 }, + /* 41*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 41, 1 }, + /* 42*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 40, 2 }, + /* 43*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 1, 1 }, + /* 44*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 2, 2 }, + /* 45*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_BIND | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 43, 59, 1, 2, 2 }, + /* 46*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 59, 59, 1, 9, 9 }, + /* 47*/ { BARCODE_QRCODE, 1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 59, 0, 9, 9 }, + /* 48*/ { BARCODE_QRCODE, 1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 59, 1, 0, 0 }, + /* 49*/ { BARCODE_QRCODE, 1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 59, 0, 8, 11 }, + /* 50*/ { BARCODE_QRCODE, 1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 59, 1, 9, 11 }, + /* 51*/ { BARCODE_QRCODE, 1, 1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 63, 0, 8, 11 }, + /* 52*/ { BARCODE_QRCODE, 1, 1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 63, 0, 9, 11 }, + /* 53*/ { BARCODE_QRCODE, 1, 1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, 0, 0, "A123", 0, 21, 21, 21, 63, 63, 1, 11, 11 }, + /* 54*/ { BARCODE_QRCODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 21, 21, 21, 42, 42, 1, 1, 1 }, + /* 55*/ { BARCODE_QRCODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 21, 21, 21, 42, 42, 0, 2, 2 }, + /* 56*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 1, 1 }, + /* 57*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 2, 2 }, + /* 58*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 180, 0, "A123", 0, 21, 21, 21, 43, 43, 1, 41, 1 }, + /* 59*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE | OUT_BUFFER_INTERMEDIATE, 180, 0, "A123", 0, 21, 21, 21, 43, 43, 0, 40, 2 }, + /* 60*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 0, 4, 4 }, + /* 61*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 1, 4, 14 }, + /* 62*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 270, 0, "A123", 0, 165, 33, 30, 298, 299, 1, 4, 4 }, + /* 63*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 270, 0, "A123", 0, 165, 33, 30, 298, 299, 0, 4, 14 }, + /* 64*/ { BARCODE_MAXICODE, -1, -1, 5, -1, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 0, 0, 0 }, + /* 65*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299, 298 + 50 * 2, 1, 0, 0 }, + /* 66*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299, 298 + 50 * 2, 0, 50, 0 }, + /* 67*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299, 298 + 50 * 2, 0, 347, 50 }, + /* 68*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299, 298 + 50 * 2, 1, 348, 50 }, + /* 69*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BOX, 0, 0, "A123", 0, 165, 33, 30, 299 + 50 * 2, 298 + 50 * 2, 1, 50, 0 }, + /* 70*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BOX, 0, 0, "A123", 0, 165, 33, 30, 299 + 50 * 2, 298 + 50 * 2, 0, 347, 50 }, + /* 71*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299, 298 + 50 * 2, 1, 50, 15 }, + /* 72*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND | BARCODE_QUIET_ZONES, 0, 0, "A123", 0, 165, 33, 30, 299 + 10 * 2, 298 + (50 + 10) * 2, 0, 50, 15 }, + /* 73*/ { BARCODE_MAXICODE, -1, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 1, 0, 14 }, + /* 74*/ { BARCODE_MAXICODE, 6, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299 + 60 * 2, 298, 0, 0, 14 }, + /* 75*/ { BARCODE_MAXICODE, 6, -1, -1, -1, 0, 0, "A123", 0, 165, 33, 30, 299 + 60 * 2, 298, 0, 0, 47 }, + /* 76*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299 + 60 * 2, 298 + 50 * 2, 1, 0, 47 }, + /* 77*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BIND, 0, 0, "A123", 0, 165, 33, 30, 299 + 60 * 2, 298 + 50 * 2, 0, 50, 0 }, + /* 78*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BOX, 0, 0, "A123", 0, 165, 33, 30, 299 + (60 + 50) * 2, 298 + 50 * 2, 1, 50, 0 }, + /* 79*/ { BARCODE_MAXICODE, -1, -1, -1, BARCODE_DOTTY_MODE, 0, 0, "A123", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1, -1, -1, -1, -1 }, + /* 80*/ { BARCODE_MAXICODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 0, 4, 4 }, + /* 81*/ { BARCODE_MAXICODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "A123", 0, 165, 33, 30, 299, 298, 1, 4, 14 }, + /* 82*/ { BARCODE_MAXICODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 270, 0, "A123", 0, 165, 33, 30, 298, 299, 1, 4, 4 }, + /* 83*/ { BARCODE_MAXICODE, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 270, 0, "A123", 0, 165, 33, 30, 298, 299, 0, 4, 14 }, + /* 84*/ { BARCODE_ITF14, -1, -1, -1, -1, 0, 0, "123", 0, 50, 1, 135, 330, 136, 1, 110, 0 }, + /* 85*/ { BARCODE_ITF14, -1, -1, -1, -1, 90, 0, "123", 0, 50, 1, 135, 136, 330, 1, 0, 110 }, + /* 86*/ { BARCODE_ITF14, -1, -1, 0, -1, 0, 0, "123", 0, 50, 1, 135, 330, 136, 1, 110, 0 }, + /* 87*/ { BARCODE_ITF14, -1, -1, 0, BARCODE_BOX, 0, 0, "123", 0, 50, 1, 135, 310, 116, 0, 100, 0 }, + /* 88*/ { BARCODE_ITF14, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 0, 0, "123", 0, 50, 1, 135, 330, 136, 1, 110, 0 }, + /* 89*/ { BARCODE_ITF14, -1, -1, -1, OUT_BUFFER_INTERMEDIATE, 90, 0, "123", 0, 50, 1, 135, 136, 330, 1, 0, 110 }, }; 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 acc357ab..ab283458 100644 --- a/backend/tests/test_vector.c +++ b/backend/tests/test_vector.c @@ -656,28 +656,36 @@ static void test_output_options(int index, int debug) { /* 18*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BIND, "A123", 0, 21, 21, 21, 42, 54, 1, 0, 6 }, /* 19*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BIND, "A123", 0, 21, 21, 21, 42, 54, 0, 22, 8 }, /* 20*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BOX, "A123", 0, 21, 21, 21, 54, 54, 1, 22, 8 }, - /* 21*/ { BARCODE_QRCODE, -1, -1, -1, -1, "A123", 0, 21, 21, 21, 42, 42, 0, 10, 12 }, - /* 22*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND, "A123", 0, 21, 21, 21, 62, 66, 1, 10, 12 }, - /* 23*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND, "A123", 0, 21, 21, 21, 62, 66, 0, 22, 12 }, - /* 24*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BOX, "A123", 0, 21, 21, 21, 86, 66, 1, 22, 12 }, - /* 25*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 42, 42, 0, 0, 50 }, - /* 26*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 42, 42, 0, 0, 50 }, - /* 27*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_BIND | BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 42, 58, 1, 0, 50 }, - /* 28*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_BIND | BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 42, 58, 0, 54, 8 }, - /* 29*/ { BARCODE_QRCODE, 1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 62, 58, 1, 54, 8 }, - /* 30*/ { BARCODE_MAXICODE, -1, -1, -1, -1, "A123", 0, 165, 33, 30, 60, 57.733398, 0, 0, 67.7334 }, - /* 31*/ { BARCODE_MAXICODE, -1, -1, 5, -1, "A123", 0, 165, 33, 30, 60, 57.733398, 0, 0, 67.7334 }, - /* 32*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, "A123", 0, 165, 33, 30, 60, 77.733398, 1, 0, 67.7334 }, - /* 33*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, "A123", 0, 165, 33, 30, 60, 77.733398, 0, 70, 10 }, - /* 34*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BOX, "A123", 0, 165, 33, 30, 80, 77.733398, 1, 70, 10 }, - /* 35*/ { BARCODE_MAXICODE, -1, -1, -1, -1, "A123", 0, 165, 33, 30, 60, 57.733398, 0, 0, 67.7334 }, - /* 36*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BIND, "A123", 0, 165, 33, 30, 84, 77.733398, 1, 0, 67.7334 }, - /* 37*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BIND, "A123", 0, 165, 33, 30, 84, 77.733398, 0, 94, 10 }, - /* 38*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BOX, "A123", 0, 165, 33, 30, 104, 77.733398, 1, 94, 10 }, - /* 39*/ { BARCODE_MAXICODE, -1, -1, -1, BARCODE_DOTTY_MODE, "A123", ZINT_ERROR_INVALID_OPTION, -1, -1, -1, -1, -1, -1, -1, -1 }, - /* 40*/ { BARCODE_ITF14, -1, -1, -1, -1, "123", 0, 50, 1, 135, 330, 138.89999, 1, 320, 10 }, - /* 41*/ { BARCODE_ITF14, -1, -1, 0, -1, "123", 0, 50, 1, 135, 330, 138.89999, 1, 320, 10 }, - /* 42*/ { BARCODE_ITF14, -1, -1, 0, BARCODE_BOX, "123", 0, 50, 1, 135, 310, 118.9, 0, 300, 0 }, // No zero-width/height rectangles + /* 21*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BIND | BARCODE_QUIET_ZONES, "A123", 0, 21, 21, 21, 58, 70, 0, 0, 6 }, + /* 22*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BIND | BARCODE_QUIET_ZONES, "A123", 0, 21, 21, 21, 58, 70, 1, 0, 0 }, + /* 23*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BOX | BARCODE_QUIET_ZONES, "A123", 0, 21, 21, 21, 70, 70, 0, 22, 8 }, + /* 24*/ { BARCODE_QRCODE, -1, -1, 3, BARCODE_BOX | BARCODE_QUIET_ZONES, "A123", 0, 21, 21, 21, 70, 70, 1, 30, 16 }, + /* 25*/ { BARCODE_QRCODE, -1, -1, -1, -1, "A123", 0, 21, 21, 21, 42, 42, 0, 10, 12 }, + /* 26*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND, "A123", 0, 21, 21, 21, 62, 66, 1, 10, 12 }, + /* 27*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND, "A123", 0, 21, 21, 21, 62, 66, 0, 22, 12 }, + /* 28*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BOX, "A123", 0, 21, 21, 21, 86, 66, 1, 22, 12 }, + /* 29*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND | BARCODE_QUIET_ZONES, "A123", 0, 21, 21, 21, 78, 82, 0, 10, 12 }, + /* 30*/ { BARCODE_QRCODE, 5, -1, 6, BARCODE_BIND | BARCODE_QUIET_ZONES, "A123", 0, 21, 21, 21, 78, 82, 1, 18, 20 }, + /* 31*/ { BARCODE_QRCODE, -1, -1, -1, BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 42, 42, 0, 0, 50 }, + /* 32*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 42, 42, 0, 0, 50 }, + /* 33*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_BIND | BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 42, 58, 1, 0, 50 }, + /* 34*/ { BARCODE_QRCODE, -1, -1, 4, BARCODE_BIND | BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 42, 58, 0, 54, 8 }, + /* 35*/ { BARCODE_QRCODE, 1, -1, 4, BARCODE_BOX | BARCODE_DOTTY_MODE, "A123", 0, 21, 21, 21, 62, 58, 1, 54, 8 }, + /* 36*/ { BARCODE_MAXICODE, -1, -1, -1, -1, "A123", 0, 165, 33, 30, 60, 57.733398, 0, 0, 67.7334 }, + /* 37*/ { BARCODE_MAXICODE, -1, -1, 5, -1, "A123", 0, 165, 33, 30, 60, 57.733398, 0, 0, 67.7334 }, + /* 38*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, "A123", 0, 165, 33, 30, 60, 77.733398, 1, 0, 67.7334 }, + /* 39*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND, "A123", 0, 165, 33, 30, 60, 77.733398, 0, 70, 10 }, + /* 40*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BOX, "A123", 0, 165, 33, 30, 80, 77.733398, 1, 70, 10 }, + /* 41*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND | BARCODE_QUIET_ZONES, "A123", 0, 165, 33, 30, 64, 81.733398, 0, 0, 67.7334 }, + /* 42*/ { BARCODE_MAXICODE, -1, -1, 5, BARCODE_BIND | BARCODE_QUIET_ZONES, "A123", 0, 165, 33, 30, 64, 81.733398, 1, 0, 71.7334 }, + /* 43*/ { BARCODE_MAXICODE, -1, -1, -1, -1, "A123", 0, 165, 33, 30, 60, 57.733398, 0, 0, 67.7334 }, + /* 44*/ { BARCODE_MAXICODE, 6, -1, 5, BARCODE_BIND, "A123", 0, 165, 33, 30, 84, 77.733398, 1, 0, 67.7334 }, + /* 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 }; int data_size = ARRAY_SIZE(data); int i, length, ret; diff --git a/backend/vector.c b/backend/vector.c index 193b8829..9900047b 100644 --- a/backend/vector.c +++ b/backend/vector.c @@ -878,42 +878,50 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_ } // Bind/box - if (symbol->border_width > 0) { - if (symbol->output_options & (BARCODE_BOX | BARCODE_BIND)) { - const float ybind_top = yoffset - symbol->border_width; - // Following equivalent to yoffset + symbol->height + dot_overspill except for BARCODE_MAXICODE - const float ybind_bot = vector->height - textoffset - boffset; - // Top - rect = vector_plot_create_rect(symbol, 0.0f, ybind_top, vector->width, symbol->border_width); - if (!rect) return ZINT_ERROR_MEMORY; - if (!(symbol->output_options & BARCODE_BOX) - && (symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF)) { - /* CodaBlockF bind - does not extend over horizontal whitespace */ - rect->x = xoffset; - rect->width -= xoffset + roffset; - } - vector_plot_add_rect(symbol, rect, &last_rectangle); - // Bottom - rect = vector_plot_create_rect(symbol, 0.0f, ybind_bot, vector->width, symbol->border_width); - if (!rect) return ZINT_ERROR_MEMORY; - if (!(symbol->output_options & BARCODE_BOX) - && (symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF)) { - /* CodaBlockF bind - does not extend over horizontal whitespace */ - rect->x = xoffset; - rect->width -= xoffset + roffset; - } - vector_plot_add_rect(symbol, rect, &last_rectangle); + if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))) { + const int horz_outside = is_fixed_ratio(symbol->symbology); + float ybind_top = yoffset - symbol->border_width; + // Following equivalent to yoffset + symbol->height + dot_overspill except for BARCODE_MAXICODE + float ybind_bot = vector->height - textoffset - boffset; + if (horz_outside) { + ybind_top = 0; + ybind_bot = vector->height - symbol->border_width; } + // Top + rect = vector_plot_create_rect(symbol, 0.0f, ybind_top, vector->width, symbol->border_width); + if (!rect) return ZINT_ERROR_MEMORY; + if (!(symbol->output_options & BARCODE_BOX) + && (symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF)) { + /* CodaBlockF bind - does not extend over horizontal whitespace */ + rect->x = xoffset; + rect->width -= xoffset + roffset; + } + vector_plot_add_rect(symbol, rect, &last_rectangle); + // Bottom + rect = vector_plot_create_rect(symbol, 0.0f, ybind_bot, vector->width, symbol->border_width); + if (!rect) return ZINT_ERROR_MEMORY; + if (!(symbol->output_options & BARCODE_BOX) + && (symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF)) { + /* CodaBlockF bind - does not extend over horizontal whitespace */ + rect->x = xoffset; + rect->width -= xoffset + roffset; + } + vector_plot_add_rect(symbol, rect, &last_rectangle); if (symbol->output_options & BARCODE_BOX) { const float xbox_right = vector->width - symbol->border_width; + float box_top = yoffset; // Following equivalent to symbol->height except for BARCODE_MAXICODE - const float box_height = vector->height - textoffset - dot_overspill - yoffset - boffset; + float box_height = vector->height - textoffset - dot_overspill - yoffset - boffset; + if (horz_outside) { + box_top = symbol->border_width; + box_height = vector->height - symbol->border_width * 2; + } // Left - rect = vector_plot_create_rect(symbol, 0.0f, yoffset, symbol->border_width, box_height); + rect = vector_plot_create_rect(symbol, 0.0f, box_top, symbol->border_width, box_height); if (!rect) return ZINT_ERROR_MEMORY; vector_plot_add_rect(symbol, rect, &last_rectangle); // Right - rect = vector_plot_create_rect(symbol, xbox_right, yoffset, symbol->border_width, box_height); + rect = vector_plot_create_rect(symbol, xbox_right, box_top, symbol->border_width, box_height); if (!rect) return ZINT_ERROR_MEMORY; vector_plot_add_rect(symbol, rect, &last_rectangle); } diff --git a/docs/manual.txt b/docs/manual.txt index d6e68538..409a1034 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -471,7 +471,7 @@ symbol by corrupting a scan if the scanning beam strays off the top or bottom of the symbol. Zint can also put a border right around the symbol and its horizontal whitespace with the --box option. -The width of the boundary or box can be specified using the --border switch. +The width of the boundary or box must be specified using the --border switch. For example: zint --box --border=10 -w 10 -d "This" @@ -480,6 +480,11 @@ gives a box with a width 10 times the X-dimension of the symbol. Note that when specifying a box, horizontal whitespace is usually required in order to create a quiet zone between the barcode and the sides of the box. +For linear symbols, horizontal boundary bars appear tight against the barcode, +inside any vertical whitespace (or text). For matrix symbols, however, where +they are decorative rather than functional, boundary bars appear outside any +whitespace. + Codablock-F, Code 16K and Code 49 always have boundary bars, and default to particular horizontal whitespace values. Special considerations apply to ITF-14 - see the specific section 6.1.2.6 for that symbology.