vector: make sure BIND_TOP trumps BIND/BOX always (fixes extraneous
whjitespace at bottom of CODABLOCKF/CODE16K/CODE49 if BIND_TOP set); add left/right fudge to guard whitespace placements so appear closer to edge for SVG/qzint (undone by EMF/EPS)
@ -91,29 +91,29 @@ static int emf_count_hexagons(const struct zint_symbol *symbol) {
|
||||
static int emf_count_strings(const struct zint_symbol *symbol, float *fsize, float *fsize2, int *halign_left,
|
||||
int *halign_right) {
|
||||
int strings = 0;
|
||||
const struct zint_vector_string *str;
|
||||
const struct zint_vector_string *string;
|
||||
|
||||
*fsize = *fsize2 = 0.0f;
|
||||
*halign_left = *halign_right = 0;
|
||||
|
||||
str = symbol->vector->strings;
|
||||
while (str) {
|
||||
string = symbol->vector->strings;
|
||||
while (string) {
|
||||
/* Allow 2 font sizes */
|
||||
if (*fsize == 0.0f) {
|
||||
*fsize = str->fsize;
|
||||
} else if (str->fsize != *fsize && *fsize2 == 0.0f) {
|
||||
*fsize2 = str->fsize;
|
||||
*fsize = string->fsize;
|
||||
} else if (string->fsize != *fsize && *fsize2 == 0.0f) {
|
||||
*fsize2 = string->fsize;
|
||||
}
|
||||
/* Only 3 haligns possible and centre align always assumed used */
|
||||
if (str->halign) { /* Left or right align */
|
||||
if (str->halign == 1) { /* Left align */
|
||||
*halign_left = str->halign;
|
||||
if (string->halign) { /* Left or right align */
|
||||
if (string->halign == 1) { /* Left align */
|
||||
*halign_left = string->halign;
|
||||
} else { /* Right align */
|
||||
*halign_right = str->halign;
|
||||
*halign_right = string->halign;
|
||||
}
|
||||
}
|
||||
strings++;
|
||||
str = str->next;
|
||||
string = string->next;
|
||||
}
|
||||
|
||||
return strings;
|
||||
@ -190,12 +190,13 @@ INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle) {
|
||||
|
||||
int draw_background = 1;
|
||||
int bold;
|
||||
const int upcean = is_upcean(symbol->symbology);
|
||||
const int output_to_stdout = symbol->output_options & BARCODE_STDOUT;
|
||||
|
||||
struct zint_vector_rect *rect;
|
||||
struct zint_vector_circle *circ;
|
||||
struct zint_vector_hexagon *hex;
|
||||
struct zint_vector_string *str;
|
||||
struct zint_vector_string *string;
|
||||
|
||||
/* Allow for up to 6 strings (current max 3 for UPC/EAN) */
|
||||
unsigned char *this_string[6];
|
||||
@ -617,24 +618,24 @@ INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle) {
|
||||
this_text = 0;
|
||||
/* Loop over font sizes so that they're grouped together, so only have to select font twice at most */
|
||||
for (i = 0, current_fsize = fsize; i < 2 && current_fsize; i++, current_fsize = fsize2) {
|
||||
str = symbol->vector->strings;
|
||||
string = symbol->vector->strings;
|
||||
current_halign = -1;
|
||||
while (str) {
|
||||
while (string) {
|
||||
int utfle_len;
|
||||
int bumped_len;
|
||||
if (str->fsize != current_fsize) {
|
||||
str = str->next;
|
||||
if (string->fsize != current_fsize) {
|
||||
string = string->next;
|
||||
continue;
|
||||
}
|
||||
text_fsizes[this_text] = str->fsize;
|
||||
text_haligns[this_text] = str->halign;
|
||||
text_fsizes[this_text] = string->fsize;
|
||||
text_haligns[this_text] = string->halign;
|
||||
if (text_haligns[this_text] != current_halign) {
|
||||
current_halign = text_haligns[this_text];
|
||||
bytecount += 12;
|
||||
recordcount++;
|
||||
}
|
||||
assert(str->length > 0);
|
||||
utfle_len = emf_utfle_length(str->text, str->length);
|
||||
assert(string->length > 0);
|
||||
utfle_len = emf_utfle_length(string->text, string->length);
|
||||
bumped_len = emf_bump_up(utfle_len);
|
||||
if (!(this_string[this_text] = (unsigned char *) malloc(bumped_len))) {
|
||||
for (i = 0; i < this_text; i++) {
|
||||
@ -653,8 +654,15 @@ INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle) {
|
||||
text[this_text].i_graphics_mode = 0x00000002; /* GM_ADVANCED */
|
||||
text[this_text].ex_scale = 1.0f;
|
||||
text[this_text].ey_scale = 1.0f;
|
||||
text[this_text].w_emr_text.reference.x = (int32_t) str->x;
|
||||
text[this_text].w_emr_text.reference.y = (int32_t) str->y;
|
||||
/* Unhack the guard whitespace `gws_left_fudge`/`gws_right_fudge` hack */
|
||||
if (upcean && string->halign == 1 && string->text[0] == '<') {
|
||||
text[this_text].w_emr_text.reference.x = 0;
|
||||
} else if (upcean && string->halign == 2 && string->text[0] == '>') {
|
||||
text[this_text].w_emr_text.reference.x = (int32_t) (symbol->vector->width - 1);
|
||||
} else {
|
||||
text[this_text].w_emr_text.reference.x = (int32_t) string->x;
|
||||
}
|
||||
text[this_text].w_emr_text.reference.y = (int32_t) string->y;
|
||||
text[this_text].w_emr_text.chars = utfle_len;
|
||||
text[this_text].w_emr_text.off_string = 76;
|
||||
text[this_text].w_emr_text.options = 0;
|
||||
@ -663,12 +671,12 @@ INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle) {
|
||||
text[this_text].w_emr_text.rectangle.right = 0xffffffff;
|
||||
text[this_text].w_emr_text.rectangle.bottom = 0xffffffff;
|
||||
text[this_text].w_emr_text.off_dx = 0;
|
||||
emf_utfle_copy(this_string[this_text], str->text, str->length);
|
||||
emf_utfle_copy(this_string[this_text], string->text, string->length);
|
||||
bytecount += 76 + bumped_len;
|
||||
recordcount++;
|
||||
|
||||
this_text++;
|
||||
str = str->next;
|
||||
string = string->next;
|
||||
}
|
||||
}
|
||||
/* Suppress clang-tidy clang-analyzer-core.UndefinedBinaryOperatorResult warning */
|
||||
|
@ -706,7 +706,7 @@ INTERNAL void out_set_whitespace_offsets(const struct zint_symbol *symbol, const
|
||||
*p_boffset = symbol->whitespace_height + qz_bottom;
|
||||
if (symbol->output_options & (BARCODE_BOX | BARCODE_BIND | BARCODE_BIND_TOP)) {
|
||||
*p_yoffset += symbol->border_width;
|
||||
if (symbol->output_options & (BARCODE_BOX | BARCODE_BIND)) {
|
||||
if (!(symbol->output_options & BARCODE_BIND_TOP)) { /* Trumps BARCODE_BOX & BARCODE_BIND */
|
||||
*p_boffset += symbol->border_width;
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +483,14 @@ INTERNAL int ps_plot(struct zint_symbol *symbol) {
|
||||
fputs(" scalefont setfont\n", feps);
|
||||
previous_fsize = string->fsize;
|
||||
}
|
||||
out_putsf(" ", 2, string->x, feps);
|
||||
/* Unhack the guard whitespace `gws_left_fudge`/`gws_right_fudge` hack */
|
||||
if (upcean && string->halign == 1 && string->text[0] == '<') {
|
||||
out_putsf(" ", 2, 0, feps);
|
||||
} else if (upcean && string->halign == 2 && string->text[0] == '>') {
|
||||
out_putsf(" ", 2, symbol->vector->width, feps);
|
||||
} else {
|
||||
out_putsf(" ", 2, string->x, feps);
|
||||
}
|
||||
out_putsf(" ", 2, symbol->vector->height - string->y, feps);
|
||||
fputs(" moveto\n", feps);
|
||||
if (string->rotation != 0) {
|
||||
|
@ -1176,8 +1176,9 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
|
||||
const int upcea_height_adj = ((UPCEAN_FONT_HEIGHT - UPCEAN_SMALL_FONT_HEIGHT) * si + 1) / 2;
|
||||
|
||||
int text_yposn = yoffset_si + symbol_height_si + (int) (symbol->text_gap * si);
|
||||
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))) {
|
||||
text_yposn += symbol->border_width * si; /* Note not needed for BARCODE_BIND_TOP */
|
||||
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))
|
||||
&& !(symbol->output_options & BARCODE_BIND_TOP)) { /* Trumps BARCODE_BOX & BARCODE_BIND */
|
||||
text_yposn += symbol->border_width * si;
|
||||
}
|
||||
|
||||
if (upceanflag == 6) { /* UPC-E */
|
||||
@ -1297,8 +1298,9 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
|
||||
unsigned char local_text[sizeof(symbol->text)] = {0};
|
||||
int text_xposn = (int) ((main_width / 2.0f) * si) + xoffset_si;
|
||||
int text_yposn = yoffset_si + symbol_height_si + (int) (symbol->text_gap * si);
|
||||
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))) {
|
||||
text_yposn += symbol->border_width * si; /* Note not needed for BARCODE_BIND_TOP */
|
||||
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))
|
||||
&& !(symbol->output_options & BARCODE_BIND_TOP)) { /* Trumps BARCODE_BOX & BARCODE_BIND */
|
||||
text_yposn += symbol->border_width * si;
|
||||
}
|
||||
to_iso8859_1(symbol->text, local_text);
|
||||
/* Put the human readable text at the bottom */
|
||||
|
@ -59,5 +59,6 @@ I 256 2 R
|
||||
246 102.4 moveto
|
||||
(12) stringwidth pop -2 div 0 rmoveto
|
||||
(12) show
|
||||
264 102.4 moveto
|
||||
276 102.4 moveto
|
||||
(>) stringwidth pop neg 0 rmoveto
|
||||
(>) show
|
||||
|
@ -49,5 +49,6 @@ I 192 6 R
|
||||
163 0.8 moveto
|
||||
(531000) stringwidth pop -2 div 0 rmoveto
|
||||
(531000) show
|
||||
214 0.8 moveto
|
||||
226 0.8 moveto
|
||||
(>) stringwidth pop neg 0 rmoveto
|
||||
(>) show
|
||||
|
@ -29,5 +29,6 @@ I 82 6 R
|
||||
47 102.4 moveto
|
||||
(98765) stringwidth pop -2 div 0 rmoveto
|
||||
(98765) show
|
||||
91.5 102.4 moveto
|
||||
104 102.4 moveto
|
||||
(>) stringwidth pop neg 0 rmoveto
|
||||
(>) show
|
||||
|
@ -32,8 +32,7 @@ I 128 2 R
|
||||
110 8 I 142 2 R
|
||||
146 2 R
|
||||
/Helvetica findfont 21.4 scalefont setfont
|
||||
12.5 0.8 moveto
|
||||
(<) stringwidth pop neg 0 rmoveto
|
||||
0 0.8 moveto
|
||||
(<) show
|
||||
49 0.8 moveto
|
||||
(9501) stringwidth pop -2 div 0 rmoveto
|
||||
@ -41,5 +40,6 @@ I 128 2 R
|
||||
113 0.8 moveto
|
||||
(2346) stringwidth pop -2 div 0 rmoveto
|
||||
(2346) show
|
||||
149.6 0.8 moveto
|
||||
162 0.8 moveto
|
||||
(>) stringwidth pop neg 0 rmoveto
|
||||
(>) show
|
||||
|
@ -64,5 +64,6 @@ I 254 2 R
|
||||
246 102.4 moveto
|
||||
(24) stringwidth pop -2 div 0 rmoveto
|
||||
(24) show
|
||||
263.6 102.4 moveto
|
||||
276 102.4 moveto
|
||||
(>) stringwidth pop neg 0 rmoveto
|
||||
(>) show
|
||||
|
@ -79,8 +79,9 @@ I 20 2 R
|
||||
(24) stringwidth pop -2 div 0 rmoveto
|
||||
(24) show
|
||||
grestore
|
||||
12.4 15.6 moveto
|
||||
276 15.6 moveto
|
||||
gsave
|
||||
180 rotate
|
||||
(>) stringwidth pop neg 0 rmoveto
|
||||
(>) show
|
||||
grestore
|
||||
|
@ -57,5 +57,6 @@ I 216 4 R
|
||||
182 102.4 moveto
|
||||
(12345) stringwidth pop -2 div 0 rmoveto
|
||||
(12345) show
|
||||
225.6 102.4 moveto
|
||||
238 102.4 moveto
|
||||
(>) stringwidth pop neg 0 rmoveto
|
||||
(>) show
|
||||
|
@ -57,5 +57,6 @@ I 216 4 R
|
||||
182 102.28 moveto
|
||||
(12345) stringwidth pop -2 div 0 rmoveto
|
||||
(12345) show
|
||||
225.6 102.28 moveto
|
||||
238 102.28 moveto
|
||||
(>) stringwidth pop neg 0 rmoveto
|
||||
(>) show
|
||||
|
@ -17,7 +17,7 @@
|
||||
<text x="246" y="15.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12
|
||||
</text>
|
||||
<text x="264" y="15.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="277" y="15.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@ -17,7 +17,7 @@
|
||||
<text x="274" y="15.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
54321
|
||||
</text>
|
||||
<text x="318" y="15.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="331" y="15.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@ -17,7 +17,7 @@
|
||||
<text x="246" y="43.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12
|
||||
</text>
|
||||
<text x="264" y="43.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="277" y="43.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@ -17,7 +17,7 @@
|
||||
<text x="274" y="43.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
54321
|
||||
</text>
|
||||
<text x="318" y="43.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="331" y="43.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
@ -14,7 +14,7 @@
|
||||
<text x="163" y="117.2" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
890128
|
||||
</text>
|
||||
<text x="214" y="117.2" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="227" y="117.2" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@ -14,7 +14,7 @@
|
||||
<text x="163" y="117.2" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
531000
|
||||
</text>
|
||||
<text x="214" y="117.2" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="227" y="117.2" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@ -15,7 +15,7 @@
|
||||
<text x="163" y="117.2" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
531000
|
||||
</text>
|
||||
<text x="214" y="117.2" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="227" y="117.2" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@ -8,7 +8,7 @@
|
||||
<text x="20" y="15.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12
|
||||
</text>
|
||||
<text x="37.5" y="15.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="51" y="15.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 701 B After Width: | Height: | Size: 697 B |
@ -8,7 +8,7 @@
|
||||
<text x="47" y="15.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12345
|
||||
</text>
|
||||
<text x="91.5" y="15.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="105" y="15.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 850 B After Width: | Height: | Size: 847 B |
@ -5,7 +5,7 @@
|
||||
<g id="barcode" fill="#000000">
|
||||
<rect x="0" y="0" width="212" height="118" fill="#FFFFFF"/>
|
||||
<path d="M14 0h2v110h-2ZM18 0h2v110h-2ZM24 0h4v100h-4ZM32 0h2v100h-2ZM38 0h2v100h-2ZM44 0h4v100h-4ZM50 0h8v100h-8ZM60 0h2v100h-2ZM64 0h2v100h-2ZM72 0h4v100h-4ZM78 0h2v110h-2ZM82 0h2v110h-2ZM86 0h2v100h-2ZM92 0h6v100h-6ZM100 0h2v100h-2ZM104 0h2v100h-2ZM114 0h2v100h-2ZM122 0h2v100h-2ZM128 0h6v100h-6ZM138 0h2v100h-2ZM142 0h2v110h-2ZM146 0h2v110h-2ZM162 18h2v92h-2ZM166 18h4v92h-4ZM174 18h4v92h-4ZM182 18h2v92h-2ZM186 18h2v92h-2ZM192 18h2v92h-2ZM198 18h4v92h-4Z"/>
|
||||
<text x="12.5" y="117.2" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="-1" y="117.2" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<
|
||||
</text>
|
||||
<text x="49" y="117.2" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
@ -17,7 +17,7 @@
|
||||
<text x="182" y="15.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12
|
||||
</text>
|
||||
<text x="199.6" y="15.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="213" y="15.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@ -5,7 +5,7 @@
|
||||
<g id="barcode" fill="#000000">
|
||||
<rect x="0" y="0" width="266" height="118" fill="#FFFFFF"/>
|
||||
<path d="M14 0h2v110h-2ZM18 0h2v110h-2ZM24 0h4v100h-4ZM32 0h2v100h-2ZM38 0h2v100h-2ZM44 0h4v100h-4ZM50 0h8v100h-8ZM60 0h2v100h-2ZM64 0h2v100h-2ZM72 0h4v100h-4ZM78 0h2v110h-2ZM82 0h2v110h-2ZM86 0h2v100h-2ZM92 0h6v100h-6ZM100 0h2v100h-2ZM104 0h2v100h-2ZM114 0h2v100h-2ZM122 0h2v100h-2ZM128 0h6v100h-6ZM138 0h2v100h-2ZM142 0h2v110h-2ZM146 0h2v110h-2ZM162 18h2v92h-2ZM166 18h4v92h-4ZM172 18h4v92h-4ZM180 18h4v92h-4ZM186 18h2v92h-2ZM192 18h2v92h-2ZM198 18h4v92h-4ZM204 18h2v92h-2ZM208 18h2v92h-2ZM218 18h2v92h-2ZM222 18h2v92h-2ZM226 18h2v92h-2ZM234 18h4v92h-4ZM240 18h2v92h-2ZM244 18h4v92h-4ZM254 18h2v92h-2Z"/>
|
||||
<text x="12.5" y="117.2" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="-1" y="117.2" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<
|
||||
</text>
|
||||
<text x="49" y="117.2" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
@ -17,7 +17,7 @@
|
||||
<text x="210" y="15.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12345
|
||||
</text>
|
||||
<text x="253.6" y="15.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="267" y="15.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@ -5,7 +5,7 @@
|
||||
<g id="barcode" fill="#000000">
|
||||
<rect x="0" y="0" width="212" height="118" fill="#FFFFFF"/>
|
||||
<path d="M6 0h2v4h-2ZM12 0h2v4h-2ZM20 0h10v4h-10ZM34 0h4v4h-4ZM40 0h2v16h-2ZM44 0h2v16h-2ZM50 0h4v4h-4ZM60 0h6v4h-6ZM72 0h2v4h-2ZM76 0h6v4h-6ZM86 0h4v4h-4ZM94 0h4v4h-4ZM104 0h2v4h-2ZM108 0h6v4h-6ZM116 0h2v4h-2ZM128 0h6v16h-6ZM136 0h2v16h-2ZM142 0h4v4h-4ZM148 0h2v16h-2ZM6 4h4v4h-4ZM12 4h12v4h-12ZM28 4h4v4h-4ZM34 4h2v4h-2ZM48 4h6v4h-6ZM60 4h4v4h-4ZM66 4h8v4h-8ZM78 4h2v4h-2ZM82 4h4v4h-4ZM94 4h8v4h-8ZM108 4h2v8h-2ZM114 4h8v4h-8ZM124 4h2v4h-2ZM140 4h6v4h-6ZM6 8h2v4h-2ZM16 8h2v4h-2ZM20 8h4v4h-4ZM34 8h4v8h-4ZM48 8h4v4h-4ZM60 8h2v4h-2ZM64 8h2v4h-2ZM68 8h10v4h-10ZM80 8h10v4h-10ZM94 8h6v4h-6ZM102 8h2v4h-2ZM118 8h6v4h-6ZM140 8h4v4h-4ZM6 12h8v4h-8ZM18 12h2v4h-2ZM26 12h4v4h-4ZM50 12h2v4h-2ZM60 12h4v4h-4ZM68 12h2v4h-2ZM74 12h10v4h-10ZM86 12h6v4h-6ZM94 12h2v4h-2ZM98 12h2v4h-2ZM104 12h10v4h-10ZM120 12h4v4h-4ZM140 12h2v4h-2ZM14 16h2v4h-2ZM146 16h2v4h-2ZM12 20h2v4h-2ZM148 20h2v4h-2ZM14 24h2v86h-2ZM146 24h2v86h-2ZM18 28h2v82h-2ZM26 28h2v72h-2ZM30 28h4v72h-4ZM36 28h4v72h-4ZM42 28h6v72h-6ZM50 28h6v72h-6ZM58 28h4v72h-4ZM64 28h2v72h-2ZM68 28h8v72h-8ZM78 28h2v82h-2ZM82 28h2v82h-2ZM86 28h2v72h-2ZM92 28h6v72h-6ZM100 28h2v72h-2ZM104 28h6v72h-6ZM114 28h2v72h-2ZM124 28h2v72h-2ZM128 28h6v72h-6ZM138 28h2v72h-2ZM142 28h2v82h-2ZM162 46h2v64h-2ZM166 46h4v64h-4ZM172 46h2v64h-2ZM176 46h8v64h-8ZM186 46h2v64h-2ZM190 46h6v64h-6ZM200 46h2v64h-2Z"/>
|
||||
<text x="12.5" y="117.2" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="-1" y="117.2" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<
|
||||
</text>
|
||||
<text x="49" y="117.2" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
@ -17,7 +17,7 @@
|
||||
<text x="182" y="43.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
65
|
||||
</text>
|
||||
<text x="199.6" y="43.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="213" y="43.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@ -5,7 +5,7 @@
|
||||
<g id="barcode" fill="#000000">
|
||||
<rect x="0" y="0" width="282" height="118" fill="#FFFFFF"/>
|
||||
<path d="M2 0h4v4h-4ZM10 0h6v8h-6ZM18 0h2v32h-2ZM22 0h6v4h-6ZM30 0h10v4h-10ZM42 0h6v4h-6ZM50 0h2v4h-2ZM56 0h2v32h-2ZM66 0h2v8h-2ZM70 0h4v4h-4ZM76 0h2v4h-2ZM88 0h2v4h-2ZM98 0h2v8h-2ZM106 0h2v4h-2ZM110 0h10v4h-10ZM122 0h4v8h-4ZM128 0h2v4h-2ZM134 0h8v4h-8ZM144 0h4v4h-4ZM152 0h6v8h-6ZM160 0h2v32h-2ZM164 0h2v32h-2ZM2 4h6v8h-6ZM22 4h4v8h-4ZM30 4h2v4h-2ZM34 4h6v4h-6ZM48 4h2v4h-2ZM72 4h2v28h-2ZM76 4h6v4h-6ZM86 4h2v4h-2ZM90 4h4v4h-4ZM110 4h6v4h-6ZM128 4h6v4h-6ZM136 4h2v4h-2ZM144 4h6v8h-6ZM12 8h4v8h-4ZM28 8h12v4h-12ZM44 8h4v4h-4ZM50 8h2v4h-2ZM66 8h4v4h-4ZM76 8h2v4h-2ZM80 8h2v4h-2ZM88 8h2v4h-2ZM92 8h8v4h-8ZM110 8h4v4h-4ZM118 8h2v4h-2ZM124 8h4v4h-4ZM130 8h12v4h-12ZM154 8h4v8h-4ZM2 12h8v8h-8ZM22 12h6v8h-6ZM30 12h4v8h-4ZM36 12h2v4h-2ZM46 12h4v4h-4ZM64 12h6v4h-6ZM76 12h4v4h-4ZM88 12h4v4h-4ZM94 12h4v4h-4ZM102 12h4v4h-4ZM110 12h6v4h-6ZM120 12h4v4h-4ZM126 12h2v4h-2ZM132 12h4v4h-4ZM144 12h8v8h-8ZM14 16h2v12h-2ZM36 16h6v4h-6ZM46 16h2v4h-2ZM64 16h4v4h-4ZM76 16h6v12h-6ZM84 16h6v4h-6ZM92 16h8v4h-8ZM104 16h2v4h-2ZM110 16h2v16h-2ZM114 16h2v4h-2ZM120 16h8v4h-8ZM136 16h2v4h-2ZM156 16h2v12h-2ZM2 20h6v4h-6ZM22 20h12v4h-12ZM36 20h2v4h-2ZM40 20h4v4h-4ZM50 20h2v4h-2ZM64 20h2v4h-2ZM86 20h2v4h-2ZM90 20h12v4h-12ZM104 20h4v4h-4ZM116 20h8v4h-8ZM132 20h4v4h-4ZM138 20h4v4h-4ZM144 20h6v4h-6ZM2 24h4v8h-4ZM22 24h8v4h-8ZM34 24h2v4h-2ZM42 24h2v4h-2ZM46 24h8v4h-8ZM62 24h4v4h-4ZM86 24h8v4h-8ZM98 24h4v4h-4ZM106 24h2v8h-2ZM116 24h6v4h-6ZM128 24h6v4h-6ZM138 24h2v4h-2ZM144 24h4v8h-4ZM12 28h4v4h-4ZM22 28h4v4h-4ZM30 28h4v4h-4ZM38 28h8v4h-8ZM48 28h2v4h-2ZM62 28h6v4h-6ZM76 28h10v4h-10ZM88 28h8v4h-8ZM98 28h6v4h-6ZM114 28h6v4h-6ZM124 28h12v4h-12ZM140 28h2v4h-2ZM154 28h4v4h-4ZM30 32h2v4h-2ZM162 32h2v4h-2ZM28 36h2v4h-2ZM164 36h2v4h-2ZM30 40h2v70h-2ZM162 40h2v70h-2ZM34 44h2v66h-2ZM42 44h2v56h-2ZM46 44h4v56h-4ZM52 44h4v56h-4ZM58 44h6v56h-6ZM66 44h6v56h-6ZM74 44h4v56h-4ZM80 44h2v56h-2ZM84 44h8v56h-8ZM94 44h2v66h-2ZM98 44h2v66h-2ZM102 44h2v56h-2ZM108 44h6v56h-6ZM116 44h2v56h-2ZM120 44h6v56h-6ZM130 44h2v56h-2ZM140 44h2v56h-2ZM144 44h6v56h-6ZM154 44h2v56h-2ZM158 44h2v66h-2ZM178 62h2v48h-2ZM182 62h4v48h-4ZM188 62h6v48h-6ZM196 62h4v48h-4ZM202 62h2v48h-2ZM208 62h6v48h-6ZM216 62h2v48h-2ZM220 62h2v48h-2ZM228 62h4v48h-4ZM234 62h2v48h-2ZM238 62h2v48h-2ZM242 62h4v48h-4ZM248 62h6v48h-6ZM256 62h2v48h-2ZM260 62h2v48h-2ZM270 62h2v48h-2Z"/>
|
||||
<text x="28.5" y="117.2" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="15" y="117.2" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<
|
||||
</text>
|
||||
<text x="65" y="117.2" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
@ -17,7 +17,7 @@
|
||||
<text x="226" y="59.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
74083
|
||||
</text>
|
||||
<text x="269.6" y="59.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="283" y="59.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@ -5,7 +5,7 @@
|
||||
<g id="barcode" fill="#000000">
|
||||
<rect x="0" y="0" width="162" height="118" fill="#FFFFFF"/>
|
||||
<path d="M14 0h2v110h-2ZM18 0h2v110h-2ZM26 0h2v100h-2ZM30 0h4v100h-4ZM36 0h4v100h-4ZM46 0h2v100h-2ZM54 0h4v100h-4ZM60 0h2v100h-2ZM66 0h4v100h-4ZM74 0h2v100h-2ZM78 0h2v110h-2ZM82 0h2v110h-2ZM86 0h4v100h-4ZM92 0h4v100h-4ZM100 0h2v100h-2ZM110 0h2v100h-2ZM114 0h2v100h-2ZM118 0h6v100h-6ZM128 0h2v100h-2ZM132 0h2v100h-2ZM142 0h2v110h-2ZM146 0h2v110h-2Z"/>
|
||||
<text x="12.5" y="117.2" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="-1" y="117.2" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<
|
||||
</text>
|
||||
<text x="49" y="117.2" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
@ -14,7 +14,7 @@
|
||||
<text x="113" y="117.2" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
2346
|
||||
</text>
|
||||
<text x="149.6" y="117.2" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="163" y="117.2" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@ -20,7 +20,7 @@
|
||||
<text x="246" y="15.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
24
|
||||
</text>
|
||||
<text x="263.6" y="15.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="277" y="15.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@ -20,7 +20,7 @@
|
||||
<text x="274" y="15.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12345
|
||||
</text>
|
||||
<text x="317.6" y="15.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="331" y="15.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@ -20,7 +20,7 @@
|
||||
<text x="246" y="39.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12
|
||||
</text>
|
||||
<text x="263.6" y="39.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="277" y="39.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@ -20,7 +20,7 @@
|
||||
<text x="274" y="43.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12121
|
||||
</text>
|
||||
<text x="317.6" y="43.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="331" y="43.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
@ -17,7 +17,7 @@
|
||||
<text x="154" y="15.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
12
|
||||
</text>
|
||||
<text x="171.6" y="15.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="185" y="15.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@ -17,7 +17,7 @@
|
||||
<text x="182" y="10.92" text-anchor="middle" font-family="OCRB, monospace" font-size="14">
|
||||
12345
|
||||
</text>
|
||||
<text x="225.6" y="10.92" text-anchor="start" font-family="OCRB, monospace" font-size="14">
|
||||
<text x="239" y="10.92" text-anchor="end" font-family="OCRB, monospace" font-size="14">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@ -17,7 +17,7 @@
|
||||
<text x="154" y="47.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
89
|
||||
</text>
|
||||
<text x="171.6" y="47.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="185" y="47.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
@ -17,7 +17,7 @@
|
||||
<text x="182" y="59.6" text-anchor="middle" font-family="OCRB, monospace" font-size="20">
|
||||
56789
|
||||
</text>
|
||||
<text x="225.6" y="59.6" text-anchor="start" font-family="OCRB, monospace" font-size="20">
|
||||
<text x="239" y="59.6" text-anchor="end" font-family="OCRB, monospace" font-size="20">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@ -231,6 +231,89 @@ static void test_quiet_zones(const testCtx *const p_ctx) {
|
||||
testFinish();
|
||||
}
|
||||
|
||||
static void test_set_whitespace_offsets(const testCtx *const p_ctx) {
|
||||
|
||||
struct item {
|
||||
int symbology;
|
||||
int whitespace_width;
|
||||
int whitespace_height;
|
||||
int border_width;
|
||||
int output_options;
|
||||
int hide_text;
|
||||
int comp_xoffset;
|
||||
float scaler;
|
||||
|
||||
float expected_xoffset;
|
||||
float expected_yoffset;
|
||||
float expected_roffset;
|
||||
float expected_boffset;
|
||||
float expected_qz_right;
|
||||
};
|
||||
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||
struct item data[] = {
|
||||
/* 0*/ { BARCODE_CODE128, 1, 0, 0, 0, 0, 0, 0.0f, /*expected*/ 1.0f, 0.0f, 1.0f, 0.0f, 0.0f },
|
||||
/* 1*/ { BARCODE_CODE128, 2, 0, 0, 0, 0, 0, 1.0f, /*expected*/ 2.0f, 0.0f, 2.0f, 0.0f, 0.0f },
|
||||
/* 2*/ { BARCODE_CODE128, 2, 3, 0, 0, 0, 0, 1.0f, /*expected*/ 2.0f, 3.0f, 2.0f, 3.0f, 0.0f },
|
||||
/* 3*/ { BARCODE_CODE128, 2, 3, 1, 0, 0, 0, 1.0f, /*expected*/ 2.0f, 3.0f, 2.0f, 3.0f, 0.0f },
|
||||
/* 4*/ { BARCODE_CODE128, 2, 3, 1, BARCODE_BIND, 0, 0, 1.0f, /*expected*/ 2.0f, 4.0f, 2.0f, 4.0f, 0.0f },
|
||||
/* 5*/ { BARCODE_CODE128, 2, 3, 1, BARCODE_BIND_TOP, 0, 0, 1.0f, /*expected*/ 2.0f, 4.0f, 2.0f, 3.0f, 0.0f },
|
||||
/* 6*/ { BARCODE_CODE128, 2, 3, 1, BARCODE_BIND_TOP | BARCODE_BIND, 0, 0, 1.0f, /*expected*/ 2.0f, 4.0f, 2.0f, 3.0f, 0.0f }, /* BIND_TOP wins */
|
||||
/* 7*/ { BARCODE_CODE128, 2, 3, 1, BARCODE_BOX, 0, 0, 1.0f, /*expected*/ 3.0f, 4.0f, 3.0f, 4.0f, 0.0f },
|
||||
/* 8*/ { BARCODE_CODE128, 2, 3, 1, BARCODE_BIND_TOP | BARCODE_BOX, 0, 0, 1.0f, /*expected*/ 3.0f, 4.0f, 3.0f, 3.0f, 0.0f }, /* BIND_TOP wins */
|
||||
/* 9*/ { BARCODE_CODE128, 2, 3, 1, BARCODE_BOX | BARCODE_BIND, 0, 0, 1.0f, /*expected*/ 3.0f, 4.0f, 3.0f, 4.0f, 0.0f }, /* BIND_BOX wins */
|
||||
/* 10*/ { BARCODE_CODE128, 2, 3, 1, BARCODE_BIND_TOP | BARCODE_BOX | BARCODE_BIND, 0, 0, 1.0f, /*expected*/ 3.0f, 4.0f, 3.0f, 3.0f, 0.0f }, /* BIND_TOP wins */
|
||||
/* 11*/ { BARCODE_CODE128, 2, 3, 1, BARCODE_BOX | BARCODE_QUIET_ZONES, 0, 0, 1.0f, /*expected*/ 13.0f, 4.0f, 13.0f, 4.0f, 10.0f },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i;
|
||||
struct zint_symbol symbol = {0};
|
||||
float xoffset, yoffset, roffset, boffset, qz_right;
|
||||
int xoffset_si, yoffset_si, roffset_si, boffset_si, qz_right_si;
|
||||
|
||||
testStart("test_set_whitespace_offsets");
|
||||
|
||||
for (i = 0; i < data_size; i++) {
|
||||
if (testContinue(p_ctx, i)) continue;
|
||||
|
||||
xoffset = yoffset = roffset = boffset = qz_right = 0.0f;
|
||||
xoffset_si = yoffset_si = roffset_si = boffset_si = qz_right_si = 0;
|
||||
|
||||
symbol.symbology = data[i].symbology;
|
||||
symbol.whitespace_width = data[i].whitespace_width;
|
||||
symbol.whitespace_height = data[i].whitespace_height;
|
||||
symbol.border_width = data[i].border_width;
|
||||
symbol.output_options = data[i].output_options;
|
||||
out_set_whitespace_offsets(&symbol, data[i].hide_text, data[i].comp_xoffset,
|
||||
&xoffset, &yoffset, &roffset, &boffset, &qz_right, data[i].scaler,
|
||||
&xoffset_si, &yoffset_si, &roffset_si, &boffset_si, &qz_right_si);
|
||||
assert_equal(xoffset, data[i].expected_xoffset, "i:%d xoffset %g != %g\n", i, xoffset, data[i].expected_xoffset);
|
||||
assert_equal(yoffset, data[i].expected_yoffset, "i:%d yoffset %g != %g\n", i, yoffset, data[i].expected_yoffset);
|
||||
assert_equal(roffset, data[i].expected_roffset, "i:%d roffset %g != %g\n", i, roffset, data[i].expected_roffset);
|
||||
assert_equal(boffset, data[i].expected_boffset, "i:%d boffset %g != %g\n", i, boffset, data[i].expected_boffset);
|
||||
assert_equal(qz_right, data[i].expected_qz_right, "i:%d qz_right %g != %g\n", i, qz_right, data[i].expected_qz_right);
|
||||
if (data[i].scaler) {
|
||||
int expected_xoffset_si = (int) (data[i].expected_xoffset * data[i].scaler);
|
||||
int expected_yoffset_si = (int) (data[i].expected_yoffset * data[i].scaler);
|
||||
int expected_roffset_si = (int) (data[i].expected_roffset * data[i].scaler);
|
||||
int expected_boffset_si = (int) (data[i].expected_boffset * data[i].scaler);
|
||||
int expected_qz_right_si = (int) (data[i].expected_qz_right * data[i].scaler);
|
||||
assert_equal(xoffset_si, expected_xoffset_si, "i:%d xoffset_si %d != %d\n", i, xoffset_si, expected_xoffset_si);
|
||||
assert_equal(yoffset_si, expected_yoffset_si, "i:%d yoffset_si %d != %d\n", i, yoffset_si, expected_yoffset_si);
|
||||
assert_equal(roffset_si, expected_roffset_si, "i:%d roffset_si %d != %d\n", i, roffset_si, expected_roffset_si);
|
||||
assert_equal(boffset_si, expected_boffset_si, "i:%d boffset_si %d != %d\n", i, boffset_si, expected_boffset_si);
|
||||
assert_equal(qz_right_si, expected_qz_right_si, "i:%d qz_right_si %d != %d\n", i, qz_right_si, expected_qz_right_si);
|
||||
} else {
|
||||
assert_zero(xoffset_si, "i:%d xoffset_si %d non-zero\n", i, xoffset_si);
|
||||
assert_zero(yoffset_si, "i:%d yoffset_si %d non-zero\n", i, yoffset_si);
|
||||
assert_zero(roffset_si, "i:%d roffset_si %d non-zero\n", i, roffset_si);
|
||||
assert_zero(boffset_si, "i:%d boffset_si %d non-zero\n", i, boffset_si);
|
||||
assert_zero(qz_right_si, "i:%d qz_right_si %d non-zero\n", i, qz_right_si);
|
||||
}
|
||||
}
|
||||
|
||||
testFinish();
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#define TEST_OUT_SEP '\\'
|
||||
#define TEST_OUT_SEP_STR "\\"
|
||||
@ -411,6 +494,7 @@ int main(int argc, char *argv[]) {
|
||||
{ "test_colour_get_rgb", test_colour_get_rgb },
|
||||
{ "test_colour_get_cmyk", test_colour_get_cmyk },
|
||||
{ "test_quiet_zones", test_quiet_zones },
|
||||
{ "test_set_whitespace_offsets", test_set_whitespace_offsets },
|
||||
{ "test_fopen", test_fopen },
|
||||
{ "test_out_putsf", test_out_putsf },
|
||||
};
|
||||
|
@ -936,6 +936,12 @@ static void test_output_options(const testCtx *const p_ctx) {
|
||||
/* 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 },
|
||||
/* 90*/ { BARCODE_CODABLOCKF, -1, -1, -1, -1, 0, 0, "A123", 0, 20, 2, 101, 242, 44, 1, 43, 24 },
|
||||
/* 91*/ { BARCODE_CODABLOCKF, -1, -1, -1, BARCODE_BIND_TOP, 0, 0, "A123", 0, 20, 2, 101, 242, 42, 0, 41, 24 },
|
||||
/* 92*/ { BARCODE_CODE16K, -1, -1, -1, -1, 0, 0, "A123", 0, 20, 2, 70, 162, 44, 1, 43, 0 },
|
||||
/* 93*/ { BARCODE_CODE16K, -1, -1, -1, BARCODE_BIND_TOP, 0, 0, "A123", 0, 20, 2, 70, 162, 42, 0, 41, 0 },
|
||||
/* 94*/ { BARCODE_CODE49, -1, -1, -1, -1, 0, 0, "A123", 0, 20, 2, 70, 162, 44, 1, 43, 0 },
|
||||
/* 95*/ { BARCODE_CODE49, -1, -1, -1, BARCODE_BIND_TOP, 0, 0, "A123", 0, 20, 2, 70, 162, 42, 0, 41, 0 },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i, length, ret;
|
||||
|
@ -919,22 +919,22 @@ static void test_upcean_hrt(const testCtx *const p_ctx) {
|
||||
struct item data[] = {
|
||||
/* 0*/ { BARCODE_EANX, -1, -1, "123456789012", 0, 50, 1, 95, 226, 118, 12.2, 117.2, -1, -1, 3 }, /* EAN-13 */
|
||||
/* 1*/ { BARCODE_EANX, 0, -1, "123456789012", 0, 50, 1, 95, 226, 110, -1, -1, -1, -1, 0 }, /* EAN-13 */
|
||||
/* 2*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "123456789012", 0, 50, 1, 95, 226, 118, 12.2, 117.2, 214, 117.2, 4 }, /* EAN-13 */
|
||||
/* 2*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "123456789012", 0, 50, 1, 95, 226, 118, 12.2, 117.2, 227, 117.2, 4 }, /* EAN-13 */
|
||||
/* 3*/ { BARCODE_EANX_CHK, -1, -1, "1234567890128", 0, 50, 1, 95, 226, 118, 12.2, 117.2, -1, -1, 3 }, /* EAN-13 */
|
||||
/* 4*/ { BARCODE_EANX_CHK, 0, -1, "1234567890128", 0, 50, 1, 95, 226, 110, -1, -1, -1, -1, 0 }, /* EAN-13 */
|
||||
/* 5*/ { BARCODE_EANX_CHK, -1, EANUPC_GUARD_WHITESPACE, "1234567890128", 0, 50, 1, 95, 226, 118, 12.2, 117.2, 214, 117.2, 4 }, /* EAN-13 */
|
||||
/* 5*/ { BARCODE_EANX_CHK, -1, EANUPC_GUARD_WHITESPACE, "1234567890128", 0, 50, 1, 95, 226, 118, 12.2, 117.2, 227, 117.2, 4 }, /* EAN-13 */
|
||||
/* 6*/ { BARCODE_ISBNX, -1, -1, "9784567890120", 0, 50, 1, 95, 226, 118, 12.2, 117.2, -1, -1, 3 },
|
||||
/* 7*/ { BARCODE_ISBNX, 0, -1, "9784567890120", 0, 50, 1, 95, 226, 110, -1, -1, -1, -1, 0 },
|
||||
/* 8*/ { BARCODE_ISBNX, -1, EANUPC_GUARD_WHITESPACE, "9784567890120", 0, 50, 1, 95, 226, 118, 12.2, 117.2, 214, 117.2, 4 },
|
||||
/* 8*/ { BARCODE_ISBNX, -1, EANUPC_GUARD_WHITESPACE, "9784567890120", 0, 50, 1, 95, 226, 118, 12.2, 117.2, 227, 117.2, 4 },
|
||||
/* 9*/ { BARCODE_EANX, -1, -1, "1234567", 0, 50, 1, 67, 162, 118, 49, 117.2, -1, -1, 2 }, /* EAN-8 */
|
||||
/* 10*/ { BARCODE_EANX, 0, -1, "1234567", 0, 50, 1, 67, 162, 110, -1, -1, -1, -1, 0 }, /* EAN-8 */
|
||||
/* 11*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "1234567", 0, 50, 1, 67, 162, 118, 49, 117.2, 12.5, 117.2, 4 }, /* EAN-8 */
|
||||
/* 11*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "1234567", 0, 50, 1, 67, 162, 118, 49, 117.2, -1, 117.2, 4 }, /* EAN-8 */
|
||||
/* 12*/ { BARCODE_EANX, -1, -1, "1234", 0, 50, 1, 47, 104, 118, 47, 15.6, -1, -1, 1 }, /* EAN-5 */
|
||||
/* 13*/ { BARCODE_EANX, 0, -1, "1234", 0, 50, 1, 47, 104, 100, -1, -1, -1, -1, 0 }, /* EAN-5 */
|
||||
/* 14*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "1234", 0, 50, 1, 47, 104, 118, 47, 15.6, 91.5, 15.6, 2 }, /* EAN-5 */
|
||||
/* 14*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "1234", 0, 50, 1, 47, 104, 118, 47, 15.6, 105, 15.6, 2 }, /* EAN-5 */
|
||||
/* 15*/ { BARCODE_EANX, -1, -1, "12", 0, 50, 1, 20, 50, 118, 20, 15.6, -1, -1, 1 }, /* EAN-2 */
|
||||
/* 16*/ { BARCODE_EANX, 0, -1, "12", 0, 50, 1, 20, 50, 100, -1, -1, -1, -1, 0 }, /* EAN-2 */
|
||||
/* 17*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "12", 0, 50, 1, 20, 50, 118, 20, 15.6, -1, -1, 2 }, /* EAN-2 */
|
||||
/* 17*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "12", 0, 50, 1, 20, 50, 118, 20, 15.6, 51, 15.6, 2 }, /* EAN-2 */
|
||||
/* 18*/ { BARCODE_UPCA, -1, -1, "12345678901", 0, 50, 1, 95, 226, 118, 8.7, 117.2, -1, -1, 4 },
|
||||
/* 19*/ { BARCODE_UPCA, 0, -1, "12345678901", 0, 50, 1, 95, 226, 110, -1, -1, -1, -1, 0 },
|
||||
/* 20*/ { BARCODE_UPCA, -1, EANUPC_GUARD_WHITESPACE, "12345678901", 0, 50, 1, 95, 226, 118, 8.7, 117.2, -1, -1, 4 },
|
||||
@ -952,31 +952,31 @@ static void test_upcean_hrt(const testCtx *const p_ctx) {
|
||||
/* 32*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "123456789012+12", 0, 50, 1, 122, 276.0, 118, 12.2, 117.2, 246, 15.6, 5 }, /* EAN-13 + EAN-2 */
|
||||
/* 33*/ { BARCODE_ISBNX, -1, -1, "9784567890120+12", 0, 50, 1, 122, 276.0, 118, 12.2, 117.2, 246, 15.6, 4 }, /* ISBN + EAN-2 */
|
||||
/* 34*/ { BARCODE_ISBNX, 0, -1, "9784567890120+12", 0, 50, 1, 122, 276.0, 110, -1, -1, -1, -1, 0 }, /* ISBN + EAN-2 */
|
||||
/* 35*/ { BARCODE_ISBNX, -1, EANUPC_GUARD_WHITESPACE, "9784567890120+12", 0, 50, 1, 122, 276.0, 118, 246, 15.6, 264, 15.6, 5 }, /* ISBN + EAN-2 */
|
||||
/* 35*/ { BARCODE_ISBNX, -1, EANUPC_GUARD_WHITESPACE, "9784567890120+12", 0, 50, 1, 122, 276.0, 118, 246, 15.6, 277, 15.6, 5 }, /* ISBN + EAN-2 */
|
||||
/* 36*/ { BARCODE_EANX, -1, -1, "123456789012+12345", 0, 50, 1, 149, 330.0, 118, 12.2, 117.2, 274, 15.6, 4 }, /* EAN-13 + EAN-5 */
|
||||
/* 37*/ { BARCODE_EANX, 0, -1, "123456789012+12345", 0, 50, 1, 149, 330.0, 110, -1, -1, -1, -1, 0 }, /* EAN-13 + EAN-5 */
|
||||
/* 38*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "123456789012+12345", 0, 50, 1, 149, 330.0, 118, 12.2, 117.2, 274, 15.6, 5 }, /* EAN-13 + EAN-5 */
|
||||
/* 39*/ { BARCODE_ISBNX, -1, -1, "9784567890120+12345", 0, 50, 1, 149, 330.0, 118, 12.2, 117.2, 274, 15.6, 4 }, /* ISBN + EAN-5 */
|
||||
/* 40*/ { BARCODE_ISBNX, 0, -1, "9784567890120+12345", 0, 50, 1, 149, 330.0, 110, -1, -1, -1, -1, 0 }, /* ISBN + EAN-5 */
|
||||
/* 41*/ { BARCODE_ISBNX, -1, EANUPC_GUARD_WHITESPACE, "9784567890120+12345", 0, 50, 1, 149, 330.0, 118, 274, 15.6, 318, 15.6, 5 }, /* ISBN + EAN-5 */
|
||||
/* 41*/ { BARCODE_ISBNX, -1, EANUPC_GUARD_WHITESPACE, "9784567890120+12345", 0, 50, 1, 149, 330.0, 118, 274, 15.6, 331, 15.6, 5 }, /* ISBN + EAN-5 */
|
||||
/* 42*/ { BARCODE_EANX, -1, -1, "1234567+12", 0, 50, 1, 94, 212, 118, 49, 117.2, 182, 15.6, 3 }, /* EAN-8 + EAN-2 */
|
||||
/* 43*/ { BARCODE_EANX, 0, -1, "1234567+12", 0, 50, 1, 94, 212, 110, -1, -1, -1, -1, 0 }, /* EAN-8 + EAN-2 */
|
||||
/* 44*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "1234567+12", 0, 50, 1, 94, 212, 118, 182, 15.6, 199.6, 15.6, 5 }, /* EAN-8 + EAN-2 */
|
||||
/* 44*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "1234567+12", 0, 50, 1, 94, 212, 118, 182, 15.6, 213, 15.6, 5 }, /* EAN-8 + EAN-2 */
|
||||
/* 45*/ { BARCODE_EANX, -1, -1, "1234567+12345", 0, 50, 1, 121, 266, 118, 49, 117.2, 210, 15.6, 3 }, /* EAN-8 + EAN-5 */
|
||||
/* 46*/ { BARCODE_EANX, 0, -1, "1234567+12345", 0, 50, 1, 121, 266, 110, -1, -1, -1, -1, 0 }, /* EAN-8 + EAN-5 */
|
||||
/* 47*/ { BARCODE_EANX, -1, EANUPC_GUARD_WHITESPACE, "1234567+12345", 0, 50, 1, 121, 266, 118, 210, 15.6, 210, 15.6, 5 }, /* EAN-8 + EAN-5 */
|
||||
/* 48*/ { BARCODE_UPCA, -1, -1, "12345678901+12", 0, 50, 1, 124, 276, 118, 8.7, 117.2, 246, 15.6, 5 },
|
||||
/* 49*/ { BARCODE_UPCA, 0, -1, "12345678901+12", 0, 50, 1, 124, 276, 110, -1, -1, -1, -1, 0 },
|
||||
/* 50*/ { BARCODE_UPCA, -1, EANUPC_GUARD_WHITESPACE, "12345678901+12", 0, 50, 1, 124, 276, 118, 8.7, 117.2, 263.6, 15.6, 6 },
|
||||
/* 50*/ { BARCODE_UPCA, -1, EANUPC_GUARD_WHITESPACE, "12345678901+12", 0, 50, 1, 124, 276, 118, 8.7, 117.2, 277, 15.6, 6 },
|
||||
/* 51*/ { BARCODE_UPCA, -1, -1, "12345678901+12345", 0, 50, 1, 151, 330, 118, 8.7, 117.2, 274, 15.6, 5 },
|
||||
/* 52*/ { BARCODE_UPCA, 0, -1, "12345678901+12345", 0, 50, 1, 151, 330, 110, -1, -1, -1, -1, 0 },
|
||||
/* 53*/ { BARCODE_UPCA, -1, EANUPC_GUARD_WHITESPACE, "12345678901+12345", 0, 50, 1, 151, 330, 118, 274, 15.6, 317.6, 15.6, 6 },
|
||||
/* 53*/ { BARCODE_UPCA, -1, EANUPC_GUARD_WHITESPACE, "12345678901+12345", 0, 50, 1, 151, 330, 118, 274, 15.6, 331, 15.6, 6 },
|
||||
/* 54*/ { BARCODE_UPCE, -1, -1, "1234567+12", 0, 50, 1, 78, 184.0, 118, 8.7, 117.2, 154, 15.6, 4 },
|
||||
/* 55*/ { BARCODE_UPCE, 0, -1, "1234567+12", 0, 50, 1, 78, 184.0, 110, -1, -1, -1, -1, 0 },
|
||||
/* 56*/ { BARCODE_UPCE, -1, EANUPC_GUARD_WHITESPACE, "1234567+12", 0, 50, 1, 78, 184.0, 118, 8.7, 117.2, 171.6, 15.6, 5 },
|
||||
/* 56*/ { BARCODE_UPCE, -1, EANUPC_GUARD_WHITESPACE, "1234567+12", 0, 50, 1, 78, 184.0, 118, 8.7, 117.2, 185, 15.6, 5 },
|
||||
/* 57*/ { BARCODE_UPCE, -1, -1, "1234567+12345", 0, 50, 1, 105, 238.0, 118, 8.7, 117.2, 182, 15.6, 4 },
|
||||
/* 58*/ { BARCODE_UPCE, 0, -1, "1234567+12345", 0, 50, 1, 105, 238.0, 110, -1, -1, -1, -1, 0 },
|
||||
/* 59*/ { BARCODE_UPCE, -1, EANUPC_GUARD_WHITESPACE, "1234567+12345", 0, 50, 1, 105, 238.0, 118, 182, 15.6, 225.6, 15.6, 5 },
|
||||
/* 59*/ { BARCODE_UPCE, -1, EANUPC_GUARD_WHITESPACE, "1234567+12345", 0, 50, 1, 105, 238.0, 118, 182, 15.6, 239, 15.6, 5 },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i, length, ret;
|
||||
@ -1278,6 +1278,12 @@ static void test_output_options(const testCtx *const p_ctx) {
|
||||
/* 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 */
|
||||
/* 51*/ { BARCODE_CODABLOCKF, -1, -1, -1, -1, "A123", 0, 20, 2, 101, 242, 44, 1, 20, 42 },
|
||||
/* 52*/ { BARCODE_CODABLOCKF, -1, -1, -1, BARCODE_BIND_TOP, "A123", 0, 20, 2, 101, 242, 42, 0, 20, 42 },
|
||||
/* 53*/ { BARCODE_CODE16K, -1, -1, -1, -1, "A123", 0, 20, 2, 70, 162, 44, 1, 0, 42 },
|
||||
/* 54*/ { BARCODE_CODE16K, -1, -1, -1, BARCODE_BIND_TOP, "A123", 0, 20, 2, 70, 162, 42, 0, 0, 42 },
|
||||
/* 55*/ { BARCODE_CODE49, -1, -1, -1, -1, "A123", 0, 20, 2, 70, 162, 44, 1, 0, 42 },
|
||||
/* 56*/ { BARCODE_CODE49, -1, -1, -1, BARCODE_BIND_TOP, "A123", 0, 20, 2, 70, 162, 42, 0, 0, 42 },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i, length, ret;
|
||||
|
@ -388,7 +388,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
int addon_len = 0;
|
||||
int addon_gap = 0;
|
||||
float addon_text_yposn = 0.0f;
|
||||
float xoffset, yoffset, roffset, boffset;
|
||||
float xoffset, yoffset, roffset, boffset, qz_right;
|
||||
float textoffset;
|
||||
int upceanflag = 0;
|
||||
int addon_latch = 0;
|
||||
@ -412,6 +412,8 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
float addon_row_yposn;
|
||||
float addon_row_height;
|
||||
int upcae_outside_font_height = 0; /* UPC-A/E outside digits font size */
|
||||
const float gws_left_fudge = 0.5f; /* These make the guard whitespaces appear closer to the edge for SVG/qzint */
|
||||
const float gws_right_fudge = 0.5f; /* (undone by EMF/EPS) */
|
||||
/* 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 */
|
||||
@ -473,7 +475,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
|
||||
hide_text = ((!symbol->show_hrt) || (ustrlen(symbol->text) == 0));
|
||||
|
||||
out_set_whitespace_offsets(symbol, hide_text, comp_xoffset, &xoffset, &yoffset, &roffset, &boffset, NULL,
|
||||
out_set_whitespace_offsets(symbol, hide_text, comp_xoffset, &xoffset, &yoffset, &roffset, &boffset, &qz_right,
|
||||
0 /*scaler*/, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
xoffset_comp = xoffset + comp_xoffset;
|
||||
@ -740,8 +742,9 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
if (upceanflag >= 6) { /* UPC-E, EAN-8, UPC-A, EAN-13 */
|
||||
|
||||
float text_yposn = yoffset + symbol->height + font_height + text_gap - antialias_fudge; /* Baseline */
|
||||
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))) {
|
||||
text_yposn += symbol->border_width; /* Note not needed for BARCODE_BIND_TOP */
|
||||
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))
|
||||
&& !(symbol->output_options & BARCODE_BIND_TOP)) { /* Trumps BARCODE_BOX & BARCODE_BIND */
|
||||
text_yposn += symbol->border_width;
|
||||
}
|
||||
|
||||
if (upceanflag == 6) { /* UPC-E */
|
||||
@ -763,20 +766,20 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
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_comp + addon_gap;
|
||||
text_xposn = symbol->width + gws_right_fudge + qz_right + xoffset;
|
||||
textwidth = 8.5f;
|
||||
if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn,
|
||||
font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (upceanflag == 8) { /* EAN-8 */
|
||||
float text_xposn;
|
||||
if (upcean_guard_whitespace) {
|
||||
text_xposn = -0.75f + xoffset_comp;
|
||||
text_xposn = -7.0f - gws_left_fudge + xoffset_comp;
|
||||
textwidth = 8.5f;
|
||||
if (!vector_add_string(symbol, (const unsigned char *) "<", 1, text_xposn, text_yposn,
|
||||
font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
}
|
||||
text_xposn = (17.0f + 0.5f) + xoffset_comp;
|
||||
textwidth = 4.0f * 8.5f;
|
||||
@ -791,16 +794,16 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
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_comp + addon_gap;
|
||||
text_xposn = symbol->width + gws_right_fudge + qz_right + xoffset;
|
||||
textwidth = 8.5f;
|
||||
if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn,
|
||||
font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
}
|
||||
} else if (upcean_guard_whitespace) {
|
||||
text_xposn = (68.0f - 0.2f) + xoffset_comp;
|
||||
text_xposn = symbol->width + gws_right_fudge + qz_right + xoffset;
|
||||
textwidth = 8.5f;
|
||||
if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, text_yposn,
|
||||
font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
}
|
||||
|
||||
} else if (upceanflag == 12) { /* UPC-A */
|
||||
@ -827,10 +830,10 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
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_comp + addon_gap;
|
||||
text_xposn = symbol->width + gws_right_fudge + qz_right + xoffset;
|
||||
textwidth = 8.5f;
|
||||
if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn,
|
||||
font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
@ -852,16 +855,16 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
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_comp + addon_gap;
|
||||
text_xposn = symbol->width + gws_right_fudge + qz_right + xoffset;
|
||||
textwidth = 8.5f;
|
||||
if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn,
|
||||
font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
}
|
||||
} else if (upcean_guard_whitespace) {
|
||||
text_xposn = 96.0f + xoffset_comp;
|
||||
text_xposn = symbol->width + gws_right_fudge + qz_right + xoffset;
|
||||
textwidth = 8.5f;
|
||||
if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, text_yposn,
|
||||
font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
@ -881,10 +884,10 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
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;
|
||||
text_xposn = symbol->width + gws_right_fudge + qz_right + xoffset;
|
||||
textwidth = 8.5f;
|
||||
if (!vector_add_string(symbol, (const unsigned char *) ">", 1, text_xposn, text_yposn,
|
||||
font_height, textwidth, 1 /*left align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
font_height, textwidth, 2 /*right align*/, &last_string)) return ZINT_ERROR_MEMORY;
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -892,8 +895,9 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
|
||||
float text_xposn = main_width / 2.0f + xoffset_comp;
|
||||
float text_yposn = yoffset + symbol->height + font_height + text_gap; /* Calculated to bottom of text */
|
||||
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 */
|
||||
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))
|
||||
&& !(symbol->output_options & BARCODE_BIND_TOP)) { /* Trumps BARCODE_BOX & BARCODE_BIND */
|
||||
text_yposn += symbol->border_width;
|
||||
}
|
||||
if (!vector_add_string(symbol, symbol->text, -1, text_xposn, text_yposn, font_height, symbol->width, 0,
|
||||
&last_string)) return ZINT_ERROR_MEMORY;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<g id="barcode" fill="#000000">
|
||||
<rect x="0" y="0" width="324" height="257" fill="#FFFFFF"/>
|
||||
<path d="M28 0h4v240.97h-4ZM36 0h4v240.97h-4ZM44 0h12v220.97h-12ZM60 0h8v220.97h-8ZM72 0h4v220.97h-4ZM88 0h8v220.97h-8ZM100 0h16v220.97h-16ZM120 0h4v220.97h-4ZM132 0h4v220.97h-4ZM144 0h8v220.97h-8ZM156 0h4v240.97h-4ZM164 0h4v240.97h-4ZM172 0h4v220.97h-4ZM192 0h4v220.97h-4ZM200 0h4v220.97h-4ZM208 0h4v220.97h-4ZM228 0h4v220.97h-4ZM240 0h12v220.97h-12ZM256 0h4v220.97h-4ZM264 0h12v220.97h-12ZM284 0h4v240.97h-4ZM292 0h4v240.97h-4Z"/>
|
||||
<text x="25" y="255.37" text-anchor="end" font-family="OCRB, monospace" font-size="40">
|
||||
<text x="-2" y="255.37" text-anchor="start" font-family="OCRB, monospace" font-size="40">
|
||||
<
|
||||
</text>
|
||||
<text x="98" y="255.37" text-anchor="middle" font-family="OCRB, monospace" font-size="40">
|
||||
@ -14,7 +14,7 @@
|
||||
<text x="226" y="255.37" text-anchor="middle" font-family="OCRB, monospace" font-size="40">
|
||||
3654
|
||||
</text>
|
||||
<text x="299.2" y="255.37" text-anchor="start" font-family="OCRB, monospace" font-size="40">
|
||||
<text x="326" y="255.37" text-anchor="end" font-family="OCRB, monospace" font-size="40">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -14,7 +14,7 @@
|
||||
<text x="326" y="311.37" text-anchor="middle" font-family="OCRB, monospace" font-size="40">
|
||||
055124
|
||||
</text>
|
||||
<text x="428" y="311.37" text-anchor="start" font-family="OCRB, monospace" font-size="40">
|
||||
<text x="454" y="311.37" text-anchor="end" font-family="OCRB, monospace" font-size="40">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -20,7 +20,7 @@
|
||||
<text x="548" y="31.2" text-anchor="middle" font-family="OCRB, monospace" font-size="40">
|
||||
12345
|
||||
</text>
|
||||
<text x="635.2" y="31.2" text-anchor="start" font-family="OCRB, monospace" font-size="40">
|
||||
<text x="662" y="31.2" text-anchor="end" font-family="OCRB, monospace" font-size="40">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@ -17,7 +17,7 @@
|
||||
<text x="308" y="31.2" text-anchor="middle" font-family="OCRB, monospace" font-size="40">
|
||||
12
|
||||
</text>
|
||||
<text x="343.2" y="31.2" text-anchor="start" font-family="OCRB, monospace" font-size="40">
|
||||
<text x="370" y="31.2" text-anchor="end" font-family="OCRB, monospace" font-size="40">
|
||||
>
|
||||
</text>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |