Commit graph

70 commits

Author SHA1 Message Date
gitlost
d97fc7e110 CMake: use "GNUInstallDirs" instead of old (2008) KDE
"SetPaths.cmake" (removed) - resolves absolute paths in
  "zint-targets.cmake", ticket #318, props John Alexander;
  also remove "FindZint.cmake" install as not best practice
  (Daniel Pfeifer “Effective CMake"), but retain in tree for now;
  also remove APPLE stuff re UNIVERSAL build, obsolete, and
  setting of CMAKE_OSX_SYSROOT, seems unnecessary
2024-06-21 15:18:00 +01:00
gitlost
98f86727cc Add BARCODE_MEMORY_FILE to symbol->output_options to allow
outputting to in-memory buffer `symbol->memfile` instead of to
  file `symbol->outfile`, ticket #301
Add "README.clang-tidy" and ".clang-tidy" options file
Suppress some warnings
2023-12-27 19:20:19 +00:00
gitlost
323b34502b zint.h: increase symbol->text size 160 -> 200;
rename `ZINT_CAP_EXTENDABLE` -> `ZINT_CAP_EANUPC`
  (`ZINT_CAP_EXTENDABLE` marked as legacy)
CODE128: increase no. symbol chars max 60 -> 99
EAN-2/EAN-5: fix `BARCODE_BIND_TOP/BIND/BOX` output
GS1_128: warn if data > 48 (GS1 General Specifications max)
common: `is_extendable()` -> `is_ucpean()`
raster: add `ZFONT_HALIGN_CENTRE/LEFT/RIGHT` flags and process
  in `draw_string()` (for drawing EAN/UPC outside digits), and
  for `ZFONT_HALIGN_CENTRE` round when calculating centre
  (shifts some texts 1 pixel left)
raster/vector: use offsets into `symbol->text` for EAN/UPC
  instead of `out_upcean_split_text()` (removed)
BMP/EMF/GIF/PCX/PNG/PS/SVG/TIF: use new `out_colour_get_rgb()`
  routine (replaces `colour_to_XXX()`)
general: simplify/fix some `error_number` handling/returning
frontend: truncate overlong `--primary` instead of ignoring;
  negative floating pt option (for `--textgap`)
man page: list size detail for matrix symbols (`--vers`)
manual: further fiddling with scaling text; some typos
2023-11-19 19:39:54 +00:00
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
Todor Prokopov
b0db61efe1 Fix exported target include directories 2022-12-19 18:51:38 +02:00
Todor Prokopov
2d2b221306 Fix Windows static build 2022-12-19 18:51:38 +02:00
gitlost
6393813cff - cmake: remove zintconfig.h.in for now as incompatible with MSVC
project builds (will add back in future if go fully CMake)
- NO_PNG -> ZINT_NO_PNG and new API function `Zint_NoPng()` to
  determine if no PNG support in libzint; replace use in GUI with
  backend_qt method `noPng()`
2022-11-24 14:18:31 +00:00
Todor Prokopov
536a581d9e Install CMake export 2022-11-21 17:12:02 +02:00
Todor Prokopov
66431d8ec1 Add ZINT_SHARED CMake option
Either shared or static (or both) libraries can be built now.
Executables (zint and zint-qt) are linked with the static library if the shared
library it not built.
2022-11-21 15:35:06 +02:00
gitlost
471aed7a69 BC412: add to backend_tcl; add skeleton test
GUI: allow for Qt not parsing #if's in slots (copy_to_clipboard_png())
2022-07-03 23:54:42 +01:00
Robin Stuart
7c4afa49c9 Add symbology BC412 2022-07-03 15:47:56 +01:00
gitlost
ab3cf4f395 eci.c: replace libiconv-adapted code with own implementations so
as to fully comply with BSD license (for why Library GPL 2+ not
  compatible see https://opensource.stackexchange.com/a/6701),
  ~3% slower (maybe), +~6K extra in data
  (gb18030.c, gb2313.c & sjis.c removed, mapping .TXT files moved
  to backend/tools/data & extra ones added, 2 new PHP generators)
GUI: CODE39/EXCODE39: show/hide HIBC check digit option in addition
  to enable/disable (less confusing)
CLI: batch: pedantic check for EOF using intChar in newline fgetc()
  loop
test_args.c: don't use WIFEXITED(), WEXITSTATUS() on Windows
manual: lessen some copy/paste verbiage by referring back, other
  small tweaks/typos
2022-06-02 20:32:25 +01:00
Jeff Skaistis
d151f29ee5 Add .rc file to Windows backend build. 2021-10-21 09:53:22 -05:00
gitlost
141cc0b866 cmake min 3.9 -> 3.13 so LINK_LIBRARIES available in try_compile()
cmake: hardcode -fsanitize=address for MSVC 2019
cmake: non-MSVC simplify setting sanitize address, undefined
test_code128: test_hibc_input: extra tests
2021-07-19 15:58:44 +01:00
gitlost
7a1500afeb backend/CMakeLists.txt: output dir for zintconfig.h, props Andre Maute (#238); copyright/guard 2021-07-12 16:57:32 +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
Schaich
ee3f25fada Detect Sanitizer support
Sanitizers require both front and backend support on the target platform.
Detect whether applications can be compiled and linked with sanitizer support
and enable sanitizers that can be both compiled and linked with.
check_c_compiler_flags is insufficient here, because we need library support
on top of just compiler support.

This implicitly disables sanitizer support for most cross-compiling and
embedded targets which use gcc or llvm based toolchains but don't have library
support, while enabling it on MSVC and Intel compilers.

While here, bind the sanitizer dependency to the zint library targets, and
remove the hardcoded no-var-tracking-assignments. variable assignment
tracking is a very powerful tool to find the true source of uninitialized
value based conditional jumps, and, if undesired, it can be disabled by
configuring the ASAN_OPTIONS environment variable.
2021-06-25 03:26:12 +09:00
gitlost
4a8cac2a5a CODEONE/DATAMATRIX/MAILMARK/PLESSEY: fix some 32-bit/portability bugs
PLESSEY: add options NCR weighted mod-10, hide check digit(s) in HRT
test suite: now runnable under MSVC 2019, 2017, 2015, MinGW/MSYS
win32/README: update with MSVC 2019 and CMake instructions
2021-06-10 11:15:39 +01:00
Schaich
00199c7ef5 The zint library always is shared
The SHARED attribute is forced via the add_library, so the default
value of cmake is ignored. Also, this option should obviously not
be set for the `zint-static` library
2021-06-02 21:14:14 +09:00
Schaich
9ff3f13c19 Optionalize the PNG and the Qt dependencies
Expose the ability to turn these dependencies off, which results in reduced
functionality. However, it enables a developer using the zint library to
instruct cmake to build a libzint as deployed by e.g. build servers which
don't have png/zint installed, without having to uninstall those libraries
from the development system
2021-06-02 21:14:14 +09:00
Schaich
acd12e1754 Add and use helper to set all flags to both the shared and the static library 2021-06-02 21:14:14 +09:00
Schaich
3e89058051 Turn zint tests into a subproject of backend
All dependency handling is implied via linking to the zint target. Options
are inherited from the backend build
2021-06-02 21:14:14 +09:00
Schaich
83bac8c8a5 Bind macro definitions to the zint library target
The libpng dependency is exported to consumers, while the ZINT_TEST option
affects the build output. Both are therefore marked public
2021-06-02 21:14:14 +09:00
gitlost
6322c0c2b0 #213 Use PNG::PNG for libpng, require cmake 3.5, props Schaich Alonso 2020-11-30 15:51:14 +00:00
Robin Stuart
f545075162 Add explicit zintconfig.h for non-Cmake Windows build 2020-11-24 07:03:03 +00:00
Robin Stuart
3eb31fe3f8 Take version information from CmakeLists.txt
Warning: potential incompatibility because version number is no longer stored in zint.h
2020-11-22 11:29:45 +00:00
gitlost
7be63a00b6 CODE16K fixes; separator default 1; raster/vector.c quiet_zones, output.c; #191 2020-05-21 18:22:28 +01:00
gitlost
9b771dba3a Make zint-static build optional 2020-03-30 10:54:21 +01:00
gitlost
afe0c96476 OSS-Fuzz add zint-static rule to backend/CMakeLists.txt 2020-03-29 15:51:56 +01:00
gitlost
889e786d95 HANXIN ECI conversion, GB 18030 LIBICONV port; some codeword fixes; optimized encoding modes 2019-12-08 16:15:34 +00:00
Robin Stuart
f9d969cdd6 Remove depreciated gLabels render code 2019-12-01 14:09:46 +00:00
gitlost
8be13283db ECI conversion for GRIDMATRIX; GB 2312 LIBICONV port 2019-11-28 19:15:29 +00:00
gitlost
fed7378675 Handle UNICODE_MODE ECI conversion for reduced charset barcodes and QRCODE/MICROQR 2019-11-27 16:16:14 +00:00
gitlost
03d99ceb23 Composite changes encodation 10, 11, general field, CC-A/B shift 2019-10-29 22:54:18 +00:00
Robin Stuart
ca24105ca0 Add placeholder for Ultracode 2019-03-21 09:14:24 +00:00
Harald Oehlmann
9684bdb556 Ticket 134: do some CMake corrections told to be ok by the ticket author. No test by me. 2018-12-12 09:37:56 +01:00
Robin Stuart
30fcd7986c Plot vector graphics using linked list structure
Simplifies the implementation of individual vector graphic file formats
2018-06-10 09:16:18 +01:00
Robin Stuart
59116f689d Add new symbology: Royal Mail Mailmark 2018-02-06 20:57:01 +00:00
Robin Stuart
ec8cfcbb76 Add TIFF output option 2016-12-30 20:25:58 +00:00
Robin Stuart
d1e406b7d2 Add enhanced metafile format (EMF) support 2016-12-23 16:48:03 +00:00
Robin Stuart
542ec7c7a5 When libpng is not found, default to GIF output 2016-08-26 11:44:02 +01:00
Robin Stuart
4e13b0e95d Add framework for Codablock 2016-08-24 19:37:49 +01:00
Robin Stuart
9d1c20201d Add ECI encoding 2016-08-16 12:43:41 +01:00
Robin Stuart
8029dec9c7 Merge Dotcode 2016-08-07 20:28:56 +01:00
Harald Oehlmann
08c88e85d2 Added gif output 2016-07-28 20:58:33 +02:00
Robin Stuart
340bcd2833 DotCode: New symbology added and encoding to codewords as set out in Annex F
Does not produce DotCode symbols yet
2016-07-25 22:52:29 +01:00
Robin Stuart
babeaec41d Add ZSoft PCX image file output 2016-07-23 15:08:55 +01:00
Robin Stuart
08e51cf5bb Separate PNG and BMP file handling routines and create common framework to allow addition of more output file formats 2016-07-19 23:02:39 +01:00
Robin Stuart
0230426b0f Add new symbology: Han Xin Code 2016-04-07 17:13:43 +01:00
Robin Stuart
0927fa6237 Correct NO_PNG compilation.
Correct a couple of minor omissions which prevented compiling
without PNG support.
2011-01-02 22:01:38 +00:00