diff --git a/backend/telepen.c b/backend/telepen.c index 70982b9c..42eba64e 100644 --- a/backend/telepen.c +++ b/backend/telepen.c @@ -227,12 +227,14 @@ INTERNAL int zint_telepen(struct zint_symbol *symbol, unsigned char source[], in memcpy(d, TeleTable[check_digit], TeleLens[check_digit]); d += TeleLens[check_digit]; - if (symbol->debug & ZINT_DEBUG_PRINT) printf("Check digit: %d\n", check_digit); - /* Stop character */ memcpy(d, TeleTable[asc_comp_num ? 0x83 : 0x7A], 12); d += 12; + if (symbol->debug & ZINT_DEBUG_PRINT) { + printf("Check digit: %d\nBinary (%d): %.*s\n", check_digit, (int) (d - dest), (int) (d - dest), dest); + } + z_expand(symbol, dest, (int) (d - dest)); error_number = tele_set_height(symbol, asc_length, num_length, have_dle); @@ -343,12 +345,14 @@ INTERNAL int zint_telepen_num(struct zint_symbol *symbol, unsigned char source[] memcpy(d, TeleTable[check_digit], TeleLens[check_digit]); d += TeleLens[check_digit]; - if (symbol->debug & ZINT_DEBUG_PRINT) printf("Check digit: %d\n", check_digit); - /* Stop character */ memcpy(d, TeleTable[comp_num_asc ? 0x81 : 0x7A], 12); d += 12; + if (symbol->debug & ZINT_DEBUG_PRINT) { + printf("Check digit: %d\nBinary (%d): %.*s\n", check_digit, (int) (d - dest), (int) (d - dest), dest); + } + z_expand(symbol, dest, (int) (d - dest)); error_number = tele_set_height(symbol, length - num_length /*asc_length*/, num_length, have_dle); diff --git a/backend/tests/test_dotcode.c b/backend/tests/test_dotcode.c index b630fdd5..f53ac195 100644 --- a/backend/tests/test_dotcode.c +++ b/backend/tests/test_dotcode.c @@ -46,22 +46,22 @@ static void test_large(const testCtx *const p_ctx) { }; /* s/\/\*[ 0-9]*\*\//\=printf("\/\*%3d*\/", line(".") - line("'<")): */ static const struct item data[] = { - /* 0*/ { 200, '0', 2940, 0, "", 1, 1, "" }, /* 2940 largest Code Set C data that fits in 200x199 HxW */ + /* 0*/ { 200, '0', 2940, 0, "", 0, 1, "2940 largest Code Set C data that fits in 200x199 HxW; BWIPP limit now 2000 TODO: suggest change to BWIPP" }, /* 1*/ { 200, '0', 2941, ZINT_ERROR_INVALID_OPTION, "Error 735: Resulting symbol height '201' is too large (maximum 200)", 1, 1, "" }, - /* 2*/ { 200, '9', 200, 0, "", 1, 1, "" }, /* Changes a number of mask scores re pre-Rev. 4 version, but best score still the same (7) */ - /* 3*/ { 200, '0', 2974, ZINT_ERROR_INVALID_OPTION, "Error 735: Resulting symbol height '203' is too large (maximum 200)", 1, 1, "" }, /* Width > 200 also */ + /* 2*/ { 200, '9', 200, 0, "", 1, 1, "Changes a number of mask scores re pre-Rev. 4 version, but best score still the same (7)" }, + /* 3*/ { 200, '0', 2974, ZINT_ERROR_INVALID_OPTION, "Error 735: Resulting symbol height '203' is too large (maximum 200)", 1, 1, "Width > 200 also" }, /* 4*/ { 200, 'A', 1470, 0, "", 1, 1, "" }, /* 5*/ { 200, 'A', 1471, ZINT_ERROR_INVALID_OPTION, "Error 735: Resulting symbol height '201' is too large (maximum 200)", 1, 1, "" }, - /* 6*/ { 200, '\240', 1225, 0, "", 0, 899, "BWIPP limit now 4000 (== 1000 with caret escaping) TODO: suggest change to BWIPP" }, + /* 6*/ { 200, '\240', 1225, 0, "", 0, 899, "BWIPP limit now 2000 (== 500 with caret escaping) TODO: suggest change to BWIPP" }, /* 7*/ { 200, '\240', 1226, ZINT_ERROR_INVALID_OPTION, "Error 735: Resulting symbol height '201' is too large (maximum 200)", 1, 899, "" }, - /* 8*/ { 200, '0', 1, 0, "", 1, 1, "" }, /* Padding codewords 35 - probably max */ - /* 9*/ { 200, '0', 2, 0, "", 1, 1, "" }, /* Padding codewords 35 */ - /* 10*/ { 30, '\001', 71, 0, "", 1, 1, "" }, /* Codeword length 72, ECC length 39, for ND + 1 == 112 */ + /* 8*/ { 200, '0', 1, 0, "", 1, 1, "Padding codewords 35 - probably max" }, + /* 9*/ { 200, '0', 2, 0, "", 1, 1, "Padding codewords 35" }, + /* 10*/ { 30, '\001', 71, 0, "", 1, 1, "Codeword length 72, ECC length 39, for ND + 1 == 112" }, /* 11*/ { -1, '0', 1968, 0, "", 1, 1, "" }, /* 12*/ { -1, '0', 1969, ZINT_ERROR_INVALID_OPTION, "Error 528: Resulting symbol width '201' is too large (maximum 200)", 1, 1, "" }, /* 13*/ { -1, 'A', 984, 0, "", 1, 1, "" }, /* 14*/ { -1, 'A', 985, ZINT_ERROR_INVALID_OPTION, "Error 528: Resulting symbol width '201' is too large (maximum 200)", 1, 1, "" }, - /* 15*/ { -1, '\240', 820, 0, "", 1, 899, "" }, + /* 15*/ { -1, '\240', 820, 0, "", 0, 899, "BWIPP limit now 2000 (== 500 with caret escaping) TODO: suggest change to BWIPP" }, /* 16*/ { -1, '\240', 821, ZINT_ERROR_INVALID_OPTION, "Error 528: Resulting symbol width '201' is too large (maximum 200)", 1, 899, "" }, }; const int data_size = ARRAY_SIZE(data); diff --git a/backend/tests/test_telepen.c b/backend/tests/test_telepen.c index 9889d860..2947a91a 100644 --- a/backend/tests/test_telepen.c +++ b/backend/tests/test_telepen.c @@ -457,6 +457,9 @@ static void test_encode(const testCtx *const p_ctx) { /* 13*/ { BARCODE_TELEPEN_NUM, -1, "3637", -1, 0, 1, 80, "Glyph count 127, check 0; verified manually against TEC-IT", "10101010101110001010101010101110111011101110101011101110111011101110001010101010" }, + /* 14*/ { BARCODE_TELEPEN_NUM, -1, "12\0203", -1, 0, 1, 96, "", + "101010101011100010101011101011101110111010111010101011101010111010111000101110101110001010101010" + }, }; const int data_size = ARRAY_SIZE(data); int i, length, ret; diff --git a/backend/tests/tools/bwipp_dump.ps.tar.xz b/backend/tests/tools/bwipp_dump.ps.tar.xz index 920bf0a5..6e167b0f 100644 Binary files a/backend/tests/tools/bwipp_dump.ps.tar.xz and b/backend/tests/tools/bwipp_dump.ps.tar.xz differ diff --git a/frontend/main.c b/frontend/main.c index 652ada48..6c78c56e 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -627,7 +627,9 @@ static int get_barcode_name(const char *const barcode_name) { { BARCODE_DBAR_LTD_CC, "rssltdcc" }, /* Synonym */ { BARCODE_C25STANDARD, "standardcode2of5" }, /* Synonym */ { BARCODE_TELEPEN, "telepen" }, + { BARCODE_TELEPEN, "telepenalpha" }, /* Synonym */ { BARCODE_TELEPEN_NUM, "telepennum" }, + { BARCODE_TELEPEN_NUM, "telepennumeric" }, /* Synonym */ { BARCODE_ULTRA, "ultra" }, { BARCODE_ULTRA, "ultracode" }, /* Synonym */ { BARCODE_UPCA, "upca" },