mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
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)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
Zint Barcode Generator and Zint Barcode Studio User Manual
|
||||
Version 2.12.0.9
|
||||
May 2023
|
||||
June 2023
|
||||
|
||||
*******************************************************************************
|
||||
* For reference the following is a text-only version of the Zint manual, *
|
||||
@ -1497,7 +1497,7 @@ in effect constitute segment 0. For instance
|
||||
specifies 3 segments: segment 0 with ECI 9 (Greek), segment 1 with ECI 7
|
||||
(Cyrillic), and segment 2 with ECI 20 (Shift JIS). Segments must be consecutive.
|
||||
|
||||
The symbology must be ECI-aware (see Table : ECI-Aware Symbologies).
|
||||
Naturally the symbology must be ECI-aware (see Table : ECI-Aware Symbologies).
|
||||
|
||||
[zint -b AZTEC --eci=9 -d "Κείμενο" --seg1=7,"Текст" --seg2=20,"文章"]
|
||||
|
||||
@ -1661,8 +1661,9 @@ The functions for encoding and printing barcodes are defined as:
|
||||
|
||||
In these definitions length can be used to set the length of the input string.
|
||||
This allows the encoding of NUL (ASCII 0) characters in those symbologies which
|
||||
allow this. A value of 0 will disable this usage and Zint will encode data up to
|
||||
the first NUL character in the input string, which must be present.
|
||||
allow this. A value of 0 (or less than 0) will disable this usage and Zint will
|
||||
encode data up to the first NUL character in the input string, which must be
|
||||
present.
|
||||
|
||||
The rotate_angle value can be used to rotate the image when outputting. Valid
|
||||
values are 0, 90, 180 and 270.
|
||||
@ -1775,8 +1776,7 @@ routines available:
|
||||
string->text, string->length);
|
||||
}
|
||||
for (circle = my_symbol->vector->circles; circle; circle = circle->next) {
|
||||
draw_circle(circle->x, circle->y, circle->diameter,
|
||||
circle->width, circle->colour);
|
||||
draw_circle(circle->x, circle->y, circle->diameter, circle->width);
|
||||
}
|
||||
|
||||
5.6 Setting Options
|
||||
@ -2113,6 +2113,12 @@ together when adjusting this value:
|
||||
|
||||
COMPLIANT_HEIGHT Warn if height not compliant and use standard height
|
||||
(if any) as default.
|
||||
|
||||
EANUPC_GUARD_WHITESPACE Add quiet zone indicators (“<” and/or “>”) to HRT
|
||||
whitespace (EAN/UPC).
|
||||
|
||||
EMBED_VECTOR_FONT Embed font in vector output - currently available
|
||||
for SVG output of EAN/UPC only.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
: Table : API output_options Values
|
||||
@ -2528,12 +2534,29 @@ If your input data already includes the check digit symbology BARCODE_UPCA_CHK
|
||||
(35) can be used which takes a 12-digit input and validates the check digit
|
||||
before encoding.
|
||||
|
||||
A quiet zone indicator can be added to the HRT by setting --guardwhitespace (API
|
||||
output_options |= EANUPC_GUARD_WHITESPACE). For UPC, this is only relevant when
|
||||
there is add-on:
|
||||
|
||||
zint -b UPCA -d "72527270270+12345" --guardwhitespace
|
||||
|
||||
or using the API:
|
||||
|
||||
my_symbol->symbology = BARCODE_UPCA;
|
||||
my_symbol->output_options |= EANUPC_GUARD_WHITESPACE;
|
||||
error = ZBarcode_Encode_and_Print(my_symbol, "72527270270+12345", 0, 0);
|
||||
|
||||
[zint -b UPCA --compliantheight -d "72527270270+12345" --guardwhitespace]
|
||||
|
||||
You can adjust the gap between the main symbol and an add-on in multiples of the
|
||||
X-dimension by setting --addongap (API option_2) to a value between 9 (default)
|
||||
and 12. The height in X-dimensions that the guard bars descend below the main
|
||||
bars can be adjusted by setting --guarddescent (API guard_descent) to a value
|
||||
between 0 and 20 (default 5).
|
||||
|
||||
For SVG output, the --embedfont option (API output_options |= EMBED_VECTOR_FONT)
|
||||
will embed the OCR-B font in the file for portability.
|
||||
|
||||
6.1.3.2 UPC Version E
|
||||
|
||||
[zint -b UPCE --compliantheight -d "1123456"]
|
||||
@ -2555,12 +2578,22 @@ If your input data already includes the check digit symbology BARCODE_UPCE_CHK
|
||||
(38) can be used which takes a 7 or 8-digit input and validates the check digit
|
||||
before encoding.
|
||||
|
||||
As with UPC-A, a quiet zone indicator can be added when there is an add-on by
|
||||
setting --guardwhitespace (API output_options |= EANUPC_GUARD_WHITESPACE):
|
||||
|
||||
zint -b UPCE -d "1123456+12" --guardwhitespace
|
||||
|
||||
[zint -b UPCE --compliantheight -d "1123456+12" --guardwhitespace]
|
||||
|
||||
You can adjust the gap between the main symbol and an add-on in multiples of the
|
||||
X-dimension by setting --addongap (API option_2) to a value between 7 (default)
|
||||
and 12. The height in X-dimensions that the guard bars descend below the main
|
||||
bars can be adjusted by setting --guarddescent (API guard_descent) to a value
|
||||
between 0 and 20 (default 5).
|
||||
|
||||
For SVG output, the --embedfont option (API output_options |= EMBED_VECTOR_FONT)
|
||||
will embed the OCR-B font in the file for portability.
|
||||
|
||||
6.1.4 EAN (European Article Number) (ISO 15420)
|
||||
|
||||
6.1.4.1 EAN-2, EAN-5, EAN-8 and EAN-13
|
||||
@ -2598,8 +2631,13 @@ If you are encoding an EAN-8 or EAN-13 symbol and your data already includes the
|
||||
check digit then you can use symbology BARCODE_EANX_CHK (14) which takes an 8 or
|
||||
13-digit input and validates the check digit before encoding.
|
||||
|
||||
Options to adjust the add-on gap and the guard bar descent height are the same
|
||||
as for 6.1.3.2 UPC Version E.
|
||||
Options to add quiet zone indicators, to adjust the add-on gap and the guard bar
|
||||
descent height, and to embed the font are the same as for 6.1.3.2 UPC Version E.
|
||||
For instance:
|
||||
|
||||
zint -b EANX_CHK -d "74323654" --guardwhitespace
|
||||
|
||||
[zint -b EANX_CHK --compliantheight -d "74323654" –guardwhitespace]
|
||||
|
||||
6.1.4.2 SBN, ISBN and ISBN-13
|
||||
|
||||
@ -2608,9 +2646,15 @@ as for 6.1.3.2 UPC Version E.
|
||||
EAN-13 symbols (also known as Bookland EAN-13) can also be produced from 9-digit
|
||||
SBN, 10-digit ISBN or 13-digit ISBN-13 data. The relevant check digit needs to
|
||||
be present in the input data and will be verified before the symbol is
|
||||
generated. In addition EAN-2 and EAN-5 add-on symbols can be added using the +
|
||||
character as with UPC symbols, and there are options to adjust the add-on gap
|
||||
and the guard bar descent height - see 6.1.3.2 UPC Version E.
|
||||
generated.
|
||||
|
||||
As with EAN-13, a quiet zone indicator can be added using --guardwhitespace:
|
||||
|
||||
[zint -b ISBNX --compliantheight -d "9789295055124" --guardwhitespace]
|
||||
|
||||
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 and to embed
|
||||
the font - see 6.1.3.2 UPC Version E.
|
||||
|
||||
6.1.5 Plessey
|
||||
|
||||
@ -2829,9 +2873,9 @@ round brackets, the option --gs1parens (API input_mode |= GS1PARENS_MODE) may be
|
||||
used to signal that AIs are encased in round brackets instead of square ones.
|
||||
|
||||
Fixed length data should be entered at the appropriate length for correct
|
||||
encoding. GS1-128 does not support extended ASCII characters. Check digits for
|
||||
GTIN data AI (01) are not generated and need to be included in the input data.
|
||||
The following is an example of a valid GS1-128 input:
|
||||
encoding. GS1-128 does not support extended ASCII (ISO/IEC 8859-1) characters.
|
||||
Check digits for GTIN data AI (01) are not generated and need to be included in
|
||||
the input data. The following is an example of a valid GS1-128 input:
|
||||
|
||||
zint -b 16 -d "[01]98898765432106[3202]012345[15]991231"
|
||||
|
||||
@ -3051,11 +3095,11 @@ demonstrated by the symbologies below.
|
||||
|
||||
[zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3]
|
||||
|
||||
This is a stacked symbology based on Code 128 which can encode extended ASCII
|
||||
code set data up to a maximum length of 2725 characters. The width of the
|
||||
Codablock-F symbol can be set using the --cols option (API option_2). The height
|
||||
(number of rows) can be set using the --rows option (API option_1). Zint does
|
||||
not currently support encoding of GS1 data in Codablock-F symbols.
|
||||
This is a stacked symbology based on Code 128 which can encode Latin-1 data up
|
||||
to a maximum length of 2725 characters. The width of the Codablock-F symbol can
|
||||
be set using the --cols option (API option_2). The height (number of rows) can
|
||||
be set using the --rows option (API option_1). Zint does not currently support
|
||||
encoding of GS1 data in Codablock-F symbols.
|
||||
|
||||
A separate symbology ID (BARCODE_HIBC_BLOCKF) can be used to encode Health
|
||||
Industry Barcode (HIBC) data which adds a leading '+' character and a modulo-49
|
||||
@ -3067,7 +3111,7 @@ check digit to the encoded data.
|
||||
|
||||
Code 16K uses a Code 128 based system which can stack up to 16 rows in a block.
|
||||
This gives a maximum data capacity of 77 characters or 154 numerical digits and
|
||||
includes two modulo-107 check digits. Code 16K also supports extended ASCII
|
||||
includes two modulo-107 check digits. Code 16K also supports ISO/IEC 8859-1
|
||||
character encoding in the same manner as Code 128. GS1 data encoding is also
|
||||
supported. The minimum number of rows to use can be set using the --rows option
|
||||
(API option_1), with values from 2 to 16.
|
||||
@ -4408,7 +4452,7 @@ defined.
|
||||
|
||||
Annex B. Man Page ZINT(1)
|
||||
|
||||
% ZINT(1) Version 2.12.0.9 % % May 2023
|
||||
% ZINT(1) Version 2.12.0.9 % % June 2023
|
||||
|
||||
NAME
|
||||
|
||||
@ -4548,6 +4592,11 @@ OPTIONS
|
||||
Matrix, DotCode, Grid Matrix, Han Xin Code, MaxiCode, MicroPDF417, PDF417,
|
||||
QR Code, rMQR and Ultracode.
|
||||
|
||||
--embedfont
|
||||
|
||||
For vector output, embed the font in the file for portability. Currently
|
||||
only available for SVG output of EAN/UPC barcodes.
|
||||
|
||||
--esc
|
||||
|
||||
Process escape characters in the input data. The escape sequences are:
|
||||
@ -4627,6 +4676,11 @@ OPTIONS
|
||||
bars, where NUMBER is in multiples of the X-dimension. NUMBER may be
|
||||
floating-point.
|
||||
|
||||
--guardwhitespace
|
||||
|
||||
For EAN/UPC symbols, add quiet zone indicators "<" and/or ">" to HRT where
|
||||
applicable.
|
||||
|
||||
--height=NUMBER
|
||||
|
||||
Set the height of the symbol in multiples of the X-dimension. NUMBER may be
|
||||
|
Reference in New Issue
Block a user