1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-20 03:17:12 +00:00

EAN/UPC: add quiet zone indicators option (API output_options

`EANUPC_GUARD_WHITESPACE`, CLI `--guardwhitespace`) (ticket #287)
EAN-2/EAN-5: HRT now at top instead of at bottom for standalones,
  following BWIPP
CLI: batch mode: don't close input if stdin
EAN/UPC: fix excess 1X to right of add-ons
Composites: fix excess whitespace; fix quiet zone calcs to allow
  for linear shifting
CLI: use own (Wine) version of `CommandLineToArgvW()` to avoid
  loading "shell32.dll"
Move "font.h" -> "raster_font.h"
EPS/SVG: use new `out_putsf()` func to output floats, avoiding
  trailing zeroes & locale dependency
EPS: simplify "TR" formula
SVG: change font from "Helvetica, sans serif" to "OCR-B, monospace";
  use single "<path>" instead of multiple "<rect>"s to draw boxes
  (reduces file size)
Add `EMBED_VECTOR_FONT` to `output_options` (CLI `--embedfont`) to
  enable embedding of font in vector output - currently only for
  SVG output of EAN/UPC
GUI: use "OCR-B" font for EAN/UPC and "Arimo" for all others (was
  "Helvetica" for both); paint background of screen preview light
  grey so as contrasts with whitespace and quiet zones
EMF: prefix funcs with `emf_`; simplify string `halign` handling
large: rename `large_int` -> `large_uint`
CODE128/common: move `c128_hrt_cpy_iso8859_1()` to
  `hrt_cpy_iso8859_1()` and add `ZINT_WARN_HRT_TRUNCATED` warning
  (for future use)
Various symbologies: replace `printf()` with `fputs()`
  (symbol->debug)
QRCODE: better assert(), removing a NOLINT (2 left)
CLI: add some more barcode synonyms for DBAR
common: various fiddlings
CMake: don't include png.c unless ZINT_USE_PNG (avoids clang
  warning)
This commit is contained in:
gitlost
2023-06-12 01:25:55 +01:00
parent 6d015d6a8f
commit 607e4ed33a
395 changed files with 11528 additions and 23016 deletions

View File

@@ -168,6 +168,8 @@
- Added -esc and -extraesc options
2023-02-10 GL
- Added -textgap option
2023-08-11 GL
- Added -guardwhitespace option
*/
#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
@@ -515,6 +517,7 @@ static const char help_message[] = "zint tcl(stub,obj) dll\n"
/* cli option --dump not supported */
/* cli option --ecinos not supported */
" -eci choice: ECI to use\n"
/* cli option --embedfont not supported (vector output only) */
" -esc bool: Process escape sequences in input data\n"
" -extraesc bool: Process symbology-specific escape sequences (Code 128 only)\n"
" -fast bool: use fast encodation (Data Matrix)\n"
@@ -527,6 +530,7 @@ static const char help_message[] = "zint tcl(stub,obj) dll\n"
" -gs1parens bool: for gs1, AIs enclosed in parentheses instead of square brackets\n"
" -gssep bool: for gs1, use gs as separator instead fnc1 (Datamatrix only)\n"
" -guarddescent double: Height of guard bar descent in modules (EAN/UPC only)\n"
" -guardwhitespace bool: add quiet zone indicators (EAN/UPC only)\n"
" -height double: Symbol height in modules\n"
" -heightperrow bool: treat height as per-row\n"
/* cli option --input not supported */
@@ -553,7 +557,7 @@ static const char help_message[] = "zint tcl(stub,obj) dll\n"
" -smalltext bool: tiny interpretation line font\n"
" -square bool: force Data Matrix symbols to be square\n"
" -structapp {index count ?id?}: set Structured Append info\n"
" -textgap double: gap between barcode and text\n"
" -textgap double: Gap between barcode and text\n"
/* cli option --types not supported */
" -vers integer: Symbology option\n"
/* cli option --version not supported */
@@ -788,7 +792,7 @@ static int Encode(Tcl_Interp *interp, int objc,
"-addongap", "-barcode", "-bg", "-bind", "-bindtop", "-bold", "-border", "-box",
"-cols", "-compliantheight", "-dmre", "-dotsize", "-dotty",
"-eci", "-esc", "-extraesc", "-fast", "-fg", "-format", "-fullmultibyte",
"-gs1nocheck", "-gs1parens", "-gssep", "-guarddescent",
"-gs1nocheck", "-gs1parens", "-gssep", "-guarddescent", "-guardwhitespace",
"-height", "-heightperrow", "-init", "-mask", "-mode",
"-nobackground", "-noquietzones", "-notext", "-primary", "-quietzones",
"-reverse", "-rotate", "-rows", "-scale", "-scalexdimdp", "-scmvv", "-secure",
@@ -800,7 +804,7 @@ static int Encode(Tcl_Interp *interp, int objc,
iAddonGap, iBarcode, iBG, iBind, iBindTop, iBold, iBorder, iBox,
iCols, iCompliantHeight, iDMRE, iDotSize, iDotty,
iECI, iEsc, iExtraEsc, iFast, iFG, iFormat, iFullMultiByte,
iGS1NoCheck, iGS1Parens, iGSSep, iGuardDescent,
iGS1NoCheck, iGS1Parens, iGSSep, iGuardDescent, iGuardWhitespace,
iHeight, iHeightPerRow, iInit, iMask, iMode,
iNoBackground, iNoQuietZones, iNoText, iPrimary, iQuietZones,
iReverse, iRotate, iRows, iScale, iScaleXdimDp, iSCMvv, iSecure,
@@ -836,6 +840,7 @@ static int Encode(Tcl_Interp *interp, int objc,
case iGS1NoCheck:
case iGS1Parens:
case iGSSep:
case iGuardWhitespace:
case iHeightPerRow:
case iInit:
case iNoBackground:
@@ -1061,6 +1066,13 @@ static int Encode(Tcl_Interp *interp, int objc,
my_symbol->eci = s_eci_number[ECIIndex];
}
break;
case iGuardWhitespace:
if (intValue) {
my_symbol->output_options |= EANUPC_GUARD_WHITESPACE;
} else {
my_symbol->output_options &= ~EANUPC_GUARD_WHITESPACE;
}
break;
case iHeightPerRow:
if (intValue) {
my_symbol->input_mode |= HEIGHTPERROW_MODE;