Set minimum row heights

This commit is contained in:
Robin Stuart 2016-10-27 09:32:12 +01:00
parent a57ef2adc8
commit 7ea03123c8
3 changed files with 13 additions and 10 deletions

View File

@ -984,6 +984,7 @@ int codablock(struct zint_symbol *symbol, unsigned char source[], int length) {
} }
expand(symbol, dest); expand(symbol, dest);
} }
set_minimum_height(symbol, 8);
if (!(symbol->output_options & BARCODE_BIND)) { if (!(symbol->output_options & BARCODE_BIND)) {
symbol->output_options += BARCODE_BIND; symbol->output_options += BARCODE_BIND;

View File

@ -286,6 +286,7 @@ void set_minimum_height(struct zint_symbol *symbol, int min_height) {
} }
} }
if (zero_count > 0) {
if (((symbol->height - fixed_height) / zero_count) < min_height) { if (((symbol->height - fixed_height) / zero_count) < min_height) {
for (i = 0; i < symbol->rows; i++) { for (i = 0; i < symbol->rows; i++) {
if (symbol->row_height[i] == 0) { if (symbol->row_height[i] == 0) {
@ -293,4 +294,5 @@ void set_minimum_height(struct zint_symbol *symbol, int min_height) {
} }
} }
} }
}
} }

View File

@ -50,7 +50,7 @@ struct zint_symbol *ZBarcode_Create() {
memset(symbol, 0, sizeof (*symbol)); memset(symbol, 0, sizeof (*symbol));
symbol->symbology = BARCODE_CODE128; symbol->symbology = BARCODE_CODE128;
symbol->height = 0; symbol->height = 50;
symbol->whitespace_width = 0; symbol->whitespace_width = 0;
symbol->border_width = 0; symbol->border_width = 0;
symbol->output_options = 0; symbol->output_options = 0;