mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-16 08:04:36 -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:
parent
ddedd00d2d
commit
fef8b083b4
82 changed files with 2873 additions and 1671 deletions
121
docs/manual.html
121
docs/manual.html
|
@ -1440,8 +1440,8 @@ is hexadecimal (000000-10FFFF)</td>
|
|||
</table>
|
||||
</div>
|
||||
<p>(Special escape sequences are available for Code 128 only to manually
|
||||
switch Code Sets and insert special FNC1 characters - see <a
|
||||
href="#standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO
|
||||
switch Code Sets and insert special <code>FNC1</code> characters - see
|
||||
<a href="#standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO
|
||||
15417)</a> for details.)</p>
|
||||
<p>Input data can be read directly from file using the <code>-i</code>
|
||||
or <code>--input</code> switch as shown below. The input file is assumed
|
||||
|
@ -3555,6 +3555,12 @@ with a terminating <code>NUL</code>.</td>
|
|||
<td style="text-align: left;"><code>""</code> (empty) (output only)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;"><code>text_length</code></td>
|
||||
<td style="text-align: left;">integer</td>
|
||||
<td style="text-align: left;">Length of <code>text</code>.</td>
|
||||
<td style="text-align: left;">0 (output only)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;"><code>rows</code></td>
|
||||
<td style="text-align: left;">integer</td>
|
||||
<td style="text-align: left;">Number of rows used by the symbol.</td>
|
||||
|
@ -3891,8 +3897,8 @@ than squares.</td>
|
|||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;"><code>GS1_GS_SEPARATOR</code></td>
|
||||
<td style="text-align: left;">Use GS (Group Separator) instead of FNC1
|
||||
as GS1 separator (Data Matrix only).</td>
|
||||
<td style="text-align: left;">Use <code>GS</code> (Group Separator)
|
||||
instead of <code>FNC1</code> as GS1 separator (Data Matrix only).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;"><code>OUT_BUFFER_INTERMEDIATE</code></td>
|
||||
|
@ -3934,6 +3940,18 @@ available for SVG output only.</td>
|
|||
<code>symbol->memfile</code> instead of to <code>outfile</code>
|
||||
file.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;"><code>BARCODE_PLAIN_HRT</code></td>
|
||||
<td style="text-align: left;">Set HRT with no decoration,<a href="#fn13"
|
||||
class="footnote-ref" id="fnref13" role="doc-noteref"><sup>13</sup></a>
|
||||
complete with any control characters<a href="#fn14" class="footnote-ref"
|
||||
id="fnref14" role="doc-noteref"><sup>14</sup></a> and check
|
||||
characters,<a href="#fn15" class="footnote-ref" id="fnref15"
|
||||
role="doc-noteref"><sup>15</sup></a> and for all linear symbologies,
|
||||
including those that normally don’t set it.<a href="#fn16"
|
||||
class="footnote-ref" id="fnref16"
|
||||
role="doc-noteref"><sup>16</sup></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -3967,7 +3985,7 @@ binary data.</td>
|
|||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;"><code>GS1_MODE</code></td>
|
||||
<td style="text-align: left;">Encodes GS1 data using FNC1
|
||||
<td style="text-align: left;">Encodes GS1 data using <code>FNC1</code>
|
||||
characters.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -4195,8 +4213,8 @@ Text?</td>
|
|||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;"><code>ZINT_CAP_EANUPC</code><a
|
||||
href="#fn13" class="footnote-ref" id="fnref13"
|
||||
role="doc-noteref"><sup>13</sup></a></td>
|
||||
href="#fn17" class="footnote-ref" id="fnref17"
|
||||
role="doc-noteref"><sup>17</sup></a></td>
|
||||
<td style="text-align: left;">Is the symbology EAN/UPC?</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -4421,13 +4439,13 @@ aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270"</code><
|
|||
<p>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:</p>
|
||||
added using the <code>+</code> 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:</p>
|
||||
<div class="sourceCode" id="cb88"><pre
|
||||
class="sourceCode bash"><code class="sourceCode bash"><span id="cb88-1"><a href="#cb88-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCA <span class="at">-d</span> <span class="st">"72527270270+12345"</span></span></code></pre></div>
|
||||
<p>or using the API encode a data string with the + character
|
||||
included:</p>
|
||||
<p>or using the API encode a data string with the <code>+</code>
|
||||
character included:</p>
|
||||
<div class="sourceCode" id="cb89"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb89-1"><a href="#cb89-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_UPCA<span class="op">;</span></span>
|
||||
<span id="cb89-2"><a href="#cb89-2" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">"72527270270+12345"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
|
||||
<figure>
|
||||
|
@ -4515,8 +4533,8 @@ aria-hidden="true"><code>zint -b EANX --compliantheight -d "4512345678906"</code
|
|||
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:</p>
|
||||
symbols can be added to EAN-8 and EAN-13 symbols using the
|
||||
<code>+</code> character as with UPC symbols. For example:</p>
|
||||
<div class="sourceCode" id="cb95"><pre
|
||||
class="sourceCode bash"><code class="sourceCode bash"><span id="cb95-1"><a href="#cb95-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">"54321"</span></span></code></pre></div>
|
||||
<figure>
|
||||
|
@ -4578,9 +4596,10 @@ alt="zint -b ISBNX --compliantheight -d "9789295055124" --guardwhitesp
|
|||
<figcaption
|
||||
aria-hidden="true"><code>zint -b ISBNX --compliantheight -d "9789295055124" --guardwhitespace</code></figcaption>
|
||||
</figure>
|
||||
<p>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 <a href="#upc-version-e">6.1.3.2 UPC Version E</a>.</p>
|
||||
<p>EAN-2 and EAN-5 add-on symbols can be added using the <code>+</code>
|
||||
character, and there are options to adjust the add-on gap and the guard
|
||||
bar descent height - see <a href="#upc-version-e">6.1.3.2 UPC Version
|
||||
E</a>.</p>
|
||||
<h3 id="plessey">6.1.5 Plessey</h3>
|
||||
<h4 id="uk-plessey">6.1.5.1 UK Plessey</h4>
|
||||
<figure>
|
||||
|
@ -4591,8 +4610,10 @@ aria-hidden="true"><code>zint -b PLESSEY -d "C64"</code></figcaption>
|
|||
</figure>
|
||||
<p>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.</p>
|
||||
digits (0-9) or letters 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 <code>--vers=1</code> (API
|
||||
<code>option_2 |= 1</code>).</p>
|
||||
<h4 id="msi-plessey">6.1.5.2 MSI Plessey</h4>
|
||||
<figure>
|
||||
<img src="images/msi_plessey.svg" title="fig:" class="lin"
|
||||
|
@ -4851,8 +4872,8 @@ escaped by doubling the caret (<code>^</code>). For instance</p>
|
|||
class="sourceCode bash"><code class="sourceCode bash"><span id="cb100-1"><a href="#cb100-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">"\^AABC\^^BDEF"</span> <span class="at">--extraesc</span></span></code></pre></div>
|
||||
<p>will encode the data <code>"ABC\^BDEF"</code> in Code Set A.</p>
|
||||
<p>There is also the extra escape <code>\^1</code>, which will encode a
|
||||
special Function Code 1 character (FNC1) anywhere you chose in the data,
|
||||
for instance</p>
|
||||
special Function Code 1 character (<code>FNC1</code>) anywhere you chose
|
||||
in the data, for instance</p>
|
||||
<div class="sourceCode" id="cb101"><pre
|
||||
class="sourceCode bash"><code class="sourceCode bash"><span id="cb101-1"><a href="#cb101-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">"A\^1BC\^1DEF"</span> <span class="at">--extraesc</span></span></code></pre></div>
|
||||
<p>Zint can encode a maximum of 102 symbol characters, which allows for
|
||||
|
@ -4868,8 +4889,8 @@ aria-hidden="true"><code>zint -b CODE128AB -d "130170X178"</code></figcaption>
|
|||
</figure>
|
||||
<p>It is sometimes advantageous to stop Code 128 from using Code Set C
|
||||
which compresses numerical data. The <code>BARCODE_CODE128AB</code><a
|
||||
href="#fn14" class="footnote-ref" id="fnref14"
|
||||
role="doc-noteref"><sup>14</sup></a> variant (symbology 60) suppresses
|
||||
href="#fn18" class="footnote-ref" id="fnref18"
|
||||
role="doc-noteref"><sup>18</sup></a> variant (symbology 60) suppresses
|
||||
Code Set C in favour of Code Sets A and B.</p>
|
||||
<p>Note that the special extra escapes mentioned above are not available
|
||||
for this variant (nor for any other).</p>
|
||||
|
@ -5609,8 +5630,8 @@ the 6-digit version the first and last digit are ignored, leaving a
|
|||
2047. The second format <code>"NNN-NN"</code> represents the DX Extract
|
||||
as two numbers separated by a dash (<code>-</code>), the first number
|
||||
being 1 to 3 digits (range 1 to 127) and the second 1 to 2 digits (range
|
||||
0 to 15).<a href="#fn15" class="footnote-ref" id="fnref15"
|
||||
role="doc-noteref"><sup>15</sup></a></p>
|
||||
0 to 15).<a href="#fn19" class="footnote-ref" id="fnref19"
|
||||
role="doc-noteref"><sup>19</sup></a></p>
|
||||
<p>The optional frame number is a number in the range 0 to 63, and may
|
||||
have a half frame indicator <code>"A"</code> appended. Special character
|
||||
sequences (with or without a half frame indicator appended) may also be
|
||||
|
@ -5762,16 +5783,16 @@ characters, producing a symbol with 66 or 78 bars respectively. The
|
|||
rules for the input data are complex, as summarized in the following
|
||||
table.</p>
|
||||
<div id="tbl:mailmark_4s_input_fields" class="tablenos">
|
||||
<table id="tbl:mailmark_4s_input_fields" style="width:100%;"
|
||||
<table id="tbl:mailmark_4s_input_fields"
|
||||
data-tag=": Royal Mail 4-State Mailmark Input Fields">
|
||||
<caption><span>Table : Royal Mail 4-State Mailmark Input Fields</span>
|
||||
</caption>
|
||||
<colgroup>
|
||||
<col style="width: 11%" />
|
||||
<col style="width: 11%" />
|
||||
<col style="width: 17%" />
|
||||
<col style="width: 22%" />
|
||||
<col style="width: 13%" />
|
||||
<col style="width: 16%" />
|
||||
<col style="width: 23%" />
|
||||
<col style="width: 14%" />
|
||||
<col style="width: 23%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
|
@ -6108,9 +6129,10 @@ generated with the following values as before:</p>
|
|||
</div>
|
||||
<p>DMRE symbol sizes may be activated in automatic size mode using the
|
||||
option <code>--dmre</code> (API <code>option_3 = DM_DMRE</code>).</p>
|
||||
<p>GS1 data may be encoded using FNC1 (default) or GS (Group Separator,
|
||||
ASCII 29) as separator. Use the option <code>--gssep</code> to change to
|
||||
GS (API <code>output_options |= GS1_GS_SEPARATOR</code>).</p>
|
||||
<p>GS1 data may be encoded using <code>FNC1</code> (default) or
|
||||
<code>GS</code> (Group Separator, ASCII 29) as separator. Use the option
|
||||
<code>--gssep</code> to change to <code>GS</code> (API
|
||||
<code>output_options |= GS1_GS_SEPARATOR</code>).</p>
|
||||
<p>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 placement, use option <code>--dmiso144</code> (API
|
||||
|
@ -8227,7 +8249,7 @@ Interpretations Part 1: Identification Schemes and Protocol (Released
|
|||
24th May 2004)</li>
|
||||
<li>AIM ITS/04-023 International Technical Standard - Extended Channel
|
||||
Interpretations Part 3: Register (Version 2, February 2022)</li>
|
||||
<li>GS1 General Specifications Release 24.0 (Jan 2024)</li>
|
||||
<li>GS1 General Specifications Release 25.0 (Jan 2025)</li>
|
||||
<li>ANSI/HIBC 2.6-2016 - The Health Industry Bar Code (HIBC) Supplier
|
||||
Labeling Standard</li>
|
||||
</ul>
|
||||
|
@ -9315,6 +9337,7 @@ Code 39 1 or 2 (add visible or hidden check digit)
|
|||
Code 93 1 (show the default check characters)
|
||||
EXCODE39 1 or 2 (add visible or hidden check digit)
|
||||
LOGMARS 1 or 2 (add visible or hidden check digit)
|
||||
UK Plessey 1 (show the default check characters)
|
||||
MSI Plessey 0 to 6 (none to various visible options)
|
||||
1, 2 (mod-10, mod-10 + mod-10)
|
||||
3, 4 (mod-11 IBM, mod-11 IBM + mod-10)
|
||||
|
@ -9522,16 +9545,36 @@ class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
|||
<li id="fn12"><p>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.<a
|
||||
href="#fnref12" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
<li id="fn13"><p><code>ZINT_CAP_EANUPC</code> was previously named
|
||||
<li id="fn13"><p>In particular no parentheses will appear in the HRT for
|
||||
GS1 symbologies, and <code>GS</code> 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 <code>+</code>
|
||||
character.<a href="#fnref13" class="footnote-back"
|
||||
role="doc-backlink">↩︎</a></p></li>
|
||||
<li id="fn14"><p>Normally control characters (including
|
||||
<code>DEL</code>) and non-ISO/IEC 8859-1 are replaced by spaces in the
|
||||
HRT.<a href="#fnref14" class="footnote-back"
|
||||
role="doc-backlink">↩︎</a></p></li>
|
||||
<li id="fn15"><p>Except for Japanese Postal Code, whose check character
|
||||
is not truly representable in HRT.<a href="#fnref15"
|
||||
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
<li id="fn16"><p>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.<a href="#fnref16" class="footnote-back"
|
||||
role="doc-backlink">↩︎</a></p></li>
|
||||
<li id="fn17"><p><code>ZINT_CAP_EANUPC</code> was previously named
|
||||
<code>ZINT_CAP_EXTENDABLE</code>, which is still recognised.<a
|
||||
href="#fnref13" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
<li id="fn14"><p><code>BARCODE_CODE128AB</code> previously used the name
|
||||
href="#fnref17" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
<li id="fn18"><p><code>BARCODE_CODE128AB</code> previously used the name
|
||||
<code>BARCODE_CODE128B</code>, which is still recognised.<a
|
||||
href="#fnref14" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
<li id="fn15"><p>The DX number may be looked up in The (Modified) Big
|
||||
href="#fnref18" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
<li id="fn19"><p>The DX number may be looked up in The (Modified) Big
|
||||
Film Database at <a
|
||||
href="https://thebigfilmdatabase.merinorus.com">https://thebigfilmdatabase.merinorus.com</a>.<a
|
||||
href="#fnref15" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
href="#fnref19" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
</ol>
|
||||
</section>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue