1
0
Fork 0
mirror of https://git.code.sf.net/p/zint/code synced 2025-06-02 07:59:50 -04:00

Add HEIGHTPERROW_MODE_input mode flag ()

backend_qt: add encodedWidth, encodedRows
DBAR_EXPSTK: add max rows option (option_3)
CODE16K/CODE49: add min rows option (option_1)
GUI: HIBC xxx -> HIBC
This commit is contained in:
gitlost 2021-11-20 11:32:30 +00:00
parent 96cf5aa668
commit e14d9e99d5
36 changed files with 2453 additions and 608 deletions
backend

View file

@ -64,6 +64,7 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], int len
int list[2][C128_MAX] = {{0}};
char set[C128_MAX] = {0}, fset[C128_MAX], mode, last_set, current_set;
int pads_needed, indexliste, i, m, read, mx_reader;
int extra_pads = 0;
int values[C128_MAX] = {0};
int bar_characters;
float glyph_count;
@ -183,6 +184,15 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], int len
if (rows == 1) {
rows = 2;
}
if (symbol->option_1 >= 2 && symbol->option_1 <= 16) { /* Minimum no. of rows */
if (symbol->option_1 > rows) {
extra_pads = (symbol->option_1 - rows) * 5;
rows = symbol->option_1;
}
} else if (symbol->option_1 >= 1) {
strcpy(symbol->errtxt, "424: Minimum number of rows out of range (2 to 16)");
return ZINT_ERROR_INVALID_OPTION;
}
/* start with the mode character - Table 2 */
m = 0;
@ -313,7 +323,7 @@ INTERNAL int code16k(struct zint_symbol *symbol, unsigned char source[], int len
if ((bar_characters + pads_needed) < 8) {
pads_needed += 8 - (bar_characters + pads_needed);
}
for (i = 0; i < pads_needed; i++) {
for (i = 0; i < pads_needed + extra_pads; i++) {
values[bar_characters] = 103;
bar_characters++;
}