Skip to content

Commit

Permalink
Add handling of new Zint API >= 2.7.0 for Zint backend and use latest
Browse files Browse the repository at this point in the history
version (2.12.0) by default (issues jimevins#86 and jimevins#160, subsumes PR jimevins#164).

 - hack "FindLibZint.cmake" to use `zint -h` to get version;
   define `LIBZINT_VERSION`
 - add new API handling in `Zint` in LIBZINT_VERSION >= 20700 define,
   leaving 2.6.3 handling unchanged
 - add some new Zint barcodes and adjust style properties of various other
   Zint barcodes
 - enable check digit handling via Zint `option_2`
 - add horizontal alignment `halign` argument to `Barcode::addText()`,
   `QtRenderer::drawText()` and `DrawingPrimitiveText::DrawingPrimitiveText()`
   and use in `QtRenderer::drawText()` to cater for Zint EAN/UPC left/right
   text align of outside digits
 - guard against QT infinite loop bug in `QFontMetricsF` when point size
   < ~0.4 (MIN_POINT_SIZE)
  • Loading branch information
gitlost committed Dec 19, 2022
1 parent ddc805a commit 3b88071
Show file tree
Hide file tree
Showing 18 changed files with 1,000 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ matrix:
- sudo apt-get -y install pkgconf libqrencode-dev
- sudo apt-get -y install barcode
# Install zint from source
- wget https://downloads.sourceforge.net/project/zint/zint/2.6.5/zint-2.6.5.tar.gz && tar xzf zint-2.6.5.tar.gz && ( cd zint-2.6.5 && mkdir build && cd build && cmake .. && make && sudo make install )
- wget https://downloads.sourceforge.net/project/zint/zint/2.12.0/zint-2.12.0-src.tar.gz && tar xzf zint-2.12.0-src.tar.gz && ( cd zint-2.12.0-src && mkdir build && cd build && cmake .. && make && sudo make install )
- export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

before_script:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ endif ()
find_package (ZLIB 1.2 QUIET)
find_package (GnuBarcode 0.98 QUIET)
find_package (LibQrencode 3.4 QUIET)
find_package (LibZint 2.6 EXACT QUIET)
find_package (LibZint 2.6 QUIET)
# Unit testing support
find_package (Qt5Test 5.6 QUIET)

Expand Down
172 changes: 130 additions & 42 deletions backends/barcode/Backends.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backends/barcode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ endif ()

if (${LIBZINT_FOUND})
add_definitions (-DHAVE_ZINT=1)
add_definitions (-DHAVE_ZINT=1 -DLIBZINT_VERSION=${LIBZINT_VERSION})
set (OPTIONAL_ZINT ZINT::ZINT)
else ()
set (OPTIONAL_ZINT "")
Expand Down

0 comments on commit 3b88071

Please sign in to comment.