CLI/Tcl: fix version check (need <= 999 for DAFT permille)

UPNQR: fix required binary mode using mode_preset
UPNQR: allow mask to be manually specified
GUI: use non-native QColorDialog on Unix also; no noEXE for CLI equivalent;
  add shortcuts for copy-to-clipboard and CLI equivalent
CLI: new --version option to print Zint version
This commit is contained in:
gitlost 2022-05-12 20:35:06 +01:00
parent f58c80e290
commit 9aae557cdc
24 changed files with 777 additions and 109 deletions

View file

@ -32,6 +32,7 @@
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include "common.h"
#include "output.h"
#include "font.h"
@ -44,11 +45,11 @@ INTERNAL int out_check_colour_options(struct zint_symbol *symbol) {
int bg_len = (int) strlen(symbol->bgcolour);
if ((fg_len != 6) && (fg_len != 8)) {
strcpy(symbol->errtxt, "651: Malformed foreground colour target");
strcpy(symbol->errtxt, "651: Malformed foreground colour (6 or 8 characters only)");
return ZINT_ERROR_INVALID_OPTION;
}
if ((bg_len != 6) && (bg_len != 8)) {
strcpy(symbol->errtxt, "652: Malformed background colour target");
strcpy(symbol->errtxt, "652: Malformed background colour (6 or 8 characters only)");
return ZINT_ERROR_INVALID_OPTION;
}
@ -56,12 +57,12 @@ INTERNAL int out_check_colour_options(struct zint_symbol *symbol) {
to_upper((unsigned char *) symbol->bgcolour, bg_len);
if (!is_sane(SSET_F, (unsigned char *) symbol->fgcolour, fg_len)) {
strcpy(symbol->errtxt, "653: Malformed foreground colour target");
sprintf(symbol->errtxt, "653: Malformed foreground colour '%s' (hexadecimal only)", symbol->fgcolour);
return ZINT_ERROR_INVALID_OPTION;
}
if (!is_sane(SSET_F, (unsigned char *) symbol->bgcolour, bg_len)) {
strcpy(symbol->errtxt, "654: Malformed background colour target");
sprintf(symbol->errtxt, "654: Malformed background colour '%s' (hexadecimal only)", symbol->bgcolour);
return ZINT_ERROR_INVALID_OPTION;
}