Commit graph

55 commits

Author SHA1 Message Date
gitlost
607e4ed33a 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)
2023-06-12 01:25:55 +01:00
gitlost
930f458979 backend: define z_alloca() and use for both Unix and Windows;
replace double-slash comments with old-skool slash asterisk ones;
  define uint16_t etc for Windows ourselves and remove ms_stdint.h &
  stdint_msvc.h as no longer used;
  (backend (excepting test suite) now C89 compatible)
LICENSE: move from backend to root and move COPYING to frontend, with
  copies in frontend_qt & backend_qt, so in where it applies;
  add LICENSE section from manual to root README
2022-07-14 16:01:30 +01:00
gitlost
0b3fe8db93 GUI: remove sizeConstraint so squashable again (sigh)
- make Sequence Format textbox bigger (on own line)
  - suppress question mark in Windows dialogs
AUSPOST: more standard error messages
backend: add & use z_isdigit/upper/lower() macros
docs: 20-bit Unicode -> 21-bit Unicode
2022-06-24 14:38:48 +01:00
gitlost
f58c80e290 Add multiple segments support for AZTEC, CODEONE, DATAMATRIX, DOTCODE,
GRIDMATRIX, HANXIN, MAXICODE, MICROPDF417, PDF417, QRCODE, RMQR, ULTRA
RMQR: fix ECI encoding (wrong bit length for indicator)
MICROQR: check versions M1 and M2 for allowed characters so as to give
  better error messages
DOTCODE: some small optimizations
common.c: add is_chr(), segs_length(), segs_cpy()
CODEONE/CODE128/DOTCODE/GRIDMATRIX/HANXIN/MAXICODE/QRCODE/ULTRA: add
  namespace prefixes to static funcs/data
includes: use Z_ prefix, unuse double underscore prefixes (guard defines)
manual.txt: compress some tables using double/treble column sets
2022-05-09 19:50:50 +01:00
gitlost
4e72a541f7 PDF417: fix cols/rows calculation to require multiple <= 928 codewords;
add specify rows option (option_3) (#204);
  warn if cols increased from specified (back-incompatible);
  move table definitions from "pdf417.h" to new "pdf417_tabs.h" and
  make INTERNAL_DATA and share with composite.c (saves ~10K);
  prefix routines and tables with "pdf_";
  some small performance improvements through if/elses, pdf_textprocess()
  & pdf_numbprocess() loop simplifications
MICROQR: fix debug access crash on printing non-NUL-terminating binary
DATAMATRIX: fix missing ++ from "[tp]" at C40/TEXT EOD processing of GS1
  (though probably never reached); use "[tp++]" throughout
Add const to static tables missing it and also to some variables
Change "debug" -> "debug_print" throughout
2021-10-30 22:00:31 +01:00
gitlost
fab7435fac Performance improvements for linear encoding and raster output
- use fixed-length string tables (mostly) instead of (char *) pointer ones
   (saves ~40K)
 - re-use C128Table for CODABLOCKF and CODE16K
   (required removal of Stop character and extra CODE16K-only entry)
 - use pointer to destination and copy (memcpy/strcpy(), bin_append_posn())
   instead of concatenating (strcat()) (mostly)
 - replace last remaining bin_append()s with bin_append_posn();
   bin_append() removed
 - add length arg to toupper() and expand() (avoids strlen())
 - change is_sane() to use table-based flags (avoids an iteration)
 - rename lookup() to is_sane_lookup() and change to check and return posns
   and use in pointer to destination loops (avoids strcat()s)
 - remove special case PHARMA in expand() (dealt with in pharma())
 - make #define SILVER/CALCIUM/TECHNETIUM/KRSET etc static strings
 - replace strchr() -> posn()
 - CODE128: populate destination once in checksum loop; re-use and export
   some more routines (c128_set_a/b/c(), c128_put_in_set()) for sharing;
   prefix defines (SHIFTA -> C128_SHIFTA etc) and existing exported routines
 - use factor XOR toggle trick in checksum calcs (avoids branch)
 - raster.c: fill out single 1-pixel row and copy using new draw_bar_line(),
   copy_bar_line() routines; similarly in buffer_plot compare previous line &
   copy if same (same technique as used to improve non-half-integer scaling,
   significant performance increase, (c) codemonkey82);
   also done for PNG (BMP/GIF/PCX/TIFF not done)
 - raster/vector/output.c: shorten "output_" prefix -> "out_";
   sync vector to other raster changes to try to keep source files similar
 - 2of5.c: prefix "c25_"
JAPANPOST: return error if input data truncated (backward incompatible)
DAFT: max chars 50 -> 100
common.c: istwodigit() -> is_twodigit()
common.c/emf.c/output.c: use some further stripf()s (MSVC6 float variations)
library.c: new check_output_args() helper
zint.h: add BARCODE_LAST marker and use in library.c
QRCODE: remove a NOLINT (requires clang-tidy-13), one remaining
CMake: separate no-optimize from ZINT_DEBUG into new ZINT_NOOPT option
2021-10-20 23:05:30 +01:00
gitlost
c0791ad85e Add Structured Append support for AZTEC, CODEONE, DATAMATRIX, DOTCODE,
GRIDMATRIX, MAXICODE, MICROPDF417, PDF417, QRCODE, ULTRA
DOTCODE: use pre-calculated generator poly coeffs in Reed-Solomon for
  performance improvement
PDF417/MICROPDF417: use common routine pdf417_initial()
GUI: code lines <= 118, shorthand widget_obj(),
  shorten calling upcean_addon_gap(), upcean_guard_descent()
various backend: var name debug -> debug_print
2021-09-28 21:42:44 +01:00
gitlost
3388f98c00 vector: Add width to struct zint_vector_circle & use for MaxiCode bullseye
**Incompatible change**
2021-08-22 13:59:01 +01:00
gitlost
3c1869b032 library: compat symbology 39 fix; ISBN: "X" check
WARN_FAIL_ALL: always return error: ZINT_ERROR_USES_ECI/NON_COMPLIANT
Fuller error messages; more comments zint.h
mainwindow.cpp: replace metaobject ENUM with array
  (suppresses virtual in constructor warning)
2021-07-06 19:53:31 +01:00
gitlost
c693482aa1 Change height and row_height array to floats; DAFT tracker ratio 2021-06-19 13:11:23 +01:00
gitlost
5187f2226d MAXICODE: fix shifting from sets C/D/E to A/B (only latch available) 2021-03-28 21:31:45 +01:00
gitlost
4e501c77da MAXICODE: fix mask typos for ECI 3/4 bytes 2021-03-18 16:21:22 +00:00
gitlost
2b85585e69 MAXICODE: scmvv option #212; postcode needn't be space-filled 2020-12-19 17:13:35 +00:00
gitlost
cd214addba HANXIN: 0xFFE terminator; reedsol/AZTEC: stack-based; AZTEC/HANXIN/QR/GRIDMATRIX speedups; #209 2020-11-27 12:54:44 +00:00
gitlost
36c19053d7 vector.c: string halign; POSTNET/PLANET: 1 module space; ZBarcode_Cap(); GUI settings 2020-09-30 12:19:12 +01:00
gitlost
52d08fd9b9 #191 clang-tidy reduce NOLINTs using asserts, remove DeadStores 2020-07-19 10:31:12 +01:00
gitlost
d56c7915b7 #181 OSS-Fuzz MAXICODE fix, prevent index overrun on numeric compaction 2020-03-28 02:50:15 +00:00
gitlost
bca82ecc0d libzint.so: suppress exporting INTERNAL functions to the shared library; ZINT_TEST 2019-12-19 00:37:55 +00:00
Robin Stuart
15ae99ee11 Allow explicit ECI 3
Setting ECI to 3 now causes Zint to include ECI 3 in symbol, and allows entry of data formatted in ISO 8859_1
Fixes #127 requested by Harald Oehlmann
2019-10-06 17:39:54 +01:00
gitlost
d76cdd615b Fixes for eci, binary div, upce, other 2019-09-01 20:23:15 +01:00
Harald Oehlmann
89c2ee6f1d 2019-09-01 HaO maxicode sizeof issue fixed by Christian Schmitz 2019-09-01 18:14:21 +02:00
Harald Oehlmann
efa4a8f435 2018-08-30 HaO Maxicode "input to long" error. Backport from okapi by Remi. Ticket #148 2019-08-30 16:40:44 +02:00
Robin Stuart
a6c93f1989 Recognise spaces as valid mode 2 character
Fixes #116 reported by Grzegorz Krukar
2019-03-15 19:15:47 +00:00
Boris Zentner
31cc0ae78a Remove spaces before EOL 2017-10-25 17:23:57 +01:00
Boris Zentner
45441a6da7 Fix mixed unix / windows EOL 2017-10-25 17:15:35 +01:00
Harald Oehlmann
f83e5b1501 Make compile with MS-VC6 2017-10-16 19:26:54 +02:00
Rodrigo Torres
4963a772db Refactor 2017-09-11 19:21:33 +01:00
Robin Stuart
1882d76b70 Update version to 2.6.1 2017-08-27 09:31:02 +01:00
Robin Stuart
608b4b9134 Audit of error codes 2017-07-27 16:01:53 +01:00
Robin Stuart
a085bca168 Revion of ECI number encoding 2017-06-18 13:00:22 +01:00
Robin Stuart
b3a1b24d18 help the compiler create more efficient code
Patch from Michael <virtual_worlds@gmx.de>
Full text: As usual I have modified only minor things to remove warnigs when compiled as C++ code, have added some const-specifiers where possible to help the compiler create more efficient code and added some static-specifiers to make functions invisible to other modules.
2017-05-29 10:43:47 +01:00
Boris Zentner
319c7791bc Fix of by one error in maxi_text_process 2017-01-26 19:44:20 +00:00
Robin Stuart
4561a66067 Add identifiers to error messages
To ease the debug process
2016-10-28 22:40:40 +01:00
Robin Stuart
9d1c20201d Add ECI encoding 2016-08-16 12:43:41 +01:00
Harald Oehlmann
90407bffce Removed include malloc.h for all non-Windows so FreeBSD compiles.
Removed include of sys/malloc.h for APPLE, probably not used.
Ticket #18
2016-04-03 22:33:01 +02:00
Robin Stuart
8a88ffdd7b Code format and audit, part 2
Update copyright info, remove unused code, etc.
2016-02-20 10:50:15 +00:00
Robin Stuart
2e59058615 Avoid possible confusion with Windows error code
Bugfix by Oxy Genic
Ref: https://sourceforge.net/p/zint/mailman/message/34857131/
2016-02-17 10:37:20 +00:00
Robin Stuart
7ae95b2b42 Numeric data correction
Bugfix by Ed Deinstadt
Ref: https://sourceforge.net/p/zint/mailman/message/34362009/
2016-02-13 07:58:59 +00:00
oxygenic
1a7863520b license changed with permission of original copyright holders (see mailing list for details) 2013-05-16 19:26:38 +02:00
Robin Stuart
533a5d0453 Resolve bug when Maxicode mode set by user.
If you invoke the program with --mode=2 or --mode=3 zint reports the error
"Invalid Primary String".
Fixed by Travis Waalkens.
2011-03-08 10:33:22 +00:00
Robin Stuart
7da2041cfd More code cleanup
Patch 7 of 7 from "Ismael Luceno" <ismael.luceno@gmail.com>
2010-09-14 11:36:00 +01:00
Robin Stuart
46d604dad7 Adjustment for OSX
Replaced an adjustment for compiling on OSX which I accidentally removed.
2010-06-21 14:31:24 +01:00
hooper114
91251fbc26 Maxicode - error correction bug and misplaced finder 2010-05-18 08:33:03 +00:00
brianray
27ce2abc7b ifdefs needed to find malloc.h on the mac. 2010-02-28 03:43:32 +00:00
hooper114
e3e9c67f93 Add Reader Initialisation mode 2009-12-04 23:18:48 +00:00
hooper114
1ff9c0d472 Add corrections from tgotic 2009-10-06 19:03:00 +00:00
hooper114
04b9a99241 API overhaul part 1: removal of nullchar 2009-09-29 09:45:46 +00:00
hooper114
cb0e4e27e8 Converted zint_symbol structure usage to a more compressed format 2009-05-31 20:33:54 +00:00
hooper114
d6df698918 NULL character support 2009-01-02 21:09:16 +00:00
hooper114
88cc19bab1 Change of e-mail address 2008-11-17 08:47:42 +00:00