1
0
Fork 0
mirror of https://git.code.sf.net/p/zint/code synced 2025-05-23 03:26:56 -04:00

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
This commit is contained in:
gitlost 2025-02-15 20:32:55 +00:00
parent ddedd00d2d
commit fef8b083b4
82 changed files with 2873 additions and 1671 deletions

View file

@ -573,7 +573,7 @@ codeset from U+0000 to U+D7FF and U+E000 to U+FFFF (i.e. excluding surrogates).
Not to be confused with the Windows Bitmap file format BMP!
(Special escape sequences are available for Code 128 only to manually switch
Code Sets and insert special FNC1 characters - see [6.1.10.1 Standard Code 128
Code Sets and insert special `FNC1` characters - see [6.1.10.1 Standard Code 128
(ISO 15417)] for details.)
Input data can be read directly from file using the `-i` or `--input` switch as
@ -2037,6 +2037,8 @@ Member Name Type Meaning Default Value
formatting, with a
terminating `NUL`.
`text_length` integer Length of `text`. 0 (output only)
`rows` integer Number of rows used by (output only)
the symbol.
@ -2297,7 +2299,7 @@ Value Effect
`BARCODE_DOTTY_MODE` Plot a matrix symbol using dots rather than
squares.
`GS1_GS_SEPARATOR` Use GS (Group Separator) instead of FNC1 as GS1
`GS1_GS_SEPARATOR` Use `GS` (Group Separator) instead of `FNC1` as GS1
separator (Data Matrix only).
`OUT_BUFFER_INTERMEDIATE` Return the bitmap buffer as ASCII values instead of
@ -2320,6 +2322,11 @@ Value Effect
`BARCODE_MEMORY_FILE` Write output to in-memory buffer `symbol->memfile`
instead of to `outfile` file.
`BARCODE_PLAIN_HRT` Set HRT with no decoration,[^13] complete with any
control characters[^14] and check characters,[^15]
and for all linear symbologies, including those
that normally don't set it.[^16]
------------------------------------------------------------------------------
Table: API `output_options` Values {#tbl:api_output_options tag="$ $"}
@ -2333,6 +2340,23 @@ Code].
[^12]: Codablock-F, Code 16K, Code 49, EAN-2 to EAN-13, ISBN, ITF-14, UPC-A and
UPC-E have compliant quiet zones added by default.
[^13]: In particular no parentheses will appear in the HRT for GS1 symbologies,
and `GS` separators will be added as required. Also for EAN/UPC symbologies, any
add-on data will directly follow the main data, i.e. will not be separated by a
`+` character.
[^14]: Normally control characters (including `DEL`) and non-ISO/IEC 8859-1 are
replaced by spaces in the HRT.
[^15]: Except for Japanese Postal Code, whose check character is not truly
representable in HRT.
[^16]: HRT is normally not set for the postal codes Australia Post (all
variants), USPS Intelligent Mail, POSTNET and PLANET, Brazilian CEPNet, Royal
Mail 4-State Customer Code and 4-State Mailmark, Dutch Post KIX Code, Japanese
Postal Code, DAFT Code, Flattermarken and FIM, the pharma codes Pharmacode
One-Track and Pharmacode Two-Track, and DX Film Edge Barcode.
## 5.11 Setting the Input Mode
The way in which the input data is encoded can be set using the `input_mode`
@ -2345,7 +2369,7 @@ Value Effect
`UNICODE_MODE` Uses UTF-8 input.
`GS1_MODE` Encodes GS1 data using FNC1 characters.
`GS1_MODE` Encodes GS1 data using `FNC1` characters.
_The above are exclusive, the following optional and
OR-ed._
@ -2585,7 +2609,7 @@ Value Meaning
`ZINT_CAP_STACKABLE` Is the symbology stackable?
`ZINT_CAP_EANUPC`[^13] Is the symbology EAN/UPC?
`ZINT_CAP_EANUPC`[^17] Is the symbology EAN/UPC?
`ZINT_CAP_COMPOSITE` Does the symbology support composite data? (see
[6.3 GS1 Composite Symbols (ISO 24723)] below)
@ -2616,7 +2640,7 @@ Value Meaning
Table: {#tbl:api_cap tag=": API Capability Flags"}
[^13]: `ZINT_CAP_EANUPC` was previously named `ZINT_CAP_EXTENDABLE`, which is
[^17]: `ZINT_CAP_EANUPC` was previously named `ZINT_CAP_EXTENDABLE`, which is
still recognised.
For example:
@ -2774,15 +2798,15 @@ Zint adds a check digit.
UPC-A is used in the United States for retail applications. The symbol requires
an 11-digit article number. The check digit is calculated by Zint. In addition
EAN-2 and EAN-5 add-on symbols can be added using the + character. For example,
to draw a UPC-A symbol with the data 72527270270 with an EAN-5 add-on showing
the data 12345 use the command:
EAN-2 and EAN-5 add-on symbols can be added using the `+` character. For
example, to draw a UPC-A symbol with the data 72527270270 with an EAN-5 add-on
showing the data 12345 use the command:
```bash
zint -b UPCA -d "72527270270+12345"
```
or using the API encode a data string with the + character included:
or using the API encode a data string with the `+` character included:
```c
my_symbol->symbology = BARCODE_UPCA;
@ -2873,7 +2897,7 @@ The EAN system is used in retail across Europe and includes standards for EAN-2,
EAN-5, EAN-8 and EAN-13 which encode 2, 5, 7 or 12-digit numbers respectively.
Zint will decide which symbology to use depending on the length of the input
data. In addition EAN-2 and EAN-5 add-on symbols can be added to EAN-8 and
EAN-13 symbols using the + character as with UPC symbols. For example:
EAN-13 symbols using the `+` character as with UPC symbols. For example:
```bash
zint -b EANX -d "54321"
@ -2932,9 +2956,9 @@ As with EAN-13, a quiet zone indicator can be added using `--guardwhitespace`:
![`zint -b ISBNX --compliantheight -d "9789295055124"
--guardwhitespace`](images/isbnx_gws.svg){.upcean}
EAN-2 and EAN-5 add-on symbols can be added using the + character, and there are
options to adjust the add-on gap and the guard bar descent height - see [6.1.3.2
UPC Version E].
EAN-2 and EAN-5 add-on symbols can be added using the `+` character, and there
are options to adjust the add-on gap and the guard bar descent height - see
[6.1.3.2 UPC Version E].
### 6.1.5 Plessey
@ -2944,7 +2968,9 @@ UPC Version E].
Also known as Plessey Code, this symbology was developed by the Plessey Company
Ltd. in the UK. The symbol can encode data consisting of digits (0-9) or letters
A-F up to a maximum of 67 characters and includes a hidden CRC check digit.
A-F (i.e. hexadecimal digits) up to a maximum of 67 characters and includes two
hidden CRC check digits, which may be shown in the Human Readable Text by
setting `--vers=1` (API `option_2 |= 1`).
#### 6.1.5.2 MSI Plessey
@ -3142,7 +3168,7 @@ zint -b CODE128 -d "\^AABC\^^BDEF" --extraesc
will encode the data `"ABC\^BDEF"` in Code Set A.
There is also the extra escape `\^1`, which will encode a special Function Code
1 character (FNC1) anywhere you chose in the data, for instance
1 character (`FNC1`) anywhere you chose in the data, for instance
```bash
zint -b CODE128 -d "A\^1BC\^1DEF" --extraesc
@ -3157,13 +3183,13 @@ alphanumerics) are not recommended.
![`zint -b CODE128AB -d "130170X178"`](images/code128ab.svg){.lin}
It is sometimes advantageous to stop Code 128 from using Code Set C which
compresses numerical data. The `BARCODE_CODE128AB`[^14] variant (symbology 60)
compresses numerical data. The `BARCODE_CODE128AB`[^18] variant (symbology 60)
suppresses Code Set C in favour of Code Sets A and B.
Note that the special extra escapes mentioned above are not available for this
variant (nor for any other).
[^14]: `BARCODE_CODE128AB` previously used the name `BARCODE_CODE128B`, which is
[^18]: `BARCODE_CODE128AB` previously used the name `BARCODE_CODE128B`, which is
still recognised.
#### 6.1.10.3 GS1-128
@ -3755,7 +3781,7 @@ first and last digit are ignored, leaving a 4-digit DX Extract number in any
case, which must be in the range 16 to 2047. The second format `"NNN-NN"`
represents the DX Extract as two numbers separated by a dash (`-`), the first
number being 1 to 3 digits (range 1 to 127) and the second 1 to 2 digits (range
0 to 15).[^15]
0 to 15).[^19]
The optional frame number is a number in the range 0 to 63, and may have a half
frame indicator `"A"` appended. Special character sequences (with or without a
@ -3765,7 +3791,7 @@ number 62, `"K"` or `"00"` means frame number 63, and `"F"` means frame number
A parity bit is automatically added by Zint.
[^15]: The DX number may be looked up in The (Modified) Big Film Database at
[^19]: The DX number may be looked up in The (Modified) Big Film Database at
[https://thebigfilmdatabase.merinorus.com](
https://thebigfilmdatabase.merinorus.com).
@ -3856,13 +3882,13 @@ Solomon error correction. Input is a pre-formatted alphanumeric string of 22
78 bars respectively. The rules for the input data are complex, as summarized in
the following table.
---------------------------------------------------------------------------
Format Version Class Supply Chain ID Item ID Destination+DPS
-----------------------------------------------------------------------------
Format Version Class Supply Chain ID Item ID Destination+DPS
ID
------- ------- ----------- --------------- -------- -----------------
1 digit 1 digit 1 alphanum. 2 digits (C) or 8 digits 9 alphanumerics
(0-4) (0-3) (0-9A-E) 6 digits (L) (1 of 6 patterns)
---------------------------------------------------------------------------
------- ------- ----------- --------------- -------- -----------------
1 digit 1 digit 1 alphanum. 2 digits (C) or 8 digits 9 alphanumerics
(0-4) (0-3) (0-9A-E) 6 digits (L) (1 of 6 patterns)
-----------------------------------------------------------------------------
Table: {#tbl:mailmark_4s_input_fields
tag=": Royal Mail 4-State Mailmark Input Fields"}
@ -4000,9 +4026,9 @@ Table: {#tbl:dmre_sizes tag=": DMRE Sizes"}
DMRE symbol sizes may be activated in automatic size mode using the option
`--dmre` (API `option_3 = DM_DMRE`).
GS1 data may be encoded using FNC1 (default) or GS (Group Separator, ASCII 29)
as separator. Use the option `--gssep` to change to GS (API `output_options |=
GS1_GS_SEPARATOR`).
GS1 data may be encoded using `FNC1` (default) or `GS` (Group Separator, ASCII
29) as separator. Use the option `--gssep` to change to `GS` (API
`output_options |= GS1_GS_SEPARATOR`).
By default Zint uses a "de facto" codeword placement for symbols of size 144 x
144 (version 24). To override this and use the now clarified ISO/IEC standard
@ -4899,7 +4925,7 @@ company references in particular.
May 2004)
- AIM ITS/04-023 International Technical Standard - Extended Channel
Interpretations Part 3: Register (Version 2, February 2022)
- GS1 General Specifications Release 24.0 (Jan 2024)
- GS1 General Specifications Release 25.0 (Jan 2025)
- ANSI/HIBC 2.6-2016 - The Health Industry Bar Code (HIBC) Supplier Labeling
Standard