mirror of
https://git.code.sf.net/p/zint/code
synced 2025-12-18 02:17:06 +00:00
CODE128: optimize for extended ASCII as well using techniques from
BWIPP minimal encoding by Bue Jensen (BWIPP PR #278); new extra escape `\^@` to turn off manual switching zint.h: increase `symbol->text` size 200 -> 256 (means that for the moment can no longer generate ZINT_WARN_HRT_TRUNCATED) GS1_128/GS1_128_CC: warn if READER_INIT option used CODE16K: move `c16k_set_a/b/c()` routines from "code128.c" and rename `c16k_` (also `C128_` defines to `C16K_`) common: make `itoc()` simple macro which adds '0' (>= 10 now ':', ';' etc) and adjust `expand()` accordingly for slight speed-up general: EXTRA_ESCAPE_MODE now implies ESCAPE_MODE tests: update BWIPP to latest and enable CODE128AB ("suppressc"); new test args '-n' (exclude func) and '-m' (match func)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
% Zint Barcode Generator and Zint Barcode Studio User Manual
|
||||
% Version 2.13.0.9
|
||||
% October 2024
|
||||
% November 2024
|
||||
|
||||
# 1. Introduction
|
||||
|
||||
@@ -1893,12 +1893,12 @@ int main(int argc, char **argv)
|
||||
{
|
||||
struct zint_symbol *my_symbol;
|
||||
my_symbol = ZBarcode_Create();
|
||||
my_symbol->output_options |= BARCODE_MEMORY_FILE;
|
||||
/* Only the extension is used, to determine output format */
|
||||
strcpy(my_symbol->outfile, "mem.svg");
|
||||
my_symbol->output_options |= BARCODE_MEMORY_FILE;
|
||||
/* Only the extension is used, to determine output format */
|
||||
strcpy(my_symbol->outfile, "mem.svg");
|
||||
ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
|
||||
/* `my_symbol->memfile` now contains the SVG output */
|
||||
fwrite(my_symbol->memfile, 1, my_symbol->memfile_size, stdout);
|
||||
/* `my_symbol->memfile` now contains the SVG output */
|
||||
fwrite(my_symbol->memfile, 1, my_symbol->memfile_size, stdout);
|
||||
ZBarcode_Delete(my_symbol);
|
||||
return 0;
|
||||
}
|
||||
@@ -2143,7 +2143,7 @@ detailing the nature of the error. The errors generated by Zint are:
|
||||
Return Value Meaning
|
||||
----------------------------- -----------------------------------------------
|
||||
`ZINT_WARN_HRT_TRUNCATED` The Human Readable Text returned in `text` was
|
||||
truncated (maximum 199 bytes).
|
||||
truncated (maximum 255 bytes).
|
||||
|
||||
`ZINT_WARN_INVALID_OPTION` One of the values in `zint_struct` was set
|
||||
incorrectly but Zint has made a guess at what
|
||||
@@ -3109,22 +3109,30 @@ pharmaceuticals. The symbology is able to encode whole numbers between 3 and
|
||||
One of the most ubiquitous one-dimensional barcode symbologies, Code 128 was
|
||||
developed in 1981 by Computer Identics. This symbology supports full ASCII text
|
||||
and uses a three-Code Set system to compress the data into a smaller symbol.
|
||||
Zint automatically switches between Code Sets A, B and C (but see following) and
|
||||
Zint automatically switches between Code Sets A, B and C (but see below) and
|
||||
adds a hidden modulo-103 check digit.
|
||||
|
||||
Code 128 is the default barcode symbology used by Zint. In addition Zint
|
||||
supports the encoding of ISO/IEC 8859-1 (non-English) characters in Code 128
|
||||
symbols. The ISO/IEC 8859-1 character set is shown in Annex [A.2 Latin Alphabet
|
||||
No. 1 (ISO/IEC 8859-1)].
|
||||
|
||||
Manual switching of Code Sets is possible using the `--extraesc` option (API
|
||||
`input_mode |= EXTRA_ESCAPE_MODE`) and the Code 128-specific escapes `\^A`,
|
||||
`\^B`, `\^C`. For instance the following will force switching to Code Set B for
|
||||
the data `"5678"` (normally Code Set C would be used throughout):
|
||||
`input_mode |= EXTRA_ESCAPE_MODE`), which apart from processing normal escape
|
||||
sequences also processes the Code 128-specific escapes `\^A`, `\^B`, `\^C` and
|
||||
`\^@` (the latter turns off manual Code Set selection). For instance the
|
||||
following will force switching to Code Set B for the data `"5678"` (normally
|
||||
Code Set C would be used throughout):
|
||||
|
||||
```bash
|
||||
zint -b CODE128 -d "1234\^B5678" --extraesc
|
||||
```
|
||||
|
||||
The manually selected Code Set will apply until the next Code Set escape
|
||||
sequence, with the exception that data that cannot be represented in that Code
|
||||
Set will be switched as appropriate. If the data contains a special code
|
||||
sequence, it can be escaped by doubling the caret (`^`). For instance
|
||||
sequence or until a `\^@`, with the exception that data that cannot be
|
||||
represented in that Code Set will be switched as appropriate. If the data
|
||||
contains an extra escape sequence, it can be escaped by doubling the caret
|
||||
(`^`). For instance
|
||||
|
||||
```bash
|
||||
zint -b CODE128 -d "\^AABC\^^BDEF" --extraesc
|
||||
@@ -3139,13 +3147,9 @@ There is also the extra escape `\^1`, which will encode a special Function Code
|
||||
zint -b CODE128 -d "A\^1BC\^1DEF" --extraesc
|
||||
```
|
||||
|
||||
Code 128 is the default barcode symbology used by Zint. In addition Zint
|
||||
supports the encoding of ISO/IEC 8859-1 (non-English) characters in Code 128
|
||||
symbols. The ISO/IEC 8859-1 character set is shown in Annex [A.2 Latin Alphabet
|
||||
No. 1 (ISO/IEC 8859-1)].
|
||||
|
||||
Zint can encode a maximum of 99 symbol characters, which allows for e.g. 198
|
||||
all-numeric characters.
|
||||
Zint can encode a maximum of 102 symbol characters, which allows for e.g. 202
|
||||
all-numeric or 101 all-uppercase characters. Sizes above 120 digits (60
|
||||
alphanumerics) are not recommended.
|
||||
|
||||
#### 6.1.10.2 Code 128 Suppress Code Set C (Code Sets A and B only)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user