mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
- Add text_gap
option to allow adjustment of vertical gap between
barcode and text - EMF/EPS/SVG/GUI: ignore BOLD_TEXT for EAN/UPC - DAFT: up max to 250 chars - EMF/EPS/SVG: fix addon bars placement/length when text hidden - Qt backend: use `QFontMetrics::horizontalAdvance()` rather than `boundingRect()` to calc text width (seems to be more accurate) - library: make printf/sprintf() format arg always literal string - output: fix errtxt nos clash; use array for `out_upcean_split_text()` text parts - raster/vector: smallify addon text printing logic - frontend: warn if output file and direct options both given; add TODO note about `CommandLineToArgvW()` loading shell32.dll - manual: put HRT options in own section
This commit is contained in:
@ -115,7 +115,7 @@ static void types(void) {
|
||||
}
|
||||
|
||||
/* Output version information */
|
||||
static void version(int no_png) {
|
||||
static void version(const int no_png) {
|
||||
const char *no_png_lib = no_png ? " (no libpng)" : "";
|
||||
const int zint_version = ZBarcode_Version();
|
||||
const int version_major = zint_version / 10000;
|
||||
@ -136,7 +136,7 @@ static void version(int no_png) {
|
||||
}
|
||||
|
||||
/* Output usage information */
|
||||
static void usage(int no_png) {
|
||||
static void usage(const int no_png) {
|
||||
const char *no_png_type = no_png ? "" : "/PNG";
|
||||
const char *no_png_ext = no_png ? "gif" : "png";
|
||||
|
||||
@ -202,11 +202,12 @@ static void usage(int no_png) {
|
||||
" --square Force Data Matrix symbols to be square\n"
|
||||
" --structapp=I,C[,ID] Set Structured Append info (I index, C count)\n"
|
||||
" -t, --types Display table of barcode types\n", stdout);
|
||||
fputs( " --vers=NUMBER Set symbol version (size, check digits, other options)\n"
|
||||
fputs( " --textgap=NUMBER Adjust gap between barcode and HRT in multiples of X-dim\n"
|
||||
" --vers=NUMBER Set symbol version (size, check digits, other options)\n"
|
||||
" -v, --version Display Zint version\n"
|
||||
" --vwhitesp=NUMBER Set height of vertical whitespace in multiples of X-dim\n"
|
||||
" -w, --whitesp=NUMBER Set width of horizontal whitespace in multiples of X-dim\n"
|
||||
" --werror Convert all warnings into errors\n", stdout);
|
||||
" -w, --whitesp=NUMBER Set width of horizontal whitespace in multiples of X-dim\n", stdout);
|
||||
fputs( " --werror Convert all warnings into errors\n", stdout);
|
||||
}
|
||||
|
||||
/* Display supported ECI codes */
|
||||
@ -880,7 +881,7 @@ static int batch_process(struct zint_symbol *symbol, const char *filename, const
|
||||
}
|
||||
}
|
||||
|
||||
if (!strcmp(filename, "-")) {
|
||||
if (strcmp(filename, "-") == 0) {
|
||||
file = stdin;
|
||||
} else {
|
||||
file = fopen(filename, "rb");
|
||||
@ -1087,6 +1088,8 @@ static void win_free_args(void) {
|
||||
}
|
||||
|
||||
/* For Windows replace args with UTF-8 versions */
|
||||
/* TODO: using `CommandLineToArgvW()` causes shell32.dll to be loaded - replace with own version, see
|
||||
https://news.ycombinator.com/item?id=18596841 */
|
||||
static void win_args(int *p_argc, char ***p_argv) {
|
||||
int i;
|
||||
LPWSTR *szArgList = CommandLineToArgvW(GetCommandLineW(), &win_argc);
|
||||
@ -1148,7 +1151,6 @@ int main(int argc, char **argv) {
|
||||
int rows = 0;
|
||||
char filetype[4] = {0};
|
||||
int output_given = 0;
|
||||
int no_png;
|
||||
int png_refused;
|
||||
int val;
|
||||
int i;
|
||||
@ -1162,18 +1164,18 @@ int main(int argc, char **argv) {
|
||||
arg_opt *arg_opts = (arg_opt *) z_alloca(sizeof(arg_opt) * argc);
|
||||
int no_getopt_error = 1;
|
||||
|
||||
const int no_png = ZBarcode_NoPng();
|
||||
|
||||
if (argc == 1) {
|
||||
usage(no_png);
|
||||
exit(ZINT_ERROR_INVALID_DATA);
|
||||
}
|
||||
|
||||
my_symbol = ZBarcode_Create();
|
||||
if (!my_symbol) {
|
||||
fprintf(stderr, "Error 151: Memory failure\n");
|
||||
exit(ZINT_ERROR_MEMORY);
|
||||
}
|
||||
no_png = ZBarcode_NoPng();
|
||||
|
||||
if (argc == 1) {
|
||||
ZBarcode_Delete(my_symbol);
|
||||
usage(no_png);
|
||||
exit(ZINT_ERROR_INVALID_DATA);
|
||||
}
|
||||
my_symbol->input_mode = UNICODE_MODE;
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -1191,7 +1193,7 @@ int main(int argc, char **argv) {
|
||||
OPT_NOBACKGROUND, OPT_NOQUIETZONES, OPT_NOTEXT, OPT_PRIMARY, OPT_QUIETZONES,
|
||||
OPT_ROTATE, OPT_ROWS, OPT_SCALE, OPT_SCALEXDIM, OPT_SCMVV, OPT_SECURE,
|
||||
OPT_SEG1, OPT_SEG2, OPT_SEG3, OPT_SEG4, OPT_SEG5, OPT_SEG6, OPT_SEG7, OPT_SEG8, OPT_SEG9,
|
||||
OPT_SEPARATOR, OPT_SMALL, OPT_SQUARE, OPT_STRUCTAPP,
|
||||
OPT_SEPARATOR, OPT_SMALL, OPT_SQUARE, OPT_STRUCTAPP, OPT_TEXTGAP,
|
||||
OPT_VERBOSE, OPT_VERS, OPT_VWHITESP, OPT_WERROR
|
||||
};
|
||||
int option_index = 0;
|
||||
@ -1267,6 +1269,7 @@ int main(int argc, char **argv) {
|
||||
{"small", 0, NULL, OPT_SMALL},
|
||||
{"square", 0, NULL, OPT_SQUARE},
|
||||
{"structapp", 1, NULL, OPT_STRUCTAPP},
|
||||
{"textgap", 1, NULL, OPT_TEXTGAP},
|
||||
{"types", 0, NULL, 't'},
|
||||
{"verbose", 0, NULL, OPT_VERBOSE}, /* Currently undocumented, output some debug info */
|
||||
{"vers", 1, NULL, OPT_VERS},
|
||||
@ -1682,6 +1685,19 @@ int main(int argc, char **argv) {
|
||||
return do_exit(ZINT_ERROR_INVALID_OPTION);
|
||||
}
|
||||
break;
|
||||
case OPT_TEXTGAP:
|
||||
if (!validate_float(optarg, &float_opt, errbuf)) {
|
||||
fprintf(stderr, "Error 194: Invalid text gap floating point (%s)\n", errbuf);
|
||||
return do_exit(ZINT_ERROR_INVALID_OPTION);
|
||||
}
|
||||
if (float_opt >= 0.0f && float_opt <= 5.0f) {
|
||||
my_symbol->text_gap = float_opt;
|
||||
} else {
|
||||
fprintf(stderr, "Warning 195: Text gap '%g' out of range (0 to 5), ignoring\n", float_opt);
|
||||
fflush(stderr);
|
||||
warn_number = ZINT_WARN_INVALID_OPTION;
|
||||
}
|
||||
break;
|
||||
case OPT_VERBOSE:
|
||||
my_symbol->debug = 1;
|
||||
break;
|
||||
@ -1842,6 +1858,12 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (output_given && (my_symbol->output_options & BARCODE_STDOUT)) {
|
||||
my_symbol->output_options &= ~BARCODE_STDOUT;
|
||||
fprintf(stderr, "Warning 193: Output file given, ignoring '--direct' option\n");
|
||||
fflush(stderr);
|
||||
warn_number = ZINT_WARN_INVALID_OPTION;
|
||||
}
|
||||
if (batch_mode) {
|
||||
/* Take each line of text as a separate data set */
|
||||
if (data_arg_num > 1) {
|
||||
|
@ -774,6 +774,7 @@ static void test_checks(const testCtx *const p_ctx) {
|
||||
int border;
|
||||
int cols;
|
||||
double dotsize;
|
||||
double textgap;
|
||||
int eci;
|
||||
char *filetype;
|
||||
double height;
|
||||
@ -794,44 +795,46 @@ static void test_checks(const testCtx *const p_ctx) {
|
||||
};
|
||||
/* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */
|
||||
struct item data[] = {
|
||||
/* 0*/ { -2, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 139: Invalid add-on gap value (digits only)" },
|
||||
/* 1*/ { 6, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 140: Add-on gap out of range (7 to 12), ignoring" },
|
||||
/* 2*/ { 13, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 140: Add-on gap out of range (7 to 12), ignoring" },
|
||||
/* 3*/ { -1, -2, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 107: Invalid border width value (digits only)" },
|
||||
/* 4*/ { -1, 1001, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 108: Border width out of range (0 to 1000), ignoring" },
|
||||
/* 5*/ { -1, -1, -1, 12345678, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 181: Invalid dot radius floating point (integer part must be 7 digits maximum)" },
|
||||
/* 6*/ { -1, -1, -1, 0.009, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 106: Invalid dot radius value (less than 0.01), ignoring" },
|
||||
/* 7*/ { -1, -1, -2, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 131: Invalid columns value (digits only)" },
|
||||
/* 8*/ { -1, -1, 201, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 111: Number of columns out of range (1 to 200), ignoring" },
|
||||
/* 9*/ { -1, -1, -1, -1, -2, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 138: Invalid ECI value (digits only)" },
|
||||
/* 10*/ { -1, -1, -1, -1, 1000000, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 118: ECI code out of range (0 to 999999), ignoring" },
|
||||
/* 11*/ { -1, -1, -1, -1, -1, "jpg", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 142: File type 'jpg' not supported, ignoring" },
|
||||
/* 12*/ { -1, -1, -1, -1, -1, NULL, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 183: Invalid symbol height floating point (integer part must be digits only)" },
|
||||
/* 13*/ { -1, -1, -1, -1, -1, NULL, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height '0' out of range (0.5 to 2000), ignoring" },
|
||||
/* 14*/ { -1, -1, -1, -1, -1, NULL, 2001, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height '2001' out of range (0.5 to 2000), ignoring" },
|
||||
/* 15*/ { -1, -1, -1, -1, -1, NULL, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 182: Invalid guard bar descent floating point (integer part must be digits only)" },
|
||||
/* 16*/ { -1, -1, -1, -1, -1, NULL, -1, 50.1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 135: Guard bar descent '50.1' out of range (0 to 50), ignoring" },
|
||||
/* 17*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 148: Invalid mask value (digits only)" },
|
||||
/* 18*/ { -1, -1, -1, -1, -1, NULL, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 147: Mask value out of range (0 to 7), ignoring" },
|
||||
/* 19*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 116: Mode value out of range (0 to 6), ignoring" },
|
||||
/* 20*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, "Error 117: Invalid rotation value (digits only)" },
|
||||
/* 21*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 137: Invalid rotation parameter (0, 90, 180 or 270 only), ignoring" },
|
||||
/* 22*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, "Error 132: Invalid rows value (digits only)" },
|
||||
/* 23*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, "Warning 112: Number of rows out of range (1 to 90), ignoring" },
|
||||
/* 24*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, "Error 184: Invalid scale floating point (integer part must be digits only)" },
|
||||
/* 25*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, 0.49, -1, -1, -1, -1, -1, -1, "Warning 146: Scaling less than 0.5 will be set to 0.5 for 'gif' output" },
|
||||
/* 26*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, "Error 149: Invalid Structured Carrier Message version value (digits only)" },
|
||||
/* 27*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, 100, -1, -1, -1, -1, -1, "Warning 150: Structured Carrier Message version out of range (0 to 99), ignoring" },
|
||||
/* 28*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, "Error 134: Invalid ECC value (digits only)" },
|
||||
/* 29*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, "Warning 114: ECC level out of range (0 to 8), ignoring" },
|
||||
/* 30*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, "Error 128: Invalid separator value (digits only)" },
|
||||
/* 31*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, "Warning 127: Separator value out of range (0 to 4), ignoring" },
|
||||
/* 32*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, "Error 133: Invalid version value (digits only)" },
|
||||
/* 33*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1000, -1, -1, "Warning 113: Version value out of range (1 to 999), ignoring" },
|
||||
/* 34*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, "Error 153: Invalid vertical whitespace value '-2' (digits only)" },
|
||||
/* 35*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, -1, "Warning 154: Vertical whitespace value out of range (0 to 1000), ignoring" },
|
||||
/* 36*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, "Error 120: Invalid horizontal whitespace value '-2' (digits only)" },
|
||||
/* 37*/ { -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, "Warning 121: Horizontal whitespace value out of range (0 to 1000), ignoring" },
|
||||
/* 0*/ { -2, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 139: Invalid add-on gap value (digits only)" },
|
||||
/* 1*/ { 6, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 140: Add-on gap out of range (7 to 12), ignoring" },
|
||||
/* 2*/ { 13, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 140: Add-on gap out of range (7 to 12), ignoring" },
|
||||
/* 3*/ { -1, -2, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 107: Invalid border width value (digits only)" },
|
||||
/* 4*/ { -1, 1001, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 108: Border width out of range (0 to 1000), ignoring" },
|
||||
/* 5*/ { -1, -1, -1, -1, -0.5, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 194: Invalid text gap floating point (integer part must be digits only)" },
|
||||
/* 6*/ { -1, -1, -1, -1, 5.01, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 195: Text gap '5.01' out of range (0 to 5), ignoring" },
|
||||
/* 7*/ { -1, -1, -1, 12345678, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 181: Invalid dot radius floating point (integer part must be 7 digits maximum)" },
|
||||
/* 8*/ { -1, -1, -1, 0.009, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 106: Invalid dot radius value (less than 0.01), ignoring" },
|
||||
/* 9*/ { -1, -1, -2, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 131: Invalid columns value (digits only)" },
|
||||
/* 10*/ { -1, -1, 201, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 111: Number of columns out of range (1 to 200), ignoring" },
|
||||
/* 11*/ { -1, -1, -1, -1, -1, -2, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 138: Invalid ECI value (digits only)" },
|
||||
/* 12*/ { -1, -1, -1, -1, -1, 1000000, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 118: ECI code out of range (0 to 999999), ignoring" },
|
||||
/* 13*/ { -1, -1, -1, -1, -1, -1, "jpg", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 142: File type 'jpg' not supported, ignoring" },
|
||||
/* 14*/ { -1, -1, -1, -1, -1, -1, NULL, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 183: Invalid symbol height floating point (integer part must be digits only)" },
|
||||
/* 15*/ { -1, -1, -1, -1, -1, -1, NULL, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height '0' out of range (0.5 to 2000), ignoring" },
|
||||
/* 16*/ { -1, -1, -1, -1, -1, -1, NULL, 2001, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 110: Symbol height '2001' out of range (0.5 to 2000), ignoring" },
|
||||
/* 17*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 182: Invalid guard bar descent floating point (integer part must be digits only)" },
|
||||
/* 18*/ { -1, -1, -1, -1, -1, -1, NULL, -1, 50.1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 135: Guard bar descent '50.1' out of range (0 to 50), ignoring" },
|
||||
/* 19*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Error 148: Invalid mask value (digits only)" },
|
||||
/* 20*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 147: Mask value out of range (0 to 7), ignoring" },
|
||||
/* 21*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 116: Mode value out of range (0 to 6), ignoring" },
|
||||
/* 22*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, "Error 117: Invalid rotation value (digits only)" },
|
||||
/* 23*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, "Warning 137: Invalid rotation parameter (0, 90, 180 or 270 only), ignoring" },
|
||||
/* 24*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, "Error 132: Invalid rows value (digits only)" },
|
||||
/* 25*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, "Warning 112: Number of rows out of range (1 to 90), ignoring" },
|
||||
/* 26*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, "Error 184: Invalid scale floating point (integer part must be digits only)" },
|
||||
/* 27*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, 0.49, -1, -1, -1, -1, -1, -1, "Warning 146: Scaling less than 0.5 will be set to 0.5 for 'gif' output" },
|
||||
/* 28*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, "Error 149: Invalid Structured Carrier Message version value (digits only)" },
|
||||
/* 29*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, 100, -1, -1, -1, -1, -1, "Warning 150: Structured Carrier Message version out of range (0 to 99), ignoring" },
|
||||
/* 30*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, "Error 134: Invalid ECC value (digits only)" },
|
||||
/* 31*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, "Warning 114: ECC level out of range (0 to 8), ignoring" },
|
||||
/* 32*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, "Error 128: Invalid separator value (digits only)" },
|
||||
/* 33*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, "Warning 127: Separator value out of range (0 to 4), ignoring" },
|
||||
/* 34*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, "Error 133: Invalid version value (digits only)" },
|
||||
/* 35*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1000, -1, -1, "Warning 113: Version value out of range (1 to 999), ignoring" },
|
||||
/* 36*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, "Error 153: Invalid vertical whitespace value '-2' (digits only)" },
|
||||
/* 37*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, -1, "Warning 154: Vertical whitespace value out of range (0 to 1000), ignoring" },
|
||||
/* 38*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, "Error 120: Invalid horizontal whitespace value '-2' (digits only)" },
|
||||
/* 39*/ { -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1001, "Warning 121: Horizontal whitespace value out of range (0 to 1000), ignoring" },
|
||||
};
|
||||
int data_size = ARRAY_SIZE(data);
|
||||
int i;
|
||||
@ -855,6 +858,7 @@ static void test_checks(const testCtx *const p_ctx) {
|
||||
arg_int(cmd, "--border=", data[i].border);
|
||||
arg_int(cmd, "--cols=", data[i].cols);
|
||||
arg_double(cmd, "--dotsize=", data[i].dotsize);
|
||||
arg_double(cmd, "--textgap=", data[i].textgap);
|
||||
arg_int(cmd, "--eci=", data[i].eci);
|
||||
arg_data(cmd, "--filetype=", data[i].filetype);
|
||||
arg_double(cmd, "--height=", data[i].height);
|
||||
@ -1150,13 +1154,13 @@ static void test_other_opts(const testCtx *const p_ctx) {
|
||||
/* 0*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900", "", 0 },
|
||||
/* 1*/ { BARCODE_CODE128, "1", -1, " -bg=", "EF9900", "", 0 },
|
||||
/* 2*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900AA", "", 0 },
|
||||
/* 3*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 691: Malformed background RGB colour 'GF9900' (hexadecimal only)", 0 },
|
||||
/* 3*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 881: Malformed background RGB colour 'GF9900' (hexadecimal only)", 0 },
|
||||
/* 4*/ { BARCODE_CODE128, "1", -1, " --bgcolor=", "EF9900", "", 0 },
|
||||
/* 5*/ { BARCODE_CODE128, "1", -1, " --bgcolour=", "EF9900", "", 0 },
|
||||
/* 6*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000", "", 0 },
|
||||
/* 7*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "", 0 },
|
||||
/* 8*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 690: Malformed foreground RGB colour (6 or 8 characters only)", 0 },
|
||||
/* 9*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 691: Malformed foreground RGB colour '000000FG' (hexadecimal only)", 0 },
|
||||
/* 8*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 880: Malformed foreground RGB colour (6 or 8 characters only)", 0 },
|
||||
/* 9*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 881: Malformed foreground RGB colour '000000FG' (hexadecimal only)", 0 },
|
||||
/* 10*/ { BARCODE_CODE128, "1", -1, " --fg=", "0,0,0,100", "", 0 },
|
||||
/* 11*/ { BARCODE_CODE128, "1", -1, " --fgcolor=", "111111", "", 0 },
|
||||
/* 12*/ { BARCODE_CODE128, "1", -1, " --fgcolour=", "111111", "", 0 },
|
||||
|
Reference in New Issue
Block a user