mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-19 17:55:10 -04:00
Add compliant height, using ZINT_COMPLIANT_HEIGHT flag for back-compatibility
Rename barcode funcs to same as BARCODE_XXX name library: barcode funcs array for dispatch, used for ZBarcode_ValidID() also general: change is_sane() comparison to nonzero from ZINT_ERROR_INVALID_OPTION MAILMARK: fuller error messages CODABAR: add option to show check character in HRT zint.h: use 0xNNNN for OR-able defines GUI: add guard descent height reset button, add Zint version to window title, static get_zint_version() method, use QStringLiteral (QSL shorthand), use SIGNAL(toggled()), add errtxt "popup" and status bar, add icons, add saveAs shortcut, add main menu, context menus and actions, add help, reset_view() -> reset_colours(), add copy to clipboard as EMF/GIF/PNG/TIF, lessen triggering of update_preview(), shorten names of getters/setters, simplify/shorten some update_preview() logic in switch, CODEONE disable structapp for Version S qzint.cpp: add on_errored signal, add missing getters, add test
This commit is contained in:
parent
206ae26d20
commit
72eac41c34
82 changed files with 5570 additions and 3774 deletions
|
@ -39,7 +39,7 @@
|
|||
|
||||
/* "!" represents Shift 1 and "&" represents Shift 2, "*" represents FNC1 */
|
||||
|
||||
INTERNAL int code_49(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
INTERNAL int code49(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
int i, j, rows, M, x_count, y_count, z_count, posn_val, local_value;
|
||||
char intermediate[170] = "";
|
||||
int codewords[170], codeword_count;
|
||||
|
@ -49,8 +49,6 @@ INTERNAL int code_49(struct zint_symbol *symbol, unsigned char source[], int len
|
|||
char pattern[80];
|
||||
int gs1;
|
||||
int h, len;
|
||||
int separator;
|
||||
float min_row_height = 0.0f;
|
||||
int error_number = 0;
|
||||
|
||||
if (length > 81) {
|
||||
|
@ -351,16 +349,17 @@ INTERNAL int code_49(struct zint_symbol *symbol, unsigned char source[], int len
|
|||
symbol->rows = rows;
|
||||
symbol->width = (int) strlen(pattern);
|
||||
|
||||
#ifdef COMPLIANT_HEIGHTS
|
||||
separator = symbol->option_3 >= 1 && symbol->option_3 <= 4 ? symbol->option_3 : 1;
|
||||
/* ANSI/AIM BC6-2000 Section 2.6 minimum 8X; use 10 * rows as default for back-compatibility */
|
||||
min_row_height = 8.0f + separator;
|
||||
error_number = set_height(symbol, min_row_height, (min_row_height > 10.0f ? min_row_height : 10.0f) * rows, 0.0f,
|
||||
0 /*no_errtxt*/);
|
||||
#else
|
||||
(void)&separator;
|
||||
(void) set_height(symbol, min_row_height, 10.0f * rows, 0.0f, 1 /*no_errtxt*/);
|
||||
#endif
|
||||
if (symbol->output_options & COMPLIANT_HEIGHT) {
|
||||
/* ANSI/AIM BC6-2000 Section 2.6 minimum 8X; use 10X as default
|
||||
Formula 2 H = ((h + g)r + g)X = rows * row_height + (rows - 1) * separator as borders not included
|
||||
in symbol->height (added on) */
|
||||
const int separator = symbol->option_3 >= 1 && symbol->option_3 <= 4 ? symbol->option_3 : 1;
|
||||
const float min_row_height = stripf((8.0f * rows + separator * (rows - 1)) / rows);
|
||||
const float default_height = 10.0f * rows + separator * (rows - 1);
|
||||
error_number = set_height(symbol, min_row_height, default_height, 0.0f, 0 /*no_errtxt*/);
|
||||
} else {
|
||||
(void) set_height(symbol, 0.0f, 10.0f * rows, 0.0f, 1 /*no_errtxt*/);
|
||||
}
|
||||
|
||||
symbol->output_options |= BARCODE_BIND;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue