1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-06-10 15:43:40 +00:00

CLI: add "Telepen Alpha", "Telepen Numeric" synonyms

TELEPEN/TELEPEN_NUM: ZINT_DEBUG_PRINT binary string
BWIPP: latest
test suite: allow for further reduced BWIPP DotCode max len
This commit is contained in:
gitlost
2026-05-29 03:57:09 +01:00
parent a52eec6b80
commit 50d99dd5f4
5 changed files with 21 additions and 12 deletions
+8 -4
View File
@@ -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);
+8 -8
View File
@@ -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);
+3
View File
@@ -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;
Binary file not shown.