1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-05-01 11:45:29 +00:00
Commit Graph

79 Commits

Author SHA1 Message Date
gitlost
0a3ffc1dc2 AZTEC: add manual FNC1 support:
improve P/S vs P/L choice when have ECI;
  add ZINT_DEBUG_TEST dump
AUSPOST: allow variable length data input
DATAMATRIX: do `EXTRA_ESCAPE_MODE` processing up front & check have
  non-zero length afterwards;
  disallow `READER_INIT` and `EXTRA_ESCAPE_MODE`;
general: add new `z_zero_fill()` func & use;
  add new `z_extra_escape_position_fnc1()` helper;
  in `z_ct_set_seg_extra_escapes_eci` check position FNC1 whether
  or not have ECI
library: escape_char_process: note escaped backslash followed by
  caret by passes `EXTRA_ESCAPE_MODE` check
test suite: BWIPP: update to latest; support AUSPOST variants;
  process `EXTRA_ESCAPE_MODE` escaping up front
2026-04-27 01:02:25 +01:00
gitlost
b40393723f AUSPOST: support Null FCC (DPID all zeroes); TODO: BWIPP support
CODE128: properly fix not switching before FNC1 in 2nd position
  after alpha (commit [7b0767])
PLANET/KIX: adapt POSTNET to cater for both
general: use static strings to save a few bytes (start/stop in
  particular); various other code fiddles
postal: move tables into funcs
2026-04-22 21:25:16 +01:00
gitlost
7b076717f2 DATAMATRIX: add manual FNC1 support
CODE128: error on unrecognized extra escape sequences instead of
  just passing them thru;
  fix possible shifting before manual FNC1 in 2nd position
  after single alpha (otherwise won't be recognized as AIM)
  fix not removing manual FNC1 in 1st/2nd position from content
  segs (as implied by symbology identifier)
CLI: warn if both "--dmre" and "--square" given (as "--square"
  overwrites "--dmre")
common: new routines `z_isalpha()`, `z_extra_escapes()` and
  `z_ct_set_seg_extra_escapes_eci()`
library: new helper `supports_extra_escape_mode()`;
  fix some error_number dups
BWIPP: update to latest, and allow for removal of DBAR_LTD_CC RHS
  quiet zones & extra row when have add-on in EAN/UPC composites
test suite: fix BWIPP escaping
manual/man/tcl: update for DATAMATRIX manual FNC1 support
Windows: resource scripts: make more consistent (libzint, CLI, GUI)
win32/README: update with MSVC 2026
2026-04-18 22:55:52 +01:00
gitlost
f9a493522f DATAMATRIX: add new options DM_B256_START and DM_C40_START to
`options_3`, allowing forcing of Base 256 or C40 mode a la BWIPP
  for initial no. of characters specified in `option_1`, with 0
  meaning all (CLI "--dmb256=" and "--dmc40=", GUI also (apart
  from MAILMARK_2D, which may be added later);
  export masks `DM_B256_C40_START_MASK` & `DM_SQUARE_DMRE_MASK` in
  "zint.h"
ZBarcode_Encode_File: report filename (possibly truncated) in error
  message on failed open
GUI: uniquify some accelerators and add some child widget getter
  helpers to "mainwindow.cpp"
backend/DEVELOPER -> backend/README, with some expansion
debian/copyright: a few more fixes
BWIPP/pandoc: update to latest
tests/fuzz: adjust for new DATAMATRIX options
2026-03-30 21:25:22 +01:00
gitlost
df64a0f237 debian: updated using https://salsa.debian.org/debian/zint as
template, props Dmitry Smirnov (ticket #147, props John Crisp);
  TODO: enable building with the GS1 Syntax Engine;
  this involved auditing copyrights which prompted the next item
  re "tif.c" and will prompt the next next item "pdf417.c"
tif.c: replaced LZW compression with tree-based one due to
  "tif_lzw.h"'s original BSD-TAHOE license which has the equivalent
  of the "advertising clause", new implementation (which is much
  faster anyway) props Harald Kuhr and Bob Montgomery
pdf417.c: TODO: Replace all code adapted from "pdf417.frm" as it
  was released under GPL v2.0 or later
pdf417.h: replace unnecessary "pdf417.frm" references with ISO/IEC
  standard as 1st step re above, some expanded comments
general: Codablock-F -> Codablock F (i.e. lose hyphen)
cmake: frontend/frontend_qt: go back to only setting RPATH on macOS
  as not Debian compatible and it seems it's not a good idea on
  Linux anyway; TODO: check BSD + other Unixes
CLI/GUI: make "--verbose" option official and document
tools/gen_eci_sb_h.php/gen_eci_mb_h.php: add SPDX Unicode-3.0;
  update haible.de/bruno tarball info - "GB18030.TXT" no longer in
  "jdk-1.4.2/" so mention "libiconv-1.11/" version instead (same)
general: add various SPDXs and normalize some Copyrights
reedsol.c: malloced `logt`/`alog` tables int -> short (slight
  performance improvement)
aztec.c: add copyrights, some code fiddling
BWIPP: update to latest
2026-03-18 15:08:32 +00:00
gitlost
b3a3c0d3b4 AZTEC: use algorithm adapted from ZXing for optimized encodation
(ticket #347), props Frank Yellin and Rustam Abdullaev;
   also improve performance of `FAST_MODE`
DATAMATRIX: assert max size on `edges` will fit in unsigned short;
   use MASK for DMRE/SQUARE `option_3` setting
PDF417: assert max size on `edges` will fit in unsigned short
GUI: fix setting AZTEC size and ECC combos if not previously set
manual: fix not mentioning AZTEC re `FAST_MODE`;
  gs1 mode footnote: mention 3940's length; pandoc -> 3.9
test suite: DOTCODE: account for new BWIPP input length guard
2026-03-11 15:48:24 +00:00
gitlost
ee71a5cc56 manual: clarify API GS1 flags require GS1_MODE 2026-02-26 22:56:04 +00:00
gitlost
6dd216db85 Fix some typos; add _typos.toml 2026-02-26 22:35:25 +00:00
gitlost
0a8a79fa6c GS1: new GS1RAW_MODE (CLI "--gs1raw") and GS1 Syntax Engine
"Unbracketed AI" (caret) options for specifying GS1 input
  (ticket #350, props Mario Verbruggen)
DBAR_EXP_CC/DBAR_EXPSTK_CC: fix separator over finder patterns
  when linear part is greater than 4 codeblocks
general: left-over raw_text -> content_segs in comments;
  update & expand some GS1 General Specs refs;
  some minor code fiddling
test suite: suppress some additional ZINT_SANITIZEM false positives
  (& add new ZINT_TESTUTIL_SANITIZEM_INIT helpers)
2026-02-26 15:05:45 +00:00
gitlost
bcb3ceefe1 AZTEC: add almost optimal encoding algorithm, previous algorithm
available via "--fast" (input_mode |= FAST_MODE) (ticket #347);
  add new option "--azfull" (option_3 = ZINT_AZTEC_FULL) to only
  consider Full symbols (not Compact ones) on automatic sizing
GUI: adjust Aztec tab to show feedback by selecting combos and
  shorten message to just actual ECC;
  grpCodabar min width
library: debug source input dump 200 -> 2000
common: some code fiddling (c -> ch, flg -> flag)
backend_tcl: add "-azfull" option & make capitalization of
  help more consistent
general: remove some trailing whitespace
manual: make Aztec ECCs more precise, i.e. ">=" rather than ">"
  (similarly in GUI)
CLI: code fiddling c -> opt
2026-02-02 14:20:10 +00:00
gitlost
a3f6c75bc0 CLI: add ZINT_TEST-only "--test" option (currently just ensures
the barcode name table is sorted so binary chop works), adding
  `ZINT_HAVE_GS1SE` define to "zint_add_test.cmake" - allows
  `test_barcode_symbology()` in "test_args.c" to be a lot less
  verbose; `const`-up various variables;
manual: use better MAILMAKE_4S example data and mention special
  fixed string international destination
2025-12-26 18:22:48 +00:00
gitlost
b2ad19a455 Bump to version 2.16.0.9 (dev) 2025-12-19 20:36:40 +00:00
gitlost
55541e139e Version 2.16.0 2025-12-19 19:42:13 +00:00
gitlost
2ac0e508b8 GS1: update to latest gs1-syntax-dictionary (new AIs 717
(GSCN 25-199) and 8040-3 (GSCN 25-047)
manual: fix grammar "chose" -> "choose"
win32/README: add missing "of"
pandoc: update to latest
bwipp: update to latest
testcommon: allow for GS1PARENS_MODE now implying ESCAPE_MODE;
  allow for `input_mode` option `GS1SYNTAXENGINE_MODE`
CI: freebsd: use latest version 1
2025-12-09 16:43:57 +00:00
gitlost
f0c7248b62 general: raw_segs -> content_segs, BARCODE_RAW_TEXT ->
`BARCODE_CONTENT_SEGS`, `z_rt_XXX()` -> `z_ct_XXX()`;
  move `encoded_data`/`row_height` to end of `zint_symbol`
  (see ZXing-C++ issue #883)
manual: update re `content_segs`; `my_symbol` -> `symbol`;
  improve MicroPDF417 description
2025-11-04 23:02:10 +00:00
gitlost
543696cb06 ECI: ECI 899 binary in UNICODE_MODE now converted from UTF-8,
not treated literally as it was before, which was inconsistent
  (literal interpretation now requires `DATA_MODE`)
2025-10-16 18:23:48 +01:00
gitlost
dc4ba75eb0 manual: use modified "haddock.theme" for nicer syntax highlighting;
use `tcolorbox` instead of `framed` for latex code blocks, works
  much better, especially as now when using a background colour;
  reduce gap after figures and force footnotes to bottom of page;
  move most symbology figures to after some text to lessen chance
  of subsection headers being orphaned on their own at end of page:
  required a number of rewordings;
  use named barcodes in example commands, rather than numbered;
  fix "lua-crossrefs" filter to allow parentheses around
  references;
  various other fixes and rephrasings
2025-10-12 22:17:14 +01:00
gitlost
a3cca33f32 general: suppress clang-tidy-21/22 warnings;
some code fiddling on affected files
manual: use new lua filter "lua-crossrefs.lua" hacked from
  https://github.com/rnwst/pandoc-lua-crossrefs as replacement for
  tablenos which broke with pandoc 2.8.2 (get nicer output anyway);
  fix "excode39.svg" data $ -> # to avoid shell processing;
  document `ZBarcode_HaveGS1SyntaxEngine()`
2025-10-08 12:21:29 +01:00
gitlost
55e89ae01f CI: Windows: try installing zlib 2025-09-16 11:04:36 +01:00
gitlost
5138d0703c CLI: --gs1XXX args now imply `--gs1
GUI: fix chkGS1Strict enabling on startup regression from previous
  commit; update CLI equivalence with --gs1strict & adjust for
  implied --gs1; add tests
CMake: allow lpng/zlib and gs1encoders to take paths (for Windows)
win32/README: simplify locating lpng/zlib/gs1encoders for cmake
  using above; add note on 64-bit build
manual/man page: adjust for various above changes
2025-09-16 10:10:30 +01:00
gitlost
0650d5798e Integrate GS1 Syntax Engine 2025-09-12 04:20:55 +01:00
gitlost
ad95d8f2b0 general: fix some typos using https://github.com/crate-ci/typos
(see gs1-syntax-engine PR #15, props Viktor Szépe)
2025-09-07 17:40:43 +01:00
gitlost
9b4d097516 RAW_TEXT: change source to be unconverted, i.e. UTF-8 (unless
`DATA_MODE`); allows ZXing-C++ to be built in writer-only mode
  without needing "libzueci"
library: in GS1 mode check that ECI if any is ASCII compatible
general: some code fiddling, `mode` -> `modes`
2025-09-05 17:23:18 +01:00
gitlost
44e2099a65 library: use "filemem" for TXT dump_plot() -> txt_hex_plot()
filemem: remove NOLINTS (clang-tidy-20 bug fixed)
QRCODE: eliminate NOLINTs using some more asserts (clang-tidy-20);
  some "de-branching" of loops
general: various code fiddlings, in particular lessen no. of
  redundant parenthesized expressions, especially in conditionals,
  which reduce rather than aid readibility IMNSHO
manual: mention "--dump" option
2025-08-28 20:34:56 +01:00
gitlost
fcb3f9b422 GS1PARENS_MODE: allow parentheses in AI data if backslashed and
in `ESCAPE_MODE`
composite: empty primary now returns `ZINT_ERROR_INVALID_DATA`
  rather than `ZINT_ERROR_INVALID_OPTION`;
  check that primary NUL-terminated
library: check that `outfile` NUL-terminated
gs1: preface all routines and linters with "gs1_"
general: some code fiddling
2025-04-24 18:40:50 +01:00
gitlost
51ebca182c Re commit [789e04] and [86363f] allow prefixes without check digit 2025-04-21 18:45:23 +01:00
gitlost
3592edd64e - Add new symbologies BARCODE_EAN8, BARCODE_EAN_2ADDON,
`BARCODE_EAN_5ADDON`, `BARCODE_EAN13`, `BARCODE_EAN8_CC` and
  `BARCODE_EAN13_CC` as replacements for `BARCODE_EANX`,
  `BARCODE_EANX_CHK` and `BARCODE_EANX_CC` and use in CLI/GUI
  (`BARCODE_EANX` etc. marked as legacy)
- For EAN/UPC accept space as alternative add-on separator to '+',
  and accept GTIN-13 format with & without 2-digit or 5-digit
  add-on (no separator)
- Buffer length of member `errtxt` in `zint_symbol` extended 100
  -> 160 (will be sufficient for eventual translation and
  gs1-syntax-dictionary errors hopefully)
- UPC-E: warn if first digit of 7 (or 8 if check digit given) not
  '0' or '1'
- manual: update for new EAN symbologies and mention EANX now
  legacy but still supported
2025-04-16 22:26:43 +01:00
gitlost
26805338f8 RAW_TEXT: expand UPC-A, UPC-E to EAN-13, and EAN-8 if has add-on,
and place any add-on data directly after (no separator)
EAN-8 + add-on: warn as non-compliant (see ZXing-C++ issue #883,
  https://github.com/zxing-cpp/zxing-cpp/issues/883)
test suite: BWIPP: use new EAN-8 + add-on option "permitaddon";
  fix dumps of RAW_TEXT `memcmp()`s fails; various re-formatting
bwipp_dump.ps: update to latest BWIPP
2025-04-11 13:02:59 +01:00
gitlost
182c84fa4d MAILMARK_2D: fix postcode validation: no limited alphanumerics,
spaced-out DPS "outward"-only allowed, all-blank DPS allowed
  (ticket #334, props Milton Neal)
2025-04-09 00:10:51 +01:00
gitlost
86363ff0f7 ITF-14/EAN-14/NVE-18: allow check digit to be given and then
verified;
  allow and ignore prefixes "01", "[01]" and "(01)" (or "00" etc
  if NVE-18) if check digit given, following commit [789e04]
  (ticket #333)
2025-04-07 17:25:44 +01:00
gitlost
a74871a7de - CODABLOCKF: fix misencodation of extended ASCII 0xB0-0xB9 when
followed by digit (ignore 2nd byte of FNC4 when categorizing
  Code C characters)
- New `ZBarcode_Cap()` flag `ZINT_CAP_BINDABLE`, differentiated
  from `ZINT_CAP_STACKABLE`, and new Qt Backend method
  `isBindable()`
- CLI: fix `separator` check to use new `ZINT_CAP_BINDABLE` instead
  of `ZINT_CAP_STACKABLE`
- ZBarcode_Cap: add missing symbologies to `ZINT_CAP_BINDABLE` (was
  `ZINT_CAP_STACKABLE`)
- DOTCODE: pad rows if given number of columns instead of failing
  if rows below min (5)
- DBAR/composites: ensure stacked symbologies and composites are
  not stacked (set `symbol->rows` to 0)
- test suite: move `test_perf` routines into single test
  "test_perf";
  new "test_random" (based on "test_bwipp") to test various
  symbologies with random binary - discovered CODABLOCKF bug;
  expand "test_bwipp"
manual: Feeback: mention AZTEC -1 meaning min & MICROPDF417:
  doc new `ZINT_CAP_BINDABLE`
general: various code fiddlings and re-formattings
2025-04-03 16:08:15 +01:00
gitlost
a6c225447e general: change BARCODE_RAW_TEXT to write to new zint_symbol
fields `raw_segs` and `raw_seg_count` instead of `text`, and to
  do so for all symbologies, using new common funcs `rt_cpy()` etc.
MICROPDF417: return ECC percentage in top byte of `option_1`
DBAR_EXP_STK: return `option_2`/`option_3` feedback
CLI: change warning text "ignoring" -> "**IGNORED**"
GUI: show feedback for DBAR_EXP_STK, MICROPDF417, UPNQR
ctest: fix recent inability to run tests via "ctest" on Windows
  (MSVC) by using cmake 3.22 feature `ENVIRONMENT_MODIFICATION`
manual: document feedback and RAW_TEXT in new "Feedback" section;
  rephrase some symbology descriptions
test suite: new general-use arg "-a"; add `func_name` to context;
  new "test_bwipp" test for testing BWIPP against ZXing-C++
2025-03-28 10:02:19 +00:00
gitlost
e12c5ed3ba DBAR_STK/DBAR_OMNSTK/DBAR_EXPSTK (including composites): output HRT
if `BARCODE_RAW_TEXT`
manual: default to always making html
2025-03-10 01:22:52 +00:00
gitlost
d222add96d - AZTEC/CHANNEL/CODABLOCKF/CODE16K/CODE49/CODEONE/DATAMATRIX/
DOTCODE/GRIDMATRIX/HANXIN/MICROPDF417/MICROQR/PDF417/QRCODE/
  RMQR/ULTRA: set `option_1/2/3` to values used in encodation
  ("Feedback options"), and add new access methods
  `encodedOption1()` etc. to Qt Backend, and use in GUI to provide
  better feedback on "Automatic" selections
- AZTEC: give more precise warnings in low ECC situations, and
  indicate via `option_1` by setting to -1 (min 3 words), 0
  (<5% + 3 words) (`ecc_ratio`)
- set_height: fix non-compliance false positives by using epsilon
  in checks (prompted by CODABLOCKF non-compliant warning for
  zint-generated compliant height - floating point `rows` mult !=
  `zero_count` div; one test regression for CODE93);
  better warning messages on non-compliant heights (min/max)
- manual/man page: fix DATAMATRIX Sizes tables "28 12x26" ->
  "27 12x26"
- GUI: AZTEC/CODEONE: add Zint versions to comboboxes
- DOTCODE: improve error messages re size too small/large
- ULTRA: better ZINT_TEST codeword dump (ZINT_DEBUG_TEST)
- general: various tabs -> spaces; prettify main .rc files;
  trailing spaces; small amount of code fiddling (CODE16K)
2025-03-07 16:51:36 +00:00
gitlost
d0465375bb Add convenience API funcs ZBarcode_UTF8_To_ECI() and
`ZBarcode_Dest_Len_ECI()`, primarily for ZXingC++ but also useful
  in general
2025-03-02 20:50:55 +00:00
gitlost
81308f4957 Reinstate BARCODE_RAW_TEXT (note forgot to remove mention of
`ZINT_WARN_HRT_RAW_TEXT` in man page zint.1.pmd last time)
2025-02-25 16:45:28 +00:00
gitlost
d24ba5edc0 Bump to version 2.15.0.9 (dev) 2025-02-25 15:29:08 +00:00
gitlost
4896136bdb Version 2.15.0
To be released tomorrow 2025-02-25
2025-02-24 20:21:03 +00:00
gitlost
e4663e48cf Temporarily disable BARCODE_RAW_TEXT prior to 2.15.0 release, as
it's not stable yet. `text_length` is kept.
2025-02-24 14:11:03 +00:00
gitlost
c499620ff6 upcean: BARCODE_RAW_TEST: need "+" separator for add-ons, else can't
differentiate between EAN-13 and EAN-8 + EAN-5
cli: append "Ital. Pharma" to Code 32 description
dxfilmedge: code fiddle
2025-02-20 22:57:54 +00:00
gitlost
8e7931b147 Rename BARCODE_PLAIN_HRT -> BARCODE_RAW_TEXT and add warning
`ZINT_WARN_HRT_RAW_TEXT` if set when outputting HRT (ZXing-C++
  issue 883, props Axel Waggershauser)
README: Pharmacode -> One-Track, Pharmacode 2-trace -> Two-Track
2025-02-20 02:10:19 +00:00
gitlost
fef8b083b4 Add text_length (length of text) to zint_symbol, and new
`BARCODE_PLAIN_HRT` option for `output_options` - for use
  primarily by ZXing-C++ but may be generally useful;
  centralize setting of HRT using new common `hrt_cpy_nochk()` etc.
  routines to ensure `text_length` always set
PLESSEY: add show default check characters option
CODE32: ignore `option_2` (check digit options)
PZN: ignore `option_2` (check digit options) except when indicates
  PZN7 only
DPD: exclude DEL from ident tag also
out_maybe_mkdir: fix `utf8_to_wide()` return (Windows only)
general: replace use of `strcpy()` etc. (except for test suite)
  with `memcpy()`, `hrt_()` etc. in lib & `cpy_str()` etc. in CLI
  & `cpy_bytearray_left()` in backend_qt
clang-tidy: update README reflecting above
backend_tcl: use sizeof(primary) to check length; tabs -> spaces
general: various code fiddling
docs: pandoc 3.6.2 -> 3.6.3
2025-02-15 20:32:55 +00:00
gitlost
b753382353 man page: fix Code 93 --vers=1 hide -> show default check digits 2025-02-06 22:45:54 +00:00
gitlost
e38185121e Version 2.14.0
To be released tomorrow 2025-02-05
2025-02-04 15:17:47 +00:00
gitlost
01d72607c6 GUI: suppress shadow var warning (macOS); update year
zint.h: update year
man: mention no HRT for raster scale < 1
README.bsd: NetBSD 10.0 -> 10.1
README.linux: Fedora 40 -> 41
update_version.php: mention make manual.html
2025-02-02 09:58:41 +00:00
gitlost
3f7cfd47c7 gs1: update to latest gs1-syntax-dictionary (new lint keyoff1());
in `key()` (& hence `keyoff1()`) check for GS1 Company Prefix
  length >= 4 (same as gs1-syntax-dictionary lints)
manual: update some standard years
2025-01-31 21:20:43 +00:00
gitlost
53cb29dbc6 backend_tcl/zint_tcl.vcsproj: put ZINT_VERSION in general defines
and remove from individual .c files;
  rename include dirs "C:\myprograms\tcl9.0" -> "C:\Tcl" and lib
  dirs "C:\myprograms\tcl9.0\lib" -> "C:\Tcl\lib";
  suppress some warnings
backend_tcl/zint.c: suppress some warnings
tools/update_version.php: update for "backend_tcl/zint_tcl.dsp" ->
  ".vcxproj"
manual.pmd: backend_tcl: fix "require package" -> "package require"
  and explain "C:\Tcl" may need adjusting
general: update copyright years in ".rc" files
library: remove needless `eci` zeroing in `set_symbol_defaults()`
  and make `barcode_seg_funcs` initialization consistent (147 now)
2025-01-29 16:54:59 +00:00
gitlost
a4b557786f backend_tcl: add "win/readme.txt"; fiddle with "readme.txt"
README:  copyright 2024 -> 2025; remove primarily Linux bit
manual: update Tcl instructions; copyright 2024 -> 2025;
  Data Matrix ECC200 -> ECC 200, mention previous standards by
  name;
manual/GUI: Pharmacode -> Pharmacode One-Track, 2-track Pharmacode
  -> Pharmacode Two-Track
backend/DEVELOPER: update
2025-01-22 08:13:42 +00:00
gitlost
62c54adb56 DATAMATRIX: fix mis-encodation by only doing special end-of-data
processing on last segment
DXFILMEDGE: error message XXX-XX -> NNN-NN, fix comments
README.bsd: update to latest Free/Open/Net, "Run" section
test suite: CODABLOCKF: extra tests from Okapi
test suite: support DATAMATRIX ^PROG, ZXing++ AZRUNE
manual/man page: CODEONE: fix WxH -> HxW and Version C width
manual: backtick literals
2025-01-18 04:20:53 +00:00
gitlost
7a9fdd6cd0 docs: fix url for DXFILMEDGE, add parity bit detail 2024-12-24 13:46:47 +00:00