From 81308f49572da718b7965a3f73b9b86b68040fe6 Mon Sep 17 00:00:00 2001 From: gitlost Date: Tue, 25 Feb 2025 16:45:28 +0000 Subject: [PATCH] Reinstate `BARCODE_RAW_TEXT` (note forgot to remove mention of `ZINT_WARN_HRT_RAW_TEXT` in man page zint.1.pmd last time) --- ChangeLog | 6 +++- backend/common.h | 4 --- backend/tests/test_2of5.c | 2 -- backend/tests/test_auspost.c | 2 -- backend/tests/test_codabar.c | 2 -- backend/tests/test_code.c | 2 -- backend/tests/test_code128.c | 2 -- backend/tests/test_common.c | 4 --- backend/tests/test_composite.c | 2 -- backend/tests/test_dxfilmedge.c | 2 -- backend/tests/test_gs1.c | 2 -- backend/tests/test_imail.c | 2 -- backend/tests/test_mailmark.c | 2 -- backend/tests/test_medical.c | 2 -- backend/tests/test_plessey.c | 2 -- backend/tests/test_postal.c | 2 -- backend/tests/test_raster.c | 4 --- backend/tests/test_rss.c | 2 -- backend/tests/test_telepen.c | 2 -- backend/tests/test_vector.c | 4 --- backend/zint.h | 7 +++- docs/manual.html | 58 ++++++++++++++++++++++++++------- docs/manual.pmd | 34 +++++++++++++++---- docs/manual.txt | 34 +++++++++++++++---- 24 files changed, 113 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56aa14e4..ea3c156c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,11 @@ Version 2.15.0.9 (dev) not released yet (2025-02-25) ==================================================== -No changes yet +Changes +------- + +- Add new `BARCODE_RAW_TEXT` option for `output_options` and new warning + `ZINT_WARN_HRT_RAW_TEXT` for when set when outputting HRT Version 2.15.0 (2025-02-25) diff --git a/backend/common.h b/backend/common.h index 21fbf3a3..d8d5fc2f 100644 --- a/backend/common.h +++ b/backend/common.h @@ -42,10 +42,6 @@ extern "C" { #include #include -#define BARCODE_RAW_TEXT 0 /* BARCODE_RAW_TEXT temporarily disabled */ -#define ZINT_WARN_HRT_RAW_TEXT -1 /* BARCODE_RAW_TEXT temporarily disabled */ -#define ZINT_ERROR_HRT_RAW_TEXT 16 /* BARCODE_RAW_TEXT temporarily disabled */ - /* Determine if C89 (excluding MSVC, which doesn't define __STDC_VERSION__) */ #ifndef _MSC_VER # if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199000L diff --git a/backend/tests/test_2of5.c b/backend/tests/test_2of5.c index dcb7dde1..a4f5857b 100644 --- a/backend/tests/test_2of5.c +++ b/backend/tests/test_2of5.c @@ -181,8 +181,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_auspost.c b/backend/tests/test_auspost.c index fe0e93c9..d494ac4f 100644 --- a/backend/tests/test_auspost.c +++ b/backend/tests/test_auspost.c @@ -143,8 +143,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_codabar.c b/backend/tests/test_codabar.c index 69eb1a1d..1d93e332 100644 --- a/backend/tests/test_codabar.c +++ b/backend/tests/test_codabar.c @@ -123,8 +123,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_code.c b/backend/tests/test_code.c index f9eb378d..0fb1c4af 100644 --- a/backend/tests/test_code.c +++ b/backend/tests/test_code.c @@ -196,8 +196,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_code128.c b/backend/tests/test_code128.c index bf3048ce..9122e1dc 100644 --- a/backend/tests/test_code128.c +++ b/backend/tests/test_code128.c @@ -270,8 +270,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_common.c b/backend/tests/test_common.c index c91cb631..14a308b7 100644 --- a/backend/tests/test_common.c +++ b/backend/tests/test_common.c @@ -779,9 +779,6 @@ static void test_hrt_cpy_iso8859_1(const testCtx *const p_ctx) { assert_zero(strcmp((char *) symbol->text, data[i].expected), "i:%d symbol->text (%s) != expected (%s)\n", i, symbol->text, data[i].expected); - #if 1 /* BARCODE_RAW_TEXT temporarily disabled */ - (void)expected; - #else memset(symbol, 0, sizeof(*symbol)); symbol->output_options = BARCODE_RAW_TEXT; @@ -800,7 +797,6 @@ static void test_hrt_cpy_iso8859_1(const testCtx *const p_ctx) { assert_equal(symbol->text_length, expected_length, "i:%d text_length %d != expected_length %d\n", i, symbol->text_length, expected_length); assert_zero(memcmp(symbol->text, expected, symbol->text_length), "i:%d symbol->text (%s) != expected (%s)\n", i, symbol->text, expected); - #endif } testFinish(); diff --git a/backend/tests/test_composite.c b/backend/tests/test_composite.c index 61670bce..20223d28 100644 --- a/backend/tests/test_composite.c +++ b/backend/tests/test_composite.c @@ -3290,8 +3290,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_dxfilmedge.c b/backend/tests/test_dxfilmedge.c index 65b6acf1..13a7a472 100644 --- a/backend/tests/test_dxfilmedge.c +++ b/backend/tests/test_dxfilmedge.c @@ -68,8 +68,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_gs1.c b/backend/tests/test_gs1.c index 1f8ed591..ad05ef7b 100644 --- a/backend/tests/test_gs1.c +++ b/backend/tests/test_gs1.c @@ -373,8 +373,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_imail.c b/backend/tests/test_imail.c index 0ab504ff..30a0fa35 100644 --- a/backend/tests/test_imail.c +++ b/backend/tests/test_imail.c @@ -187,8 +187,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_mailmark.c b/backend/tests/test_mailmark.c index fd57a5f5..2b17c27f 100644 --- a/backend/tests/test_mailmark.c +++ b/backend/tests/test_mailmark.c @@ -64,8 +64,6 @@ static void test_4s_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_medical.c b/backend/tests/test_medical.c index 6a16a516..1f214e49 100644 --- a/backend/tests/test_medical.c +++ b/backend/tests/test_medical.c @@ -148,8 +148,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_plessey.c b/backend/tests/test_plessey.c index 1d829b3d..dbb41655 100644 --- a/backend/tests/test_plessey.c +++ b/backend/tests/test_plessey.c @@ -203,8 +203,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_postal.c b/backend/tests/test_postal.c index a7c04b27..19045637 100644 --- a/backend/tests/test_postal.c +++ b/backend/tests/test_postal.c @@ -260,8 +260,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_raster.c b/backend/tests/test_raster.c index fbad130b..7dabc1d7 100644 --- a/backend/tests/test_raster.c +++ b/backend/tests/test_raster.c @@ -558,8 +558,6 @@ static void test_upcean_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); @@ -3172,8 +3170,6 @@ static void test_hrt_raw_text(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].ret == ZINT_WARN_HRT_RAW_TEXT || !data[i].show_hrt) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_rss.c b/backend/tests/test_rss.c index b3728da9..fa9e78d5 100644 --- a/backend/tests/test_rss.c +++ b/backend/tests/test_rss.c @@ -1339,8 +1339,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_telepen.c b/backend/tests/test_telepen.c index 693246de..7145d1e1 100644 --- a/backend/tests/test_telepen.c +++ b/backend/tests/test_telepen.c @@ -130,8 +130,6 @@ static void test_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/tests/test_vector.c b/backend/tests/test_vector.c index 2c191c59..b1267612 100644 --- a/backend/tests/test_vector.c +++ b/backend/tests/test_vector.c @@ -1006,8 +1006,6 @@ static void test_upcean_hrt(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].output_options == BARCODE_RAW_TEXT) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); @@ -3177,8 +3175,6 @@ static void test_hrt_raw_text(const testCtx *const p_ctx) { if (testContinue(p_ctx, i)) continue; - if (data[i].ret == ZINT_WARN_HRT_RAW_TEXT || !data[i].show_hrt) continue; /* BARCODE_RAW_TEXT temporarily disabled */ - symbol = ZBarcode_Create(); assert_nonnull(symbol, "Symbol not created\n"); diff --git a/backend/zint.h b/backend/zint.h index 3cd78428..dce15dc5 100644 --- a/backend/zint.h +++ b/backend/zint.h @@ -123,7 +123,7 @@ extern "C" { int warn_level; /* Affects error/warning value returned by Zint API (see WARN_XXX below) */ int debug; /* Debugging flags */ unsigned char text[256]; /* Human Readable Text (HRT) (if any), UTF-8, NUL-terminated (output only) */ - int text_length; /* Length of text in bytes (output only) */ + int text_length; /* Length of text in bytes, useful if BARCODE_RAW_TEXT when may have NULs (output only) */ int rows; /* Number of rows used by the symbol (output only) */ int width; /* Width of the generated symbol (output only) */ unsigned char encoded_data[200][144]; /* Encoded data (output only). Allows for rows of 1152 modules */ @@ -299,6 +299,9 @@ extern "C" { #define EANUPC_GUARD_WHITESPACE 0x04000 /* Add quiet zone indicators ("<"/">") to HRT whitespace (EAN/UPC) */ #define EMBED_VECTOR_FONT 0x08000 /* Embed font in vector output - currently only for SVG output */ #define BARCODE_MEMORY_FILE 0x10000 /* Write output to in-memory buffer `memfile` instead of to `outfile` */ +#define BARCODE_RAW_TEXT 0x20000 /* Set HRT with no decoration (GS1 data will not have parentheses but GS + separators as needed), complete with any control chars and check chars, and + for all linear symbologies, including those that normally don't set it */ /* Input data types (`symbol->input_mode`) */ #define DATA_MODE 0 /* Binary */ @@ -326,6 +329,7 @@ extern "C" { #define ULTRA_COMPRESSION 128 /* Enable Ultracode compression (experimental) */ /* Warning and error conditions (API return values) */ +#define ZINT_WARN_HRT_RAW_TEXT -1 /* Human Readable Text outputted with BARCODE_RAW_TEXT */ #define ZINT_WARN_HRT_TRUNCATED 1 /* Human Readable Text was truncated (max 199 bytes) */ #define ZINT_WARN_INVALID_OPTION 2 /* Invalid option given but overridden by Zint */ #define ZINT_WARN_USES_ECI 3 /* Automatic ECI inserted by Zint */ @@ -342,6 +346,7 @@ extern "C" { #define ZINT_ERROR_USES_ECI 13 /* Error counterpart of warning if WARN_FAIL_ALL set (see below) */ #define ZINT_ERROR_NONCOMPLIANT 14 /* Error counterpart of warning if WARN_FAIL_ALL set */ #define ZINT_ERROR_HRT_TRUNCATED 15 /* Error counterpart of warning if WARN_FAIL_ALL set */ +#define ZINT_ERROR_HRT_RAW_TEXT 16 /* Error counterpart of warning if WARN_FAIL_ALL set */ /* Warning level (`symbol->warn_level`) */ #define WARN_DEFAULT 0 /* Default behaviour */ diff --git a/docs/manual.html b/docs/manual.html index 516c8dfd..635ad652 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -3693,6 +3693,12 @@ data-tag=": API Warning and Error Return Values"> +ZINT_WARN_HRT_RAW_TEXT +The Human Readable Text returned in +text was outputted as raw text (output_options +set to BARCODE_RAW_TEXT). + + ZINT_WARN_HRT_TRUNCATED The Human Readable Text returned in text was truncated (maximum 255 bytes). @@ -3785,6 +3791,12 @@ occurs. WARN_FAIL_ALL and ZINT_WARN_HRT_TRUNCATED occurs. + +ZINT_ERROR_HRT_RAW_TEXT +Returned if warn_level set to +WARN_FAIL_ALL and ZINT_WARN_HRT_RAW_TEXT +occurs. + @@ -3941,6 +3953,16 @@ available for SVG output only. symbol->memfile instead of to outfile file. + +BARCODE_RAW_TEXT +Set HRT with no decoration,14 +complete with any control characters15 and check +characters,16 and for all linear symbologies, +including those that normally don’t set it. + @@ -4202,8 +4224,8 @@ Text? ZINT_CAP_EANUPC14 +href="#fn17" class="footnote-ref" id="fnref17" +role="doc-noteref">17 Is the symbology EAN/UPC? @@ -4878,8 +4900,8 @@ aria-hidden="true">zint -b CODE128AB -d "130170X178"

It is sometimes advantageous to stop Code 128 from using Code Set C which compresses numerical data. The BARCODE_CODE128AB15 variant (symbology 60) suppresses +href="#fn18" class="footnote-ref" id="fnref18" +role="doc-noteref">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).

@@ -5619,8 +5641,8 @@ the 6-digit version the first and last digit are ignored, leaving a 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).16

+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 half frame indicator appended) may also be @@ -9553,16 +9575,28 @@ class="footnote-back" role="doc-backlink">↩︎

  • 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.↩︎

  • -
  • ZINT_CAP_EANUPC was previously named +

  • In particular no parentheses will appear in the HRT for +GS1 symbologies, and GS separators will be added as +required. However for EAN/UPC symbologies, any add-on data will be +separated by a + character as usual.↩︎

  • +
  • Normally control characters (including +DEL) and non-ISO/IEC 8859-1 are replaced by spaces in the +HRT.↩︎

  • +
  • Except for Japanese Postal Code, whose check character +is not truly representable in HRT.↩︎

  • +
  • ZINT_CAP_EANUPC was previously named ZINT_CAP_EXTENDABLE, which is still recognised.↩︎

  • -
  • BARCODE_CODE128AB previously used the name +href="#fnref17" class="footnote-back" role="doc-backlink">↩︎

  • +
  • BARCODE_CODE128AB previously used the name BARCODE_CODE128B, which is still recognised.↩︎

  • -
  • The DX number may be looked up in The (Modified) Big +href="#fnref18" class="footnote-back" role="doc-backlink">↩︎

  • +
  • The DX number may be looked up in The (Modified) Big Film Database at https://thebigfilmdatabase.merinorus.com.↩︎

  • +href="#fnref19" class="footnote-back" role="doc-backlink">↩︎

    diff --git a/docs/manual.pmd b/docs/manual.pmd index 16dc2b9d..96073ff7 100644 --- a/docs/manual.pmd +++ b/docs/manual.pmd @@ -2154,6 +2154,10 @@ detailing the nature of the error. The errors generated by Zint are: ------------------------------------------------------------------------------ Return Value Meaning ----------------------------- ----------------------------------------------- +`ZINT_WARN_HRT_RAW_TEXT` The Human Readable Text returned in `text` was + outputted as raw text (`output_options` set to + `BARCODE_RAW_TEXT`). + `ZINT_WARN_HRT_TRUNCATED` The Human Readable Text returned in `text` was truncated (maximum 255 bytes). @@ -2215,6 +2219,9 @@ Return Value Meaning `ZINT_ERROR_HRT_TRUNCATED` Returned if `warn_level` set to `WARN_FAIL_ALL` and `ZINT_WARN_HRT_TRUNCATED` occurs. + +`ZINT_ERROR_HRT_RAW_TEXT` Returned if `warn_level` set to `WARN_FAIL_ALL` + and `ZINT_WARN_HRT_RAW_TEXT` occurs. ------------------------------------------------------------------------------ Table: {#tbl:api_warnings_errors tag=": API Warning and Error Return Values"} @@ -2331,6 +2338,11 @@ Value Effect `BARCODE_MEMORY_FILE` Write output to in-memory buffer `symbol->memfile` instead of to `outfile` file. + +`BARCODE_RAW_TEXT` Set HRT with no decoration,[^14] complete with any + control characters[^15] and check characters,[^16] + and for all linear symbologies, including those + that normally don't set it. ------------------------------------------------------------------------------ Table: API `output_options` Values {#tbl:api_output_options tag="$ $"} @@ -2344,6 +2356,16 @@ Code]. [^13]: 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. +[^14]: In particular no parentheses will appear in the HRT for GS1 symbologies, +and `GS` separators will be added as required. However for EAN/UPC symbologies, +any add-on data will be separated by a `+` character as usual. + +[^15]: Normally control characters (including `DEL`) and non-ISO/IEC 8859-1 are +replaced by spaces in the HRT. + +[^16]: Except for Japanese Postal Code, whose check character is not truly +representable in HRT. + ## 5.11 Setting the Input Mode The way in which the input data is encoded can be set using the `input_mode` @@ -2596,7 +2618,7 @@ Value Meaning `ZINT_CAP_STACKABLE` Is the symbology stackable? -`ZINT_CAP_EANUPC`[^14] 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) @@ -2627,7 +2649,7 @@ Value Meaning Table: {#tbl:api_cap tag=": API Capability Flags"} -[^14]: `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: @@ -3170,13 +3192,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`[^15] 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). -[^15]: `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 @@ -3768,7 +3790,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).[^16] +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 @@ -3778,7 +3800,7 @@ number 62, `"K"` or `"00"` means frame number 63, and `"F"` means frame number A parity bit is automatically added by Zint. -[^16]: 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). diff --git a/docs/manual.txt b/docs/manual.txt index 55f33757..6d4d3948 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -2146,6 +2146,10 @@ the nature of the error. The errors generated by Zint are: ------------------------------------------------------------------------------ Return Value Meaning ------------------------------ ----------------------------------------------- + ZINT_WARN_HRT_RAW_TEXT The Human Readable Text returned in text was + outputted as raw text (output_options set to + BARCODE_RAW_TEXT). + ZINT_WARN_HRT_TRUNCATED The Human Readable Text returned in text was truncated (maximum 255 bytes). @@ -2207,6 +2211,9 @@ the nature of the error. The errors generated by Zint are: ZINT_ERROR_HRT_TRUNCATED Returned if warn_level set to WARN_FAIL_ALL and ZINT_WARN_HRT_TRUNCATED occurs. + + ZINT_ERROR_HRT_RAW_TEXT Returned if warn_level set to WARN_FAIL_ALL and + ZINT_WARN_HRT_RAW_TEXT occurs. ------------------------------------------------------------------------------ Table : API Warning and Error Return Values @@ -2313,6 +2320,11 @@ together when adjusting this value: BARCODE_MEMORY_FILE Write output to in-memory buffer symbol->memfile instead of to outfile file. + + BARCODE_RAW_TEXT Set HRT with no decoration,[14] complete with any + control characters[15] and check characters,[16] + and for all linear symbologies, including those + that normally don’t set it. ------------------------------------------------------------------------------ : Table  : API output_options Values @@ -2541,7 +2553,7 @@ see which are set. ZINT_CAP_STACKABLE Is the symbology stackable? - ZINT_CAP_EANUPC[14] 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) @@ -3057,7 +3069,7 @@ alphanumerics) are not recommended. [zint -b CODE128AB -d "130170X178"] It is sometimes advantageous to stop Code 128 from using Code Set C which -compresses numerical data. The BARCODE_CODE128AB[15] 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 @@ -3609,7 +3621,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).[16] +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 @@ -5631,11 +5643,21 @@ Special considerations apply to ITF-14 - see 6.1.2.6 ITF-14. [13] 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. -[14] ZINT_CAP_EANUPC was previously named ZINT_CAP_EXTENDABLE, which is still +[14] In particular no parentheses will appear in the HRT for GS1 symbologies, +and GS separators will be added as required. However for EAN/UPC symbologies, +any add-on data will be separated by a + character as usual. + +[15] Normally control characters (including DEL) and non-ISO/IEC 8859-1 are +replaced by spaces in the HRT. + +[16] Except for Japanese Postal Code, whose check character is not truly +representable in HRT. + +[17] ZINT_CAP_EANUPC was previously named ZINT_CAP_EXTENDABLE, which is still recognised. -[15] BARCODE_CODE128AB previously used the name BARCODE_CODE128B, which is still +[18] BARCODE_CODE128AB previously used the name BARCODE_CODE128B, which is still recognised. -[16] 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.