1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-07-30 18:09:50 +00:00

font_wip branch: new WIP font stuff using "stb_truetype.h",

not implemented for EAN/UPC, not fully tested
This commit is contained in:
gitlost
2026-07-27 12:21:19 +01:00
parent d6a4bdfe90
commit a4f0fa0fd2
144 changed files with 8276 additions and 1567 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
name: CI
# .github/workflows/ci.yml 2026-07-01
# .github/workflows/ci.yml 2026-07-27
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch (or test branch github_ci push)
on:
push:
branches: [ master, github_ci ]
branches: [ master, github_ci, font_wip ]
pull_request:
branches: [ master ]
+1 -1
View File
@@ -17,7 +17,7 @@ if(ZINT_USE_GS1SE)
endif()
endif()
set(zint_COMMON_SRCS common.c eci.c filemem.c general_field.c gs1.c large.c library.c reedsol.c)
set(zint_COMMON_SRCS common.c eci.c filemem.c general_field.c gs1.c large.c library.c reedsol.c zfont.c)
set(zint_ONEDIM_SRCS 2of5.c 2of5inter.c 2of5inter_based.c bc412.c channel.c codabar.c code.c code11.c code128.c
code128_based.c dxfilmedge.c medical.c plessey.c rss.c telepen.c upcean.c)
set(zint_POSTAL_SRCS auspost.c imail.c mailmark.c postal.c)
+4
View File
@@ -274,6 +274,10 @@ INTERNAL int zint_auspost(struct zint_symbol *symbol, unsigned char source[], in
error_number = zint_daft_set_height(symbol, 0.0f, 0.0f);
}
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_cat_nochk(symbol, fccs[fcc_idx], 2, '\xFF' /*separator (none)*/, source, length);
}
if (content_segs && z_ct_cpy_cat(symbol, fccs[fcc_idx], 2, '\xFF' /*separator (none)*/, source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy_cat()` only fails with OOM */
}
+34 -8
View File
@@ -1,7 +1,7 @@
/* bmp.c - Handles output to Windows Bitmap file */
/*
libzint - the open source barcode library
Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2009-2026 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -50,9 +50,10 @@ INTERNAL int zint_bmp_pixel_plot(struct zint_symbol *symbol, const unsigned char
bitmap_info_header_t info_header;
color_ref_t bg;
color_ref_t fg;
color_ref_t palette[8];
color_ref_t palette[256];
int ultra_fg_index = 9;
unsigned char map[128];
const int grayscale = zint_out_grayscale(symbol);
unsigned char *rowbuf;
(void) zint_out_colour_get_rgb(symbol->fgcolour, &fg.red, &fg.green, &fg.blue, NULL /*alpha*/);
@@ -75,6 +76,18 @@ INTERNAL int zint_bmp_pixel_plot(struct zint_symbol *symbol, const unsigned char
colour_count = ultra_fg_index == 9 ? 10 : 9;
map['0'] = 0;
map['1'] = (unsigned char) ultra_fg_index;
} else if (grayscale) {
const int diff_red = fg.red - bg.red;
const int diff_green = fg.green - bg.green;
const int diff_blue = fg.blue - bg.blue;
color_ref_t color = {0}; /* Ensure `reserved` is zero */
bits_per_pixel = 8;
for (colour_count = 0; colour_count <= 0xFF; colour_count++) {
color.red = bg.red + (diff_red * colour_count) / 0xFF;
color.green = bg.green + (diff_green * colour_count) / 0xFF;
color.blue = bg.blue + (diff_blue * colour_count) / 0xFF;
palette[colour_count] = color;
}
} else {
bits_per_pixel = 1;
colour_count = 2;
@@ -123,16 +136,22 @@ INTERNAL int zint_bmp_pixel_plot(struct zint_symbol *symbol, const unsigned char
zint_fm_write(&file_header, sizeof(bitmap_file_header_t), 1, fmp);
zint_fm_write(&info_header, sizeof(bitmap_info_header_t), 1, fmp);
zint_fm_write(&bg, sizeof(color_ref_t), 1, fmp);
if (bits_per_pixel == 4) {
for (i = 0; i < 8; i++) {
if (bits_per_pixel == 8) {
for (i = 0; i < colour_count; i++) {
zint_fm_write(&palette[i], sizeof(color_ref_t), 1, fmp);
}
if (ultra_fg_index == 9) {
} else {
zint_fm_write(&bg, sizeof(color_ref_t), 1, fmp);
if (bits_per_pixel == 4) {
for (i = 0; i < 8; i++) {
zint_fm_write(&palette[i], sizeof(color_ref_t), 1, fmp);
}
if (ultra_fg_index == 9) {
zint_fm_write(&fg, sizeof(color_ref_t), 1, fmp);
}
} else {
zint_fm_write(&fg, sizeof(color_ref_t), 1, fmp);
}
} else {
zint_fm_write(&fg, sizeof(color_ref_t), 1, fmp);
}
/* Pixel Plotting */
@@ -145,6 +164,13 @@ INTERNAL int zint_bmp_pixel_plot(struct zint_symbol *symbol, const unsigned char
}
zint_fm_write(rowbuf, 1, row_size, fmp);
}
} else if (bits_per_pixel == 8) {
memset(rowbuf, 0, row_size);
for (row = 0; row < symbol->bitmap_height; row++) {
const unsigned char *pb = pixelbuf + (symbol->bitmap_width * (symbol->bitmap_height - row - 1));
memcpy(rowbuf, pb, symbol->bitmap_width);
zint_fm_write(rowbuf, 1, row_size, fmp);
}
} else { /* bits_per_pixel == 1 */
for (row = 0; row < symbol->bitmap_height; row++) {
const unsigned char *pb = pixelbuf + ((size_t) symbol->bitmap_width * (symbol->bitmap_height - row - 1));
+7 -1
View File
@@ -567,7 +567,9 @@ INTERNAL int zint_codablockf(struct zint_symbol *symbol, unsigned char source[],
if (symbol->border_width == 0) { /* Allow override if non-zero */
symbol->border_width = 1; /* AIM ISS-X-24 Section 4.6.1 b) (note change from previous default 2) */
}
z_hrt_cpy_nochk(symbol, ZCUCP(""), 0); /* Zap HRT for compatibility with CODABLOCKF */
if ((symbol->show_hrt & 0x7) < ZINT_HRT_STACKED) {
z_hrt_cpy_nochk(symbol, ZCUCP(""), 0); /* Zap HRT for compatibility with CODABLOCKF */
}
/* Use `content_segs` from `zint_code128()` */
if (symbol->output_options & COMPLIANT_HEIGHT) {
/* AIM ISS-X-24 Section 4.6.1 minimum row height 8X (for compatibility with CODABLOCKF, not specced
@@ -883,6 +885,10 @@ INTERNAL int zint_codablockf(struct zint_symbol *symbol, unsigned char source[],
symbol->border_width = 1; /* AIM ISS-X-24 Section 4.6.1 b) (note change from previous default 2) */
}
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_STACKED) {
error_number = z_hrt_cpy_iso8859_1(symbol, source, length);
}
if (content_segs) {
if ((symbol->input_mode & 0x07) == DATA_MODE) {
if (z_ct_cpy(symbol, source, length)) {
+5
View File
@@ -593,6 +593,11 @@ INTERNAL int zint_code16k(struct zint_symbol *symbol, unsigned char source[], in
symbol->border_width = 1; /* BS EN 12323:2005 Section 4.3.7 minimum (note change from previous default 2) */
}
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_STACKED) {
assert(length < ARRAY_SIZE(symbol->text));
(void) z_hrt_cpy_iso8859_1(symbol, source, length);
}
if (content_segs) {
if ((symbol->input_mode & 0x07) == DATA_MODE) {
if (z_ct_cpy(symbol, source, length)) {
+6
View File
@@ -30,6 +30,7 @@
*/
/* SPDX-License-Identifier: BSD-3-Clause */
#include <assert.h>
#include <stdio.h>
#include "common.h"
#include "code49.h"
@@ -373,6 +374,11 @@ INTERNAL int zint_code49(struct zint_symbol *symbol, unsigned char source[], int
symbol->border_width = 1; /* ANSI/AIM BC6-2000 Section 2.1 (note change from previous default 2) */
}
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_STACKED) {
assert(length < ARRAY_SIZE(symbol->text));
z_hrt_cpy_nochk(symbol, source, length);
}
if (!gs1 && content_segs && z_ct_cpy(symbol, source, length)) { /* GS1 dealt with by `ZBarcode_Encode_Segs()` */
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
}
+1 -1
View File
@@ -864,7 +864,7 @@ INTERNAL int z_hrt_cpy_iso8859_1(struct zint_symbol *symbol, const unsigned char
for (i = 0, j = 0; i < length && j < text_size; i++) {
if (z_isascii(source[i])) {
symbol->text[j++] = z_iscntrl(source[i]) ? ' ' : source[i];
symbol->text[j++] = z_iscntrl(source[i]) && source[i] != '\n' ? ' ' : source[i]; /* Leave newlines */
} else if (source[i] < 0xC0) {
if (source[i] < 0xA0) { /* 0x80-0x9F not valid ISO/IEC 8859-1 */
symbol->text[j++] = ' ';
+5
View File
@@ -248,6 +248,11 @@ static int dx_parse_code(struct zint_symbol *symbol, const unsigned char *source
*output_length = bp;
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_printf_nochk(symbol, (*has_frame_info ? "%d-%d%s%s" : "%d-%d"), dx_code_1, dx_code_2, "/",
frame_info);
}
if (content_segs && z_ct_printf_256(symbol, (*has_frame_info ? "%d-%d%s%s" : "%d-%d"), dx_code_1, dx_code_2, "/",
frame_info)) {
return ZINT_ERROR_MEMORY; /* `z_ct_printf_256()` only fails with OOM */
File diff suppressed because it is too large Load Diff
+16 -2
View File
@@ -1,7 +1,7 @@
/* gif.c - Handles output to gif file */
/*
libzint - the open source barcode library
Copyright (C) 2009-2025 Robin Stuart <rstuart114@gmail.com>
Copyright (C) 2009-2026 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -241,7 +241,7 @@ static void gif_lzw(struct gif_state *pState, unsigned char paletteBitSize) {
INTERNAL int zint_gif_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf) {
struct filemem fm;
unsigned char outbuf[10];
unsigned char paletteRGB[10][3];
unsigned char paletteRGB[256][3];
int paletteCount, i;
unsigned char paletteBitSize;
int paletteSize;
@@ -254,6 +254,7 @@ INTERNAL int zint_gif_pixel_plot(struct zint_symbol *symbol, unsigned char *pixe
unsigned char RGBbg[3];
unsigned char fgalpha;
unsigned char bgalpha;
const int grayscale = zint_out_grayscale(symbol);
const size_t bitmapSize = (size_t) symbol->bitmap_height * symbol->bitmap_width;
@@ -336,6 +337,19 @@ INTERNAL int zint_gif_pixel_plot(struct zint_symbol *symbol, unsigned char *pixe
paletteBitSize = 4;
}
}
} else if (grayscale) {
const int diff_red = RGBfg[0] - RGBbg[0];
const int diff_green = RGBfg[1] - RGBbg[1];
const int diff_blue = RGBfg[2] - RGBbg[2];
for (paletteCount = 0; paletteCount <= 0xFF; paletteCount++) {
paletteRGB[paletteCount][0] = RGBbg[0] + (diff_red * paletteCount) / 0xFF;
paletteRGB[paletteCount][1] = RGBbg[1] + (diff_green * paletteCount) / 0xFF;
paletteRGB[paletteCount][2] = RGBbg[2] + (diff_blue * paletteCount) / 0xFF;
State.map[paletteCount] = paletteCount;
}
bgindex = 0;
fgindex = 0xFF;
paletteBitSize = 8;
} else {
State.map['0'] = (unsigned char) (bgindex = 0);
memcpy(paletteRGB[bgindex], RGBbg, 3);
+72 -20
View File
@@ -1921,16 +1921,22 @@ static int gs1_hrt_conv_parsed(struct zint_symbol *symbol, const unsigned char s
int i, j;
int warn_number = 0;
const int text_size = ARRAY_SIZE(symbol->text);
const int gs1_newline = symbol->show_hrt & ZINT_HRT_GS1_NEWLINE;
int first_ai = 1;
#ifdef NDEBUG
(void)length;
#endif
for (i = 0, j = 0; i < ai_count && j < text_size; i++) {
const int ai_len = 2 + (ai_vals[i] >= 100) + (ai_vals[i] >= 1000);
if (j + 1 + ai_len + 1 + data_lens[i] >= text_size) {
if (j + 1 + ai_len + 1 + data_lens[i] + (!first_ai && gs1_newline) >= text_size) {
warn_number = ZINT_WARN_HRT_TRUNCATED;
break;
}
if (!first_ai && gs1_newline) {
symbol->text[j++] = '\n';
}
symbol->text[j++] = '(';
memcpy(symbol->text + j, source + ai_locs[i], ai_len);
j += ai_len;
@@ -1938,11 +1944,12 @@ static int gs1_hrt_conv_parsed(struct zint_symbol *symbol, const unsigned char s
assert(data_locs[i] + data_lens[i] <= length);
memcpy(symbol->text + j, source + data_locs[i], data_lens[i]);
j += data_lens[i];
first_ai = 0;
}
if (j == text_size) {
if (j >= text_size) {
warn_number = ZINT_WARN_HRT_TRUNCATED;
j--;
j = text_size - 1;
}
symbol->text_length = j;
symbol->text[j] = '\0';
@@ -1966,16 +1973,50 @@ INTERNAL int zint_test_gs1_hrt_conv_parsed(struct zint_symbol *symbol, const uns
/* Helper to set HRT when have GS1PARENS_MODE - truncates if too long for HRT buffer */
static int gs1_hrt_cpy(struct zint_symbol *symbol, const unsigned char source[], const int length,
const int no_errtxt) {
int warn_number;
int warn_number = 0;
const int text_size = ARRAY_SIZE(symbol->text);
const int gs1_newline = symbol->show_hrt & ZINT_HRT_GS1_NEWLINE;
assert(symbol->input_mode & GS1PARENS_MODE);
assert(source[0] == '(');
if (length < text_size) {
if (gs1_newline) {
int i, j = 1, last_opening_bracket = 0;
assert(source[0] == '(');
symbol->text[0] = '(';
for (i = 1; i < length && j < text_size; i++) {
if (source[i] == '\\' && i + 1 < length && (source[i + 1] == '\\' || source[i + 1] == '(')) {
if (j + 1 >= text_size) {
break;
}
symbol->text[j++] = source[i++];
} else if (source[i] == '(') {
if (j + 1 >= text_size) {
break;
}
last_opening_bracket = j;
symbol->text[j++] = '\n';
}
symbol->text[j++] = source[i];
}
if (i < length || j >= text_size) {
if (j < text_size && source[i] == '(') {
/* Finished at end of AI data */
symbol->text_length = j;
symbol->text[j] = '\0';
} else {
/* Use last full AI + data */
symbol->text_length = last_opening_bracket;
symbol->text[last_opening_bracket] = '\0';
}
warn_number = ZINT_WARN_HRT_TRUNCATED;
} else {
symbol->text_length = j;
symbol->text[j] = '\0';
}
} else if (length < text_size) {
memcpy(symbol->text, source, length + 1); /* Include terminating NUL */
symbol->text_length = length;
warn_number = 0;
} else {
/* Find last full AI - need to scan forward to track escaped opening parens */
int i, last_opening_bracket = 0;
@@ -1998,9 +2039,9 @@ static int gs1_hrt_cpy(struct zint_symbol *symbol, const unsigned char source[],
symbol->text[last_opening_bracket] = '\0';
}
warn_number = ZINT_WARN_HRT_TRUNCATED;
if (!no_errtxt) {
z_errtxt(0, symbol, 801, "Human Readable Text truncated");
}
}
if (warn_number && !no_errtxt) {
z_errtxt(0, symbol, 801, "Human Readable Text truncated");
}
return warn_number;
}
@@ -2016,37 +2057,48 @@ INTERNAL int zint_test_gs1_hrt_cpy(struct zint_symbol *symbol, const unsigned ch
& truncates if too long for HRT buffer */
static int gs1_hrt_conv_brackets(struct zint_symbol *symbol, const unsigned char source[], const int length,
const int no_errtxt) {
int i;
int i, j;
int warn_number = 0;
int bracket_level = 0; /* Non-compliant closing square brackets may be in text */
int last_opening_bracket = 0;
const int text_size = ARRAY_SIZE(symbol->text);
const int max_len = length > text_size ? text_size : length;
const int gs1_newline = symbol->show_hrt & ZINT_HRT_GS1_NEWLINE;
int first_ai = 1;
assert((symbol->input_mode & GS1PARENS_MODE) == 0);
assert(source[0] == '[');
for (i = 0; i < max_len; i++) {
for (i = 0, j = 0; i < max_len && j < text_size; i++) {
if (source[i] == '[') {
symbol->text[i] = '(';
const int do_gs1_newline = !first_ai && gs1_newline;
if (j + 1 + do_gs1_newline >= text_size) {
warn_number = ZINT_WARN_HRT_TRUNCATED;
break;
}
if (do_gs1_newline) {
symbol->text[j++] = '\n';
}
symbol->text[j++] = '(';
bracket_level++;
last_opening_bracket = i;
last_opening_bracket = j - (1 + do_gs1_newline);
} else if (source[i] == ']' && bracket_level) {
symbol->text[i] = ')';
symbol->text[j++] = ')';
bracket_level--;
} else {
symbol->text[i] = source[i];
symbol->text[j++] = source[i];
}
first_ai = 0;
}
if (i == text_size) {
i--;
if (j == text_size) {
j--;
if (source[i] != '[') {
i = last_opening_bracket;
j = last_opening_bracket;
}
warn_number = ZINT_WARN_HRT_TRUNCATED;
}
symbol->text_length = i;
symbol->text[i] = '\0';
symbol->text_length = j;
symbol->text[j] = '\0';
if (warn_number && !no_errtxt) {
z_errtxt(0, symbol, 798, "Human Readable Text truncated");
+4
View File
@@ -449,6 +449,10 @@ INTERNAL int zint_usps_imail(struct zint_symbol *symbol, unsigned char source[],
symbol->rows = 3;
symbol->width = read - 1;
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_nochk(symbol, source, length);
}
if (content_segs && z_ct_cpy(symbol, source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
}
+18 -4
View File
@@ -66,7 +66,7 @@ static void set_symbol_defaults(struct zint_symbol *symbol) {
memcpy(symbol->outfile, "out.png", 8);
#endif
symbol->option_1 = -1;
symbol->show_hrt = 1; /* Show human readable text */
symbol->show_hrt = ZINT_HRT_DEFAULT; /* Show human readable text (HRT) for most linear barcodes */
symbol->input_mode = DATA_MODE;
/* symbol->eci = 0; Default 0 uses ECI 3 */
symbol->dot_size = 0.8f; /* 0.4 / 0.5 */
@@ -988,13 +988,21 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[
return error_tag(ZINT_ERROR_INVALID_DATA, symbol, 771, "Too many input segments (maximum 256)");
}
if ((symbol->input_mode & 0x07) > 2) {
if ((symbol->input_mode & 0x07) > GS1_MODE) {
symbol->input_mode = DATA_MODE; /* Reset completely */
warn_number = error_tag(ZINT_WARN_INVALID_OPTION, symbol, 212, "Invalid input mode - reset to DATA_MODE");
if (warn_number >= ZINT_ERROR) {
return warn_number;
}
}
if ((symbol->show_hrt & 0x7) > ZINT_HRT_ALL) {
symbol->show_hrt = ZINT_HRT_DEFAULT; /* Reset completely */
warn_number = error_tag(ZINT_WARN_INVALID_OPTION, symbol, 210,
"Invalid show HRT - reset to ZINT_HRT_DEFAULT");
if (warn_number >= ZINT_ERROR) {
return warn_number;
}
}
/* Check the symbology field */
if (!ZBarcode_ValidID(symbol->symbology)) {
@@ -1069,8 +1077,8 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[
" output_options: 0x%X, fg: \"%s\", bg: \"%s\"\n"
" outfile: \"%s\"\n"
" primary (%d): \"%s\"\n"
" option_1/2/3: (%d, %d, %d), show_hrt: %d, input_mode: 0x%X, ECI: %d, dpmm: %g"
", dot_size: %g\n"
" option_1/2/3: (%d, %d, %d), show_hrt: 0x%X, input_mode: 0x%X, ECI: %d"
", dpmm: %g, dot_size: %g\n"
" text_gap: %g, guard_descent: %g, structapp index/count/id: (%d, %d, \"%s\")"
", warn_level: %d, seg_count %d\n"
" %ssource%s (%d): \"%s\"\n",
@@ -1130,6 +1138,12 @@ int ZBarcode_Encode_Segs(struct zint_symbol *symbol, const struct zint_seg segs[
if (symbol->scale < 0.01f || symbol->scale > 200.0f) {
return error_tag(ZINT_ERROR_INVALID_OPTION, symbol, 227, "Scale out of range (0.01 to 200)");
}
if (symbol->show_hrt & 0xFF0000) {
const int hrt_font_height = (symbol->show_hrt >> 16) & 0xFF;
if (hrt_font_height < 10 || hrt_font_height > 200) {
return error_tag(ZINT_ERROR_INVALID_OPTION, symbol, 764, "Font height out of range (10 to 200) ");
}
}
if (symbol->dot_size < 0.01f || symbol->dot_size > 20.0f) {
return error_tag(ZINT_ERROR_INVALID_OPTION, symbol, 221, "Dot size out of range (0.01 to 20)");
}
+8
View File
@@ -501,6 +501,10 @@ INTERNAL int zint_mailmark_4s(struct zint_symbol *symbol, unsigned char source[]
symbol->rows = 3;
symbol->width = j - 1;
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_nochk(symbol, local_source, length);
}
if (content_segs && z_ct_cpy(symbol, local_source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
}
@@ -662,6 +666,10 @@ INTERNAL int zint_mailmark_2d(struct zint_symbol *symbol, unsigned char source[]
segs[0].source = local_source;
segs[0].length = length;
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_ALL) {
(void) z_hrt_cpy_iso8859_1(symbol, local_source, length);
}
if (content_segs) {
if ((symbol->input_mode & 0x07) == DATA_MODE) {
if (z_ct_cpy(symbol, local_source, length)) {
+8
View File
@@ -99,6 +99,10 @@ INTERNAL int zint_pharma(struct zint_symbol *symbol, unsigned char source[], int
(void) z_set_height(symbol, 0.0f, 50.0f, 0.0f, 1 /*no_errtxt*/);
}
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_nochk(symbol, source, length);
}
if (content_segs && z_ct_cpy(symbol, source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
}
@@ -190,6 +194,10 @@ INTERNAL int zint_pharma_two(struct zint_symbol *symbol, unsigned char source[],
(void) z_set_height(symbol, 0.0f, 10.0f, 0.0f, 1 /*no_errtxt*/);
}
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_nochk(symbol, source, length);
}
if (content_segs && z_ct_cpy(symbol, source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
}
+15 -8
View File
@@ -760,8 +760,8 @@ INTERNAL int zint_out_process_upcean(const struct zint_symbol *symbol, const int
/* Isolate add-on text */
for (i = 6; i < symbol->text_length && j < 5; i++) {
if (latch == 1) {
/* Use dummy space-filled add-on if no hrt */
addon[j] = symbol->show_hrt ? symbol->text[i] : ' ';
/* Use dummy space-filled add-on if no HRT */
addon[j] = (symbol->show_hrt & 0x7) ? symbol->text[i] : ' ';
j++;
} else if (symbol->text[i] == '+') {
latch = 1;
@@ -786,29 +786,29 @@ INTERNAL int zint_out_process_upcean(const struct zint_symbol *symbol, const int
case 16: /* EAN-13 + EAN-2 */
case 19: /* EAN-13 + EAN-5 */
main_width = 95 + comp_xoffset; /* EAN-13 main symbol 95 modules wide */
upceanflag = 13;
upceanflag = OUT_UPCEANFLAG_EAN13;
break;
case 2:
/* EAN-2 can't have add-on or be composite */
upceanflag = 2;
upceanflag = OUT_UPCEANFLAG_EAN2;
break;
case 5:
/* EAN-5 can't have add-on or be composite */
upceanflag = 5;
upceanflag = OUT_UPCEANFLAG_EAN5;
break;
default:
main_width = 68 + comp_xoffset; /* EAN-8 main symbol 68 modules wide */
upceanflag = 8;
upceanflag = OUT_UPCEANFLAG_EAN8;
break;
}
} else if (symbol->symbology == BARCODE_UPCA || symbol->symbology == BARCODE_UPCA_CHK
|| symbol->symbology == BARCODE_UPCA_CC) {
main_width = 95 + comp_xoffset; /* UPC-A main symbol 95 modules wide */
upceanflag = 12;
upceanflag = OUT_UPCEANFLAG_UPCA;
} else if (symbol->symbology == BARCODE_UPCE || symbol->symbology == BARCODE_UPCE_CHK
|| symbol->symbology == BARCODE_UPCE_CC) {
main_width = 51 + comp_xoffset; /* UPC-E main symbol 51 modules wide */
upceanflag = 6;
upceanflag = OUT_UPCEANFLAG_UPCE;
}
*p_main_width = main_width;
@@ -890,6 +890,13 @@ INTERNAL float zint_out_large_bar_height(struct zint_symbol *symbol, const int s
return large_bar_height;
}
/* Whether output will be in 8-bit grayscale or not */
INTERNAL int zint_out_grayscale(const struct zint_symbol *symbol) {
const int hide_text = !(symbol->show_hrt & 0x7) || symbol->text[0] == '\0';
return !hide_text && (symbol->show_hrt & ZINT_HRT_GRAYSCALE);
}
#ifdef _WIN32
/* Convert UTF-8 to Windows wide chars. Ticket #288, props Marcel */
/* Note if change this, change versions in "frontend/main.c" and "backend/tests/testcommon.c" also */
+16
View File
@@ -39,6 +39,19 @@ extern "C" {
#include <stdio.h> /* For FILE */
/* EAN/UPC types */
#define OUT_UPCEANFLAG_EAN2 2
#define OUT_UPCEANFLAG_EAN5 5
#define OUT_UPCEANFLAG_UPCE 6
#define OUT_UPCEANFLAG_EAN8 8
#define OUT_UPCEANFLAG_UPCA 12
#define OUT_UPCEANFLAG_EAN13 13
/* Alignment flags `textflags` */
#define OUT_HALIGN_CENTRE 0
#define OUT_HALIGN_LEFT 1
#define OUT_HALIGN_RIGHT 2
/* Check colour options are good (`symbol->fgcolour`, `symbol->bgcolour`) */
INTERNAL int zint_out_check_colour_options(struct zint_symbol *symbol);
@@ -70,6 +83,9 @@ INTERNAL int zint_out_process_upcean(const struct zint_symbol *symbol, const int
INTERNAL float zint_out_large_bar_height(struct zint_symbol *symbol, const int si, int *row_heights_si,
int *symbol_height_si);
/* Whether output will be in 8-bit grayscale or not */
INTERNAL int zint_out_grayscale(const struct zint_symbol *symbol);
/* Create output file, creating sub-directories if necessary. Returns `fopen()` FILE pointer */
INTERNAL FILE *zint_out_fopen(char filename[256], const char *mode);
+14 -3
View File
@@ -41,6 +41,7 @@
/* ZSoft PCX File Format Technical Reference Manual http://bespin.org/~qz/pc-gpe/pcx.txt */
INTERNAL int zint_pcx_pixel_plot(struct zint_symbol *symbol, const unsigned char *pixelbuf) {
unsigned char fgred, fggrn, fgblu, fgalpha, bgred, bggrn, bgblu, bgalpha;
int diff_red, diff_grn, diff_blu;
int row, column, i, colour;
int run_count;
struct filemem fm;
@@ -49,12 +50,16 @@ INTERNAL int zint_pcx_pixel_plot(struct zint_symbol *symbol, const unsigned char
unsigned char previous;
const unsigned char *pb;
const int bytes_per_line = symbol->bitmap_width + (symbol->bitmap_width & 1); /* Must be even */
const int grayscale = zint_out_grayscale(symbol);
unsigned char *rle_row = (unsigned char *) z_alloca(bytes_per_line);
rle_row[bytes_per_line - 1] = 0; /* Will remain zero if bitmap_width odd */
(void) zint_out_colour_get_rgb(symbol->fgcolour, &fgred, &fggrn, &fgblu, &fgalpha);
(void) zint_out_colour_get_rgb(symbol->bgcolour, &bgred, &bggrn, &bgblu, &bgalpha);
diff_red = fgred - bgred;
diff_grn = fggrn - bggrn;
diff_blu = fgblu - bgblu;
header.manufacturer = 10; /* ZSoft */
header.version = 5; /* Version 3.0 */
@@ -98,21 +103,27 @@ INTERNAL int zint_pcx_pixel_plot(struct zint_symbol *symbol, const unsigned char
const unsigned char ch = pb[column];
switch (colour) {
case 0:
if (ch == '0' || ch == '1') {
if (grayscale) {
rle_row[column] = bgred + (diff_red * ch) / 0xFF;
} else if (ch == '0' || ch == '1') {
rle_row[column] = ch != '0' ? fgred : bgred;
} else {
zint_out_colour_char_to_rgb(ch, &rle_row[column], NULL, NULL);
}
break;
case 1:
if (ch == '0' || ch == '1') {
if (grayscale) {
rle_row[column] = bggrn + (diff_grn * ch) / 0xFF;
} else if (ch == '0' || ch == '1') {
rle_row[column] = ch != '0' ? fggrn : bggrn;
} else {
zint_out_colour_char_to_rgb(ch, NULL, &rle_row[column], NULL);
}
break;
case 2:
if (ch == '0' || ch == '1') {
if (grayscale) {
rle_row[column] = bgblu + (diff_blu * ch) / 0xFF;
} else if (ch == '0' || ch == '1') {
rle_row[column] = ch != '0' ? fgblu : bgblu;
} else {
zint_out_colour_char_to_rgb(ch, NULL, NULL, &rle_row[column]);
+32 -4
View File
@@ -108,13 +108,14 @@ INTERNAL int zint_png_pixel_plot(struct zint_symbol *symbol, const unsigned char
png_color bg, fg;
unsigned char bg_alpha, fg_alpha;
unsigned char map[128];
png_color palette[32];
png_color palette[256];
int num_palette;
unsigned char trans_alpha[32];
unsigned char trans_alpha[256];
int num_trans; /* Note initialize below to avoid gcc -Wclobbered warning due to `longjmp()` */
int bit_depth;
int compression_strategy;
const unsigned char *pb;
const int grayscale = zint_out_grayscale(symbol);
unsigned char *outdata = (unsigned char *) z_alloca(symbol->bitmap_width);
zpng_error.symbol = symbol;
@@ -176,6 +177,25 @@ INTERNAL int zint_png_pixel_plot(struct zint_symbol *symbol, const unsigned char
}
}
}
} else if (grayscale) {
const int diff_red = fg.red - bg.red;
const int diff_green = fg.green - bg.green;
const int diff_blue = fg.blue - bg.blue;
for (num_palette = 0; num_palette <= 0xFF; num_palette++) {
png_color color;
color.red = bg.red + (diff_red * num_palette) / 0xFF;
color.green = bg.green + (diff_green * num_palette) / 0xFF;
color.blue = bg.blue + (diff_blue * num_palette) / 0xFF;
palette[num_palette] = color;
}
if (bg_alpha != 0xFF || fg_alpha != 0xFF) {
trans_alpha[num_trans++] = bg_alpha;
if (fg_alpha != 0xFF) {
for (; num_trans <= 0xFF; num_trans++) {
trans_alpha[num_trans] = fg_alpha;
}
}
}
} else {
int bg_idx = 0, fg_idx = 1;
/* Do alphas first so can swop indexes if background not alpha */
@@ -200,8 +220,10 @@ INTERNAL int zint_png_pixel_plot(struct zint_symbol *symbol, const unsigned char
if (num_palette <= 2) {
bit_depth = 1;
} else {
} else if (num_palette <= 16) {
bit_depth = 4;
} else {
bit_depth = 8;
}
/* Open output file in binary mode */
@@ -280,7 +302,7 @@ INTERNAL int zint_png_pixel_plot(struct zint_symbol *symbol, const unsigned char
/* write row contents to file */
png_write_row(png_ptr, outdata);
}
} else { /* Bit depth 4 */
} else if (bit_depth == 4) {
for (row = 0; row < symbol->bitmap_height; row++) {
if (row && memcmp(pb, pb - symbol->bitmap_width, symbol->bitmap_width) == 0) {
pb += symbol->bitmap_width;
@@ -303,6 +325,12 @@ INTERNAL int zint_png_pixel_plot(struct zint_symbol *symbol, const unsigned char
}
#endif
}
} else { /* Bit depth 8 */
for (row = 0; row < symbol->bitmap_height; row++) {
/* write row contents to file */
png_write_row(png_ptr, pb);
pb += symbol->bitmap_width;
}
}
/* End the file */
+20
View File
@@ -165,6 +165,10 @@ INTERNAL int zint_postnet(struct zint_symbol *symbol, unsigned char source[], in
symbol->rows = 2;
symbol->width = writer - 1;
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_cat_nochk(symbol, source, length, (char) z_itoc(check_digit), NULL /*cat*/, 0);
}
if (content_segs && z_ct_cpy_cat(symbol, source, length, (char) z_itoc(check_digit), NULL /*cat*/, 0)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy_cat()` only fails with OOM */
}
@@ -279,6 +283,10 @@ INTERNAL int zint_fim(struct zint_symbol *symbol, unsigned char source[], int le
(void) z_set_height(symbol, 0.0f, 50.0f, 0.0f, 1 /*no_errtxt*/);
}
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_nochk(symbol, source, length);
}
if (content_segs && z_ct_cpy(symbol, source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
}
@@ -457,6 +465,10 @@ INTERNAL int zint_rm4scc(struct zint_symbol *symbol, unsigned char source[], int
(void) zint_daft_set_height(symbol, 0.0f, 0.0f);
}
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_cat_nochk(symbol, source, length, check_digit, NULL /*cat*/, 0);
}
if (content_segs && z_ct_cpy_cat(symbol, source, length, check_digit, NULL /*cat*/, 0)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy_cat()` only fails with OOM */
}
@@ -547,6 +559,10 @@ INTERNAL int zint_flat(struct zint_symbol *symbol, unsigned char source[], int l
/* TODO: Find documentation on BARCODE_FLAT dimensions/height */
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_nochk(symbol, source, length);
}
if (content_segs && z_ct_cpy(symbol, source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
}
@@ -659,6 +675,10 @@ INTERNAL int zint_japanpost(struct zint_symbol *symbol, unsigned char source[],
(void) zint_daft_set_height(symbol, 0.0f, 0.0f);
}
if ((symbol->show_hrt & 0x7) >= ZINT_HRT_LINEAR_ALL) {
z_hrt_cpy_nochk(symbol, source, length);
}
/* Note: check char is in KASUTSET and not truly representable in raw text's SHKASUTSET_F */
if (content_segs && z_ct_cpy(symbol, source, length)) {
return ZINT_ERROR_MEMORY; /* `z_ct_cpy()` only fails with OOM */
+166 -168
View File
@@ -40,19 +40,13 @@
#include "common.h"
#include "output.h"
#include "zfiletypes.h"
#include "raster_font.h" /* Font for human readable text */
#include "zfiletypes.h"
#include "zfont.h"
#define DEFAULT_INK '1' /* Black */
#define DEFAULT_PAPER '0' /* White */
/* Flags for `draw_string()`/`draw_letter()` */
#define ZFONT_HALIGN_CENTRE 0
#define ZFONT_HALIGN_LEFT 1
#define ZFONT_HALIGN_RIGHT 2
#define ZFONT_UPCEAN_TEXT 4 /* Helper flag to indicate dealing with EAN/UPC */
#ifdef ZINT_TEST
/* For testing `malloc()` failure */
@@ -126,8 +120,8 @@ static void *raster_malloc(size_t size, size_t prev_size) {
return rast_malloc(id, size);
}
/* Place pixelbuffer into symbol */
static int buffer_plot(struct zint_symbol *symbol, const unsigned char *pixelbuf) {
/* Place pixelbuffer into symbol */
unsigned char alpha[2];
unsigned char map[91][3] = {
{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, /* 0x00-0F */
@@ -238,7 +232,7 @@ static int save_raster_image_to_file(struct zint_symbol *symbol, const int image
return z_errtxt(ZINT_ERROR_MEMORY, symbol, 650, "Insufficient memory for pixel buffer");
}
#ifdef ZINT_SANITIZEM /* Suppress clang -fsanitize=memory false positive */
memset(rotated_pixbuf, DEFAULT_PAPER, image_size);
memset(rotated_pixbuf, zint_out_grayscale(symbol) ? 0x00 : DEFAULT_PAPER, image_size);
#endif
}
@@ -527,9 +521,9 @@ static void draw_string(unsigned char *pixelbuf, const unsigned char input_strin
length = (int) z_ustrlen(input_string);
}
if (textflags & ZFONT_HALIGN_LEFT) {
if (textflags & OUT_HALIGN_LEFT) {
string_left_hand = xposn;
} else if (textflags & ZFONT_HALIGN_RIGHT) {
} else if (textflags & OUT_HALIGN_RIGHT) {
string_left_hand = xposn - ((letter_width * length - letter_gap) * half_si);
} else {
string_left_hand = xposn - (int) roundf(((letter_width * length - letter_gap) * half_si) / 2.0f);
@@ -610,7 +604,7 @@ static void draw_mp_circle(unsigned char *pixelbuf, const int image_width, const
/* Draw central bullseye finder in Maxicode symbols */
static void draw_bullseye(unsigned char *pixelbuf, const int image_width, const int image_height,
const int hex_width, const int hex_height, const int hx_start, const int hx_end,
const int hex_image_height, const int xoffset_si, const int yoffset_si) {
const int hex_image_height, const int xoffset_si, const int yoffset_si, const int ink, const int paper) {
/* ISO/IEC 16023:2000 4.11.4 and 4.2.1.1 */
@@ -627,24 +621,24 @@ static void draw_bullseye(unsigned char *pixelbuf, const int image_width, const
r_incr -= hx_end;
}
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr * 5, DEFAULT_INK);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr * 4, DEFAULT_PAPER);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr * 3, DEFAULT_INK);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr * 2, DEFAULT_PAPER);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr, DEFAULT_INK);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1, DEFAULT_PAPER);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr * 5, ink);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr * 4, paper);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr * 3, ink);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr * 2, paper);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1 + r_incr, ink);
draw_mp_circle(pixelbuf, image_width, image_height, x, y, r1, paper);
}
/* Put a hexagon into the pixel buffer */
static void draw_hexagon(unsigned char *pixelbuf, const int image_width, const int image_height,
const unsigned char *scaled_hexagon, const int hex_width, const int hex_height,
const int xposn, const int yposn) {
const int xposn, const int yposn, const int ink) {
int i, j;
for (i = 0; i < hex_height; i++) {
for (j = 0; j < hex_width; j++) {
if (scaled_hexagon[(i * hex_width) + j] == DEFAULT_INK) {
draw_pt(pixelbuf, image_width, image_height, xposn + j, yposn + i, DEFAULT_INK);
if (scaled_hexagon[(i * hex_width) + j] == ink) {
draw_pt(pixelbuf, image_width, image_height, xposn + j, yposn + i, ink);
}
}
}
@@ -654,7 +648,7 @@ static void draw_hexagon(unsigned char *pixelbuf, const int image_width, const i
* Creative Commons Attribution-ShareAlike License
* https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License */
static void plot_hexline(unsigned char *scaled_hexagon, const int hex_width, const int hex_height,
int start_x, int start_y, const int end_x, const int end_y) {
int start_x, int start_y, const int end_x, const int end_y, const int ink) {
const int dx = abs(end_x - start_x);
const int sx = start_x < end_x ? 1 : -1;
const int dy = -abs(end_y - start_y);
@@ -663,7 +657,7 @@ static void plot_hexline(unsigned char *scaled_hexagon, const int hex_width, con
for (;;) {
int e2;
draw_pt(scaled_hexagon, hex_width, hex_height, start_x, start_y, DEFAULT_INK);
draw_pt(scaled_hexagon, hex_width, hex_height, start_x, start_y, ink);
if (start_x == end_x && start_y == end_y) {
break;
}
@@ -681,7 +675,7 @@ static void plot_hexline(unsigned char *scaled_hexagon, const int hex_width, con
/* Create a hexagon shape and fill it */
static void plot_hexagon(unsigned char *scaled_hexagon, const int hex_width, const int hex_height,
const int hx_start, const int hy_start, const int hx_end, const int hy_end) {
const int hx_start, const int hy_start, const int hx_end, const int hy_end, const int ink) {
int line, i;
int not_top;
@@ -704,7 +698,7 @@ static void plot_hexagon(unsigned char *scaled_hexagon, const int hex_width, con
}
/* Plot line of top left quadrant */
plot_hexline(scaled_hexagon, hex_width, hex_height, hx_start, start_y, end_x, hy_start);
plot_hexline(scaled_hexagon, hex_width, hex_height, hx_start, start_y, end_x, hy_start, ink);
/* Fill to right */
not_top = 0;
@@ -712,15 +706,16 @@ static void plot_hexagon(unsigned char *scaled_hexagon, const int hex_width, con
int first = -1;
for (i = hx_start; i < hx_start + hx_radius + hx_width_odd; i++) {
if (first != -1) {
scaled_hexagon[(hex_width * line) + i] = DEFAULT_INK;
scaled_hexagon[(hex_width * line) + i] = ink;
not_top = 1;
} else if (scaled_hexagon[(hex_width * line) + i] == DEFAULT_INK) {
} else if (scaled_hexagon[(hex_width * line) + i] == ink) {
first = i + 1;
}
}
if (not_top && first == -1) { /* Fill empty lines at bottom */
if (not_top && first == -1) {
/* Fill empty lines at bottom */
for (i = hx_start; i < hx_start + hx_radius + hx_width_odd; i++) {
scaled_hexagon[(hex_width * line) + i] = DEFAULT_INK;
scaled_hexagon[(hex_width * line) + i] = ink;
}
}
}
@@ -728,8 +723,8 @@ static void plot_hexagon(unsigned char *scaled_hexagon, const int hex_width, con
/* Copy left quadrant to right, flipping horizontally */
for (line = hy_start; line < hy_start + hy_radius + hy_height_odd; line++) {
for (i = hx_start; i < hx_start + hx_radius + hx_width_odd; i++) {
if (scaled_hexagon[(hex_width * line) + i] == DEFAULT_INK) {
scaled_hexagon[(hex_width * line) + hex_width - hx_end - (i - hx_start + 1)] = DEFAULT_INK;
if (scaled_hexagon[(hex_width * line) + i] == ink) {
scaled_hexagon[(hex_width * line) + hex_width - hx_end - (i - hx_start + 1)] = ink;
}
}
}
@@ -737,8 +732,8 @@ static void plot_hexagon(unsigned char *scaled_hexagon, const int hex_width, con
/* Copy top to bottom, flipping vertically */
for (line = hy_start; line < hy_start + hy_radius + hy_height_odd; line++) {
for (i = hx_start; i < hex_width; i++) {
if (scaled_hexagon[(hex_width * line) + i] == DEFAULT_INK) {
scaled_hexagon[(hex_width * (hex_height - hy_end - (line - hy_start + 1))) + i] = DEFAULT_INK;
if (scaled_hexagon[(hex_width * line) + i] == ink) {
scaled_hexagon[(hex_width * (hex_height - hy_end - (line - hy_start + 1))) + i] = ink;
}
}
}
@@ -748,7 +743,7 @@ static void plot_hexagon(unsigned char *scaled_hexagon, const int hex_width, con
static void draw_bind_box(const struct zint_symbol *symbol, unsigned char *pixelbuf,
const int xoffset_si, const int yoffset_si, const int symbol_height_si, const int dot_overspill_si,
const int upceanflag, const int textoffset_si, const int image_width, const int image_height,
const int si) {
const int si, const int ink) {
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND | BARCODE_BIND_TOP))) {
const int no_extend = symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF
|| symbol->symbology == BARCODE_DPD;
@@ -759,24 +754,23 @@ static void draw_bind_box(const struct zint_symbol *symbol, unsigned char *pixel
if (horz_outside) {
ybind_top = 0;
ybind_bot = image_height - bwidth_si;
} else if (upceanflag == 2 || upceanflag == 5) {
} else if (upceanflag == OUT_UPCEANFLAG_EAN2 || upceanflag == OUT_UPCEANFLAG_EAN5) {
ybind_top += textoffset_si;
ybind_bot += textoffset_si;
}
/* Horizontal boundary bars */
if ((symbol->output_options & BARCODE_BOX) || !no_extend) {
/* Box or not CodaBlockF/DPD */
draw_bar(pixelbuf, 0, image_width, ybind_top, bwidth_si, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, 0, image_width, ybind_top, bwidth_si, image_width, image_height, ink);
if (!(symbol->output_options & BARCODE_BIND_TOP)) { /* Trumps BARCODE_BOX & BARCODE_BIND */
draw_bar(pixelbuf, 0, image_width, ybind_bot, bwidth_si, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, 0, image_width, ybind_bot, bwidth_si, image_width, image_height, ink);
}
} else {
/* CodaBlockF/DPD bind - does not extend over horizontal whitespace */
const int width_si = symbol->width * si;
draw_bar(pixelbuf, xoffset_si, width_si, ybind_top, bwidth_si, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, xoffset_si, width_si, ybind_top, bwidth_si, image_width, image_height, ink);
if (!(symbol->output_options & BARCODE_BIND_TOP)) { /* Trumps BARCODE_BOX & BARCODE_BIND */
draw_bar(pixelbuf, xoffset_si, width_si, ybind_bot, bwidth_si, image_width, image_height,
DEFAULT_INK);
draw_bar(pixelbuf, xoffset_si, width_si, ybind_bot, bwidth_si, image_width, image_height, ink);
}
}
/* BARCODE_BIND_TOP trumps BARCODE_BOX */
@@ -788,11 +782,11 @@ static void draw_bind_box(const struct zint_symbol *symbol, unsigned char *pixel
if (horz_outside) {
box_top = bwidth_si;
box_height = image_height - bwidth_si * 2;
} else if (upceanflag == 2 || upceanflag == 5) {
} else if (upceanflag == OUT_UPCEANFLAG_EAN2 || upceanflag == OUT_UPCEANFLAG_EAN5) {
box_top += textoffset_si;
}
draw_bar(pixelbuf, 0, bwidth_si, box_top, box_height, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, xbox_right, bwidth_si, box_top, box_height, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, 0, bwidth_si, box_top, box_height, image_width, image_height, ink);
draw_bar(pixelbuf, xbox_right, bwidth_si, box_top, box_height, image_width, image_height, ink);
}
}
}
@@ -814,6 +808,10 @@ static int plot_raster_maxicode(struct zint_symbol *symbol, const int rotate_ang
int yposn_offset;
int xoffset_si, yoffset_si, roffset_si, boffset_si;
const int grayscale = zint_out_grayscale(symbol);
const int ink = grayscale ? 0xFF : DEFAULT_INK;
const int paper = grayscale ? 0x00 : DEFAULT_PAPER;
const float two_div_sqrt3 = 1.1547f; /* 2 / √3 */
const float sqrt3_div_two = 0.866f; /* √3 / 2 == 1.5 / √3 */
@@ -854,16 +852,16 @@ static int plot_raster_maxicode(struct zint_symbol *symbol, const int rotate_ang
if (!(pixelbuf = (unsigned char *) raster_malloc_mc_pixelbuf(image_size, 0 /*prev_size*/))) {
return z_errtxt(ZINT_ERROR_MEMORY, symbol, 655, "Insufficient memory for pixel buffer");
}
memset(pixelbuf, DEFAULT_PAPER, image_size);
memset(pixelbuf, paper, image_size);
hex_size = (size_t) hex_width * hex_height;
if (!(scaled_hexagon = (unsigned char *) raster_malloc_mc_hexagon(hex_size, image_size))) {
free(pixelbuf);
return z_errtxt(ZINT_ERROR_MEMORY, symbol, 656, "Insufficient memory for pixel buffer");
}
memset(scaled_hexagon, DEFAULT_PAPER, hex_size);
memset(scaled_hexagon, paper, hex_size);
plot_hexagon(scaled_hexagon, hex_width, hex_height, hx_start, hy_start, hx_end, hy_end);
plot_hexagon(scaled_hexagon, hex_width, hex_height, hx_start, hy_start, hx_end, hy_end, ink);
for (row = 0; row < symbol->rows; row++) {
const int odd_row = row & 1; /* Odd (reduced) row, even (full) row */
@@ -873,16 +871,16 @@ static int plot_raster_maxicode(struct zint_symbol *symbol, const int rotate_ang
const int xposn = column * hex_width + xposn_offset;
if (z_module_is_set(symbol, row, column)) {
draw_hexagon(pixelbuf, image_width, image_height, scaled_hexagon, hex_width, hex_height, xposn,
yposn);
yposn, ink);
}
}
}
draw_bullseye(pixelbuf, image_width, image_height, hex_width, hex_height, hx_start, hx_end, hex_image_height,
xoffset_si, yoffset_si);
xoffset_si, yoffset_si, ink, paper);
draw_bind_box(symbol, pixelbuf, xoffset_si, yoffset_si, hex_image_height, 0 /*dot_overspill_si*/,
0 /*upceanflag*/, 0 /*textoffset_si*/, image_width, image_height, (int) scaler);
0 /*upceanflag*/, 0 /*textoffset_si*/, image_width, image_height, (int) scaler, ink);
error_number = save_raster_image_to_file(symbol, image_height, image_width, pixelbuf, rotate_angle, file_type);
free(scaled_hexagon);
@@ -916,6 +914,10 @@ static int plot_raster_dotty(struct zint_symbol *symbol, const int rotate_angle,
int xoffset_si, yoffset_si, roffset_si, boffset_si;
int symbol_height_si;
const int grayscale = zint_out_grayscale(symbol);
const int ink = grayscale ? 0xFF : DEFAULT_INK;
const int paper = grayscale ? 0x00 : DEFAULT_PAPER;
if (scaler < 2.0f) {
scaler = 2.0f;
}
@@ -932,7 +934,8 @@ static int plot_raster_dotty(struct zint_symbol *symbol, const int rotate_angle,
dot_overspill_si = 0;
/* Offset (1 - dot_size) / 2 + dot_radius == (1 - dot_size + dot_size) / 2 == 1 / 2 */
dot_offset_s = scaler / 2.0f;
} else { /* Allow for exceeding 1X */
} else {
/* Allow for exceeding 1X */
dot_overspill_si = (int) ceilf((symbol->dot_size - 1.0f) * scaler);
dot_offset_s = dot_radius_s;
}
@@ -948,7 +951,7 @@ static int plot_raster_dotty(struct zint_symbol *symbol, const int rotate_angle,
if (!(scaled_pixelbuf = (unsigned char *) raster_malloc_dotty_scaled(scale_size, 0 /*prev_size*/))) {
return z_errtxt(ZINT_ERROR_MEMORY, symbol, 657, "Insufficient memory for pixel buffer");
}
memset(scaled_pixelbuf, DEFAULT_PAPER, scale_size);
memset(scaled_pixelbuf, paper, scale_size);
/* Plot the body of the symbol to the pixel buffer */
for (r = 0; r < symbol->rows; r++) {
@@ -956,14 +959,13 @@ static int plot_raster_dotty(struct zint_symbol *symbol, const int rotate_angle,
for (i = 0; i < symbol->width; i++) {
if (z_module_is_set(symbol, r, i)) {
draw_circle(scaled_pixelbuf, scale_width, scale_height,
(int) (i * scaler + xoffset_si + dot_offset_s),
row_si, dot_radius_si, DEFAULT_INK);
(int) (i * scaler + xoffset_si + dot_offset_s), row_si, dot_radius_si, ink);
}
}
}
draw_bind_box(symbol, scaled_pixelbuf, xoffset_si, yoffset_si, symbol_height_si, dot_overspill_si,
0 /*upceanflag*/, 0 /*textoffset_si*/, scale_width, scale_height, (int) scaler);
0 /*upceanflag*/, 0 /*textoffset_si*/, scale_width, scale_height, (int) scaler, ink);
error_number = save_raster_image_to_file(symbol, scale_height, scale_width, scaled_pixelbuf, rotate_angle,
file_type);
@@ -974,45 +976,6 @@ static int plot_raster_dotty(struct zint_symbol *symbol, const int rotate_angle,
return error_number;
}
/* Convert UTF-8 to ISO/IEC 8859-1 for `draw_string()` human readable text */
static void to_iso8859_1(const unsigned char source[], unsigned char preprocessed[]) {
int j, i, input_length;
input_length = (int) z_ustrlen(source);
j = 0;
i = 0;
while (i < input_length) {
switch (source[i]) {
case 0xC2:
/* UTF-8 C2xxh */
/* Character range: C280h (latin: 80h) to C2BFh (latin: BFh) */
assert(i + 1 < input_length);
i++;
preprocessed[j] = source[i];
j++;
break;
case 0xC3:
/* UTF-8 C3xx */
/* Character range: C380h (latin: C0h) to C3BFh (latin: FFh) */
assert(i + 1 < input_length);
i++;
preprocessed[j] = source[i] + 64;
j++;
break;
default:
/* Process ASCII (< 80h), all other unicode points are ignored */
if (z_isascii(source[i])) {
preprocessed[j] = source[i];
j++;
}
break;
}
i++;
}
preprocessed[j] = '\0';
}
static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angle, const int file_type) {
int error_number, warn_number = 0;
int main_width;
@@ -1028,13 +991,17 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
int hide_text;
int i, r;
int block_width = 0;
int font_height; /* Font pixel size (so whole integers) */
float guard_descent;
float large_bar_height;
struct zfont zfnt_s;
struct zfont *const zfnt = &zfnt_s;
const int upcean_guard_whitespace = !(symbol->output_options & BARCODE_NO_QUIET_ZONES)
&& (symbol->output_options & EANUPC_GUARD_WHITESPACE);
const int is_codablockf = symbol->symbology == BARCODE_CODABLOCKF || symbol->symbology == BARCODE_HIBC_BLOCKF;
const int grayscale = zint_out_grayscale(symbol);
const int ink = grayscale ? 0xFF : DEFAULT_INK;
const int paper = grayscale ? 0x00 : DEFAULT_PAPER;
int textflags = 0;
int xoffset_si, yoffset_si, roffset_si, boffset_si, qz_right_si;
int xoffset_comp_si;
@@ -1077,7 +1044,11 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
upceanflag = zint_out_process_upcean(symbol, comp_xoffset, &main_width, addon, &addon_len, &addon_gap);
}
hide_text = !symbol->show_hrt || symbol->text_length == 0 || scaler < 1.0f;
hide_text = !(symbol->show_hrt & 0x7) || symbol->text_length == 0 || (scaler < 1.0f && !grayscale);
if ((error_number = zint_font_init(zfnt, symbol, upceanflag))) {
return error_number;
}
zint_out_set_whitespace_offsets(symbol, hide_text, comp_xoffset, &xoffset, &yoffset, &roffset, &boffset,
NULL /*qz_right*/, si, &xoffset_si, &yoffset_si, &roffset_si, &boffset_si,
@@ -1090,24 +1061,30 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
/* Note font sizes halved as in pixels */
if (upceanflag) {
textflags = ZFONT_UPCEAN_TEXT | (symbol->output_options & SMALL_TEXT); /* Bold not available for EAN/UPC */
font_height = (UPCEAN_FONT_HEIGHT + 1) / 2;
/* Height of guard bar descent (none for EAN-2 and EAN-5) */
guard_descent = upceanflag >= 6 ? symbol->guard_descent : 0.0f;
guard_descent = upceanflag >= OUT_UPCEANFLAG_UPCE ? symbol->guard_descent : 0.0f;
} else {
textflags = symbol->output_options & (SMALL_TEXT | BOLD_TEXT);
font_height = textflags & SMALL_TEXT ? (SMALL_FONT_HEIGHT + 1) / 2 : (NORMAL_FONT_HEIGHT + 1) / 2;
guard_descent = 0.0f;
}
if ((error_number = zint_font_text_height(zfnt, symbol, si, image_width, addon, addon_len))) {
goto errexit;
}
if (hide_text) {
textoffset = guard_descent;
if (addon_len && large_bar_height + textoffset < font_height + symbol->text_gap) {
textoffset = font_height + symbol->text_gap - large_bar_height;
if (addon_len && large_bar_height + textoffset < zfnt->text_height + symbol->text_gap) {
textoffset = zfnt->text_height + symbol->text_gap - large_bar_height;
}
} else {
textoffset = font_height + symbol->text_gap;
if (upceanflag && textoffset < guard_descent) {
textoffset = guard_descent;
if (upceanflag) {
textoffset = zfnt->text_height + symbol->text_gap;
if (textoffset < guard_descent) {
textoffset = guard_descent;
}
} else {
textoffset = zfnt->text_height + symbol->text_gap;
}
}
textoffset_si = (int) ceilf(textoffset * si);
@@ -1121,9 +1098,10 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
image_size = (size_t) image_width * image_height;
if (!(pixelbuf = (unsigned char *) raster_malloc_pixelbuf(image_size, 0 /*prev_size*/))) {
return z_errtxt(ZINT_ERROR_MEMORY, symbol, 658, "Insufficient memory for pixel buffer");
error_number = z_errtxt(ZINT_ERROR_MEMORY, symbol, 658, "Insufficient memory for pixel buffer");
goto errexit;
}
memset(pixelbuf, DEFAULT_PAPER, image_size);
memset(pixelbuf, paper, image_size);
yposn_si = yoffset_si;
@@ -1147,7 +1125,8 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
yposn_si += row_height_si;
}
} else if (upceanflag >= 6) { /* UPC-E, EAN-8, UPC-A, EAN-13 */
/* UPC-E, EAN-8, UPC-A, EAN-13 */
} else if (upceanflag >= OUT_UPCEANFLAG_UPCE) {
for (r = 0; r < symbol->rows; r++) {
int row_height_si = row_heights_si[r];
@@ -1157,7 +1136,7 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
&& z_module_is_set(symbol, r, i + block_width) == fill; block_width++);
if (r == symbol->rows - 1 && i > main_width && addon_latch == 0) {
int addon_row_height_si;
const int addon_row_adj_si = (int) ceilf((font_height + symbol->text_gap) * si);
const int addon_row_adj_si = (int) ceilf((zfnt->text_height + symbol->text_gap) * si);
copy_bar_line(pixelbuf, xoffset_si, main_width * si, yposn_si, row_height_si, image_width,
image_height);
addon_text_yposn = yposn_si;
@@ -1174,8 +1153,7 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
}
if (fill) {
/* a bar */
draw_bar_line(pixelbuf, i * si + xoffset_si, block_width * si, yposn_si, image_width,
DEFAULT_INK);
draw_bar_line(pixelbuf, i * si + xoffset_si, block_width * si, yposn_si, image_width, ink);
}
}
if (addon_latch) {
@@ -1204,9 +1182,8 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
for (block_width = 1; (i + block_width < symbol->width)
&& z_module_is_set(symbol, r, i + block_width) == fill; block_width++);
if (fill) {
/* a bar */
draw_bar_line(pixelbuf, i * si + xoffset_si, block_width * si, yposn_si, image_width,
DEFAULT_INK);
/* A bar */
draw_bar_line(pixelbuf, i * si + xoffset_si, block_width * si, yposn_si, image_width, ink);
}
}
copy_bar_line(pixelbuf, xoffset_si, image_width - xoffset_si - roffset_si, yposn_si, row_height_si,
@@ -1215,30 +1192,33 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
}
}
if (guard_descent && upceanflag >= 6) { /* UPC-E, EAN-8, UPC-A, EAN-13 */
/* Guard bar extension */
/* Guard bar extension UPC-E, EAN-8, UPC-A, EAN-13 */
if (guard_descent && upceanflag >= OUT_UPCEANFLAG_UPCE) {
const int guard_yoffset_si = yoffset_si + symbol_height_si;
const int guard_descent_si = guard_descent * si;
int copy_bar_width;
if (upceanflag == 6) { /* UPC-E */
draw_bar_line(pixelbuf, 0 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 2 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 46 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 48 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 50 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
if (upceanflag == OUT_UPCEANFLAG_UPCE) {
draw_bar_line(pixelbuf, 0 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 2 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 46 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 48 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 50 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
copy_bar_width = (50 + 1) * si;
} else if (upceanflag == 8) { /* EAN-8 */
draw_bar_line(pixelbuf, 0 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 2 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 32 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 34 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 64 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 66 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
/* EAN-8 */
} else if (upceanflag == OUT_UPCEANFLAG_EAN8) {
draw_bar_line(pixelbuf, 0 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 2 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 32 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 34 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 64 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 66 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
copy_bar_width = (66 + 1) * si;
} else if (upceanflag == 12) { /* UPC-A */
/* UPC-A */
} else if (upceanflag == OUT_UPCEANFLAG_UPCA) {
assert(symbol->rows >= 1); /* Suppress clang-tidy-23 clang-analyzer-security.ArrayBound (again) */
for (i = 0 + comp_xoffset; i < 11 + comp_xoffset; i += block_width) {
const int fill = z_module_is_set(symbol, symbol->rows - 1, i);
for (block_width = 1; (i + block_width < symbol->width)
@@ -1246,11 +1226,11 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
block_width++);
if (fill) {
draw_bar_line(pixelbuf, i * si + xoffset_si, block_width * si, guard_yoffset_si, image_width,
DEFAULT_INK);
ink);
}
}
draw_bar_line(pixelbuf, 46 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 48 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 46 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 48 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
for (i = 85 + comp_xoffset; i < 96 + comp_xoffset; i += block_width) {
const int fill = z_module_is_set(symbol, symbol->rows - 1, i);
for (block_width = 1; (i + block_width < symbol->width)
@@ -1258,18 +1238,20 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
block_width++);
if (fill) {
draw_bar_line(pixelbuf, i * si + xoffset_si, block_width * si, guard_yoffset_si, image_width,
DEFAULT_INK);
ink);
}
}
copy_bar_width = 95 * si;
} else { /* EAN-13 */
draw_bar_line(pixelbuf, 0 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 2 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 46 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 48 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 92 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
draw_bar_line(pixelbuf, 94 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, DEFAULT_INK);
/* EAN-13 */
} else {
assert(upceanflag == OUT_UPCEANFLAG_EAN13);
draw_bar_line(pixelbuf, 0 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 2 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 46 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 48 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 92 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
draw_bar_line(pixelbuf, 94 * si + xoffset_comp_si, 1 * si, guard_yoffset_si, image_width, ink);
copy_bar_width = (94 + 1) * si;
}
copy_bar_line(pixelbuf, xoffset_comp_si, copy_bar_width, guard_yoffset_si, guard_descent_si, image_width,
@@ -1280,7 +1262,8 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
if (!hide_text) {
if (upceanflag >= 6) { /* UPC-E, EAN-8, UPC-A, EAN-13 */
/* UPC-E, EAN-8, UPC-A, EAN-13 */
if (upceanflag >= OUT_UPCEANFLAG_UPCE) {
/* Note font sizes halved as in pixels */
const int upcea_height_adj = ((UPCEAN_FONT_HEIGHT - UPCEAN_SMALL_FONT_HEIGHT) * si + 1) / 2;
@@ -1291,10 +1274,10 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
text_yposn += symbol->border_width * si;
}
if (upceanflag == 6) { /* UPC-E */
if (upceanflag == OUT_UPCEANFLAG_UPCE) {
int text_xposn = -5 * si + xoffset_comp_si;
draw_string(pixelbuf, symbol->text, 1, text_xposn, text_yposn + upcea_height_adj,
textflags | SMALL_TEXT | ZFONT_HALIGN_RIGHT, image_width, image_height, si);
textflags | SMALL_TEXT | OUT_HALIGN_RIGHT, image_width, image_height, si);
text_xposn = 24 * si + xoffset_comp_si;
draw_string(pixelbuf, symbol->text + 1, 6, text_xposn, text_yposn, textflags, image_width,
image_height, si);
@@ -1302,7 +1285,7 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
digit's righthand to touch any add-on, now that they descend, so use 2X, until clarified */
text_xposn = (51 + 2) * si + xoffset_comp_si;
draw_string(pixelbuf, symbol->text + 7, 1, text_xposn, text_yposn + upcea_height_adj,
textflags | SMALL_TEXT | ZFONT_HALIGN_LEFT, image_width, image_height, si);
textflags | SMALL_TEXT | OUT_HALIGN_LEFT, image_width, image_height, si);
if (addon_len) {
text_xposn = ((addon_len == 2 ? 61 : 75) + addon_gap) * si + xoffset_comp_si;
draw_string(pixelbuf, addon, addon_len, text_xposn, addon_text_yposn, textflags,
@@ -1310,16 +1293,16 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
if (upcean_guard_whitespace) {
text_xposn = symbol->width * si + qz_right_si + xoffset_si;
draw_string(pixelbuf, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn,
textflags | ZFONT_HALIGN_RIGHT, image_width, image_height, si);
textflags | OUT_HALIGN_RIGHT, image_width, image_height, si);
}
}
} else if (upceanflag == 8) { /* EAN-8 */
} else if (upceanflag == OUT_UPCEANFLAG_EAN8) {
int text_xposn;
if (upcean_guard_whitespace) {
text_xposn = -7 * si + xoffset_comp_si;
draw_string(pixelbuf, (const unsigned char *) "<", 1, text_xposn, text_yposn,
textflags | ZFONT_HALIGN_LEFT, image_width, image_height, si);
textflags | OUT_HALIGN_LEFT, image_width, image_height, si);
}
text_xposn = 17 * si + xoffset_comp_si;
draw_string(pixelbuf, symbol->text, 4, text_xposn, text_yposn, textflags, image_width, image_height,
@@ -1334,18 +1317,18 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
if (upcean_guard_whitespace) {
text_xposn = symbol->width * si + qz_right_si + xoffset_si;
draw_string(pixelbuf, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn,
textflags | ZFONT_HALIGN_RIGHT, image_width, image_height, si);
textflags | OUT_HALIGN_RIGHT, image_width, image_height, si);
}
} else if (upcean_guard_whitespace) {
text_xposn = symbol->width * si + qz_right_si + xoffset_si;
draw_string(pixelbuf, (const unsigned char *) ">", 1, text_xposn, text_yposn,
textflags | ZFONT_HALIGN_RIGHT, image_width, image_height, si);
textflags | OUT_HALIGN_RIGHT, image_width, image_height, si);
}
} else if (upceanflag == 12) { /* UPC-A */
} else if (upceanflag == OUT_UPCEANFLAG_UPCA) {
int text_xposn = -5 * si + xoffset_comp_si;
draw_string(pixelbuf, symbol->text, 1, text_xposn, text_yposn + upcea_height_adj,
textflags | SMALL_TEXT | ZFONT_HALIGN_RIGHT, image_width, image_height, si);
textflags | SMALL_TEXT | OUT_HALIGN_RIGHT, image_width, image_height, si);
text_xposn = 28 * si + xoffset_comp_si;
draw_string(pixelbuf, symbol->text + 1, 5, text_xposn, text_yposn, textflags, image_width,
image_height, si);
@@ -1356,7 +1339,7 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
digit's righthand to touch any add-on, now that they descend, so use 4X, until clarified */
text_xposn = (95 + 4) * si + xoffset_comp_si;
draw_string(pixelbuf, symbol->text + 11, 1, text_xposn, text_yposn + upcea_height_adj,
textflags | SMALL_TEXT | ZFONT_HALIGN_LEFT, image_width, image_height, si);
textflags | SMALL_TEXT | OUT_HALIGN_LEFT, image_width, image_height, si);
if (addon_len) {
text_xposn = ((addon_len == 2 ? 105 : 119) + addon_gap) * si + xoffset_comp_si;
draw_string(pixelbuf, addon, addon_len, text_xposn, addon_text_yposn, textflags,
@@ -1364,13 +1347,15 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
if (upcean_guard_whitespace) {
text_xposn = symbol->width * si + qz_right_si + xoffset_si;
draw_string(pixelbuf, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn,
textflags | ZFONT_HALIGN_RIGHT, image_width, image_height, si);
textflags | OUT_HALIGN_RIGHT, image_width, image_height, si);
}
}
} else { /* EAN-13 */
/* EAN-13 */
} else {
int text_xposn = -5 * si + xoffset_comp_si;
draw_string(pixelbuf, symbol->text, 1, text_xposn, text_yposn, textflags | ZFONT_HALIGN_RIGHT,
assert(upceanflag == OUT_UPCEANFLAG_EAN13);
draw_string(pixelbuf, symbol->text, 1, text_xposn, text_yposn, textflags | OUT_HALIGN_RIGHT,
image_width, image_height, si);
text_xposn = 24 * si + xoffset_comp_si;
draw_string(pixelbuf, symbol->text + 1, 6, text_xposn, text_yposn, textflags, image_width,
@@ -1385,17 +1370,19 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
if (upcean_guard_whitespace) {
text_xposn = symbol->width * si + qz_right_si + xoffset_si;
draw_string(pixelbuf, (const unsigned char *) ">", 1, text_xposn, addon_text_yposn,
textflags | ZFONT_HALIGN_RIGHT, image_width, image_height, si);
textflags | OUT_HALIGN_RIGHT, image_width, image_height, si);
}
} else if (upcean_guard_whitespace) {
text_xposn = symbol->width * si + qz_right_si + xoffset_si;
draw_string(pixelbuf, (const unsigned char *) ">", 1, text_xposn, text_yposn,
textflags | ZFONT_HALIGN_RIGHT, image_width, image_height, si);
textflags | OUT_HALIGN_RIGHT, image_width, image_height, si);
}
}
} else if (upceanflag) { /* EAN-2, EAN-5 (standalone add-ons) */
/* EAN-2, EAN-5 (standalone add-ons) */
} else if (upceanflag) {
int text_xposn = (int) ((main_width / 2.0f) * si) + xoffset_si;
int text_yposn = yoffset_si;
assert(upceanflag == OUT_UPCEANFLAG_EAN2 || upceanflag == OUT_UPCEANFLAG_EAN5);
if (symbol->border_width > 0
&& (symbol->output_options & (BARCODE_BOX | BARCODE_BIND | BARCODE_BIND_TOP))) {
text_yposn -= symbol->border_width * si;
@@ -1405,20 +1392,26 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
if (upcean_guard_whitespace) {
text_xposn = symbol->width * si + qz_right_si + xoffset_comp_si;
draw_string(pixelbuf, (const unsigned char *) ">", 1, text_xposn, text_yposn,
textflags | ZFONT_HALIGN_RIGHT, image_width, image_height, si);
textflags | OUT_HALIGN_RIGHT, image_width, image_height, si);
}
} else {
/* Suppress clang-analyzer-core.CallAndMessage warning */
unsigned char local_text[sizeof(symbol->text)] = {0};
int text_xposn = (int) ((main_width / 2.0f) * si) + xoffset_si;
int text_yposn = yoffset_si + symbol_height_si + (int) (symbol->text_gap * si);
assert(!upceanflag);
if (symbol->border_width > 0 && (symbol->output_options & (BARCODE_BOX | BARCODE_BIND))
&& !(symbol->output_options & BARCODE_BIND_TOP)) { /* Trumps BARCODE_BOX & BARCODE_BIND */
text_yposn += symbol->border_width * si;
}
to_iso8859_1(symbol->text, local_text);
if (symbol->show_hrt & ZINT_HRT_HALIGN_LEFT) {
textflags |= OUT_HALIGN_LEFT;
} else if (symbol->show_hrt & ZINT_HRT_HALIGN_RIGHT) {
textflags |= OUT_HALIGN_RIGHT;
}
/* Put the human readable text at the bottom */
draw_string(pixelbuf, local_text, -1, text_xposn, text_yposn, textflags, image_width, image_height, si);
for (i = 0; i < zfnt->lines; i++) {
zint_font_text_render(zfnt, symbol, pixelbuf, i, main_width * si, xoffset_si, roffset_si, text_yposn,
textflags, image_width, image_height, si);
text_yposn += zfnt->line_advance;
}
}
}
@@ -1444,13 +1437,13 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
}
for (r = 1; r < symbol->rows; r++) {
draw_bar(pixelbuf, sep_xoffset_si, sep_width_si, sep_yoffset_si, sep_height_si, image_width, image_height,
DEFAULT_INK);
ink);
sep_yoffset_si += row_heights_si[r];
}
}
draw_bind_box(symbol, pixelbuf, xoffset_si, yoffset_si, symbol_height_si, 0 /*dot_overspill_si*/, upceanflag,
textoffset_si, image_width, image_height, si);
textoffset_si, image_width, image_height, si, ink);
if (!half_int_scaling) {
size_t prev_image_row;
@@ -1462,9 +1455,10 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
if (!(scaled_pixelbuf = (unsigned char *) raster_malloc_scaled((size_t) scale_width * scale_height,
image_size))) {
free(pixelbuf);
return z_errtxt(ZINT_ERROR_MEMORY, symbol, 659, "Insufficient memory for scaled pixel buffer");
error_number = z_errtxt(ZINT_ERROR_MEMORY, symbol, 659, "Insufficient memory for scaled pixel buffer");
goto errexit;
}
memset(scaled_pixelbuf, DEFAULT_PAPER, (size_t) scale_width * scale_height);
memset(scaled_pixelbuf, paper, (size_t) scale_width * scale_height);
/* Interpolate */
for (r = 0; r < scale_height; r++) {
@@ -1494,6 +1488,10 @@ static int plot_raster_default(struct zint_symbol *symbol, const int rotate_angl
free(pixelbuf);
}
}
errexit:
zint_font_free(zfnt, si);
return error_number ? error_number : warn_number;
}
+10 -5
View File
@@ -304,7 +304,8 @@ INTERNAL int zint_dbar_stk_set_height(struct zint_symbol *symbol, const int firs
symbol->row_height[second_row] = 0.7f; /* 0.7f is actually 0.699999988 (0x3F333333) */
} else {
symbol->row_height[second_row] = z_stripf(symbol->height - fixed_height - symbol->row_height[first_row]);
/* (h - 1) * 5/12 >= 0.5 -> h - 1 >= 0.5 * 12/5 -> h >= 2.2 -> rh[sr] >= (2.2 - 1 - 0.5) -> rh[sr] >= 0.7 */
/* (h - 1) * 5/12 >= 0.5 -> h - 1 >= 0.5 * 12/5 -> h >= 2.2 -> rh[sr] >= (2.2 - 1 - 0.5)
-> rh[sr] >= 0.7 */
assert(symbol->row_height[second_row] >= 0.7f);
}
}
@@ -469,9 +470,6 @@ INTERNAL int zint_dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[]
}
symbol->rows++;
/* Set human readable text */
dbar_set_gtin14_hrt(symbol, source, length);
if (symbol->output_options & COMPLIANT_HEIGHT) {
/* Minimum height is 13X for truncated symbol ISO/IEC 24724:2011 5.3.1
Default height is 33X for DataBar Omnidirectional ISO/IEC 24724:2011 5.2 */
@@ -581,6 +579,12 @@ INTERNAL int zint_dbar_omn_cc(struct zint_symbol *symbol, unsigned char source[]
}
}
if (symbol->symbology == BARCODE_DBAR_OMN || symbol->symbology == BARCODE_DBAR_OMN_CC
|| (symbol->show_hrt & 0x7) >= ZINT_HRT_STACKED) {
/* Set human readable text */
dbar_set_gtin14_hrt(symbol, source, length);
}
if (content_segs) {
unsigned char buf[14];
if (z_ct_cpy_cat(symbol, ZCUCP("01"), 2, '\xFF' /*none*/, dbar_gtin14(source, length, buf), 14)) {
@@ -1218,7 +1222,8 @@ INTERNAL int zint_dbar_exp_cc(struct zint_symbol *symbol, unsigned char source[]
int reduced_length;
/* Allow for 8 bits + 5-bit latch per char + 200 bits overhead/padding */
char *binary_string = (char *) z_alloca(13 * length + 200 + 1);
const int set_hrt = symbol->symbology == BARCODE_DBAR_EXP || symbol->symbology == BARCODE_DBAR_EXP_CC;
const int set_hrt = symbol->symbology == BARCODE_DBAR_EXP || symbol->symbology == BARCODE_DBAR_EXP_CC
|| (symbol->show_hrt & 0x7) >= ZINT_HRT_STACKED;
const int content_segs = symbol->output_options & BARCODE_CONTENT_SEGS;
const int debug_print = symbol->debug & ZINT_DEBUG_PRINT;
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,15 +1,15 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 224 117
%%BoundingBox: 0 0 224 118
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
116.28 0 0 224 R
117.92 0 0 224 R
0 0 0 setrgbcolor
100 16.28 I 0 4 R
100 17.92 I 0 4 R
I 6 2 R
I 12 2 R
I 22 2 R
@@ -48,6 +48,6 @@ currentdict
end
/Helvetica-ISOLatin1 exch definefont pop
/Helvetica-ISOLatin1 findfont 14 scalefont setfont
112 2.94 moveto
112 4.58 moveto
(Égjpqy) stringwidth pop -2 div 0 rmoveto
(Égjpqy) show
@@ -1,13 +1,13 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 224 117
%%BoundingBox: 0 0 224 118
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
116.28 0 0 224 R
117.92 0 0 224 R
0 0 0 setrgbcolor
100 0 I 220 4 R
I 216 2 R
@@ -1,13 +1,13 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 117 224
%%BoundingBox: 0 0 118 224
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
224 0 0 116.28 R
224 0 0 117.92 R
0 0 0 setrgbcolor
4 0 0 100 R
2 6 0 100 R
@@ -1,45 +1,45 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 117 224
%%BoundingBox: 0 0 118 224
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
224 0 0 116.28 R
224 0 0 117.92 R
0 0 0 setrgbcolor
4 220 16.28 100 R
2 216 16.28 100 R
2 210 16.28 100 R
2 200 16.28 100 R
8 190 16.28 100 R
6 182 16.28 100 R
4 176 16.28 100 R
2 168 16.28 100 R
2 160 16.28 100 R
2 156 16.28 100 R
4 148 16.28 100 R
2 144 16.28 100 R
2 134 16.28 100 R
4 122 16.28 100 R
2 116 16.28 100 R
2 112 16.28 100 R
2 108 16.28 100 R
8 96 16.28 100 R
2 90 16.28 100 R
2 84 16.28 100 R
8 74 16.28 100 R
4 66 16.28 100 R
4 60 16.28 100 R
8 50 16.28 100 R
2 46 16.28 100 R
4 36 16.28 100 R
2 28 16.28 100 R
4 22 16.28 100 R
6 10 16.28 100 R
2 6 16.28 100 R
4 0 16.28 100 R
4 220 17.92 100 R
2 216 17.92 100 R
2 210 17.92 100 R
2 200 17.92 100 R
8 190 17.92 100 R
6 182 17.92 100 R
4 176 17.92 100 R
2 168 17.92 100 R
2 160 17.92 100 R
2 156 17.92 100 R
4 148 17.92 100 R
2 144 17.92 100 R
2 134 17.92 100 R
4 122 17.92 100 R
2 116 17.92 100 R
2 112 17.92 100 R
2 108 17.92 100 R
8 96 17.92 100 R
2 90 17.92 100 R
2 84 17.92 100 R
8 74 17.92 100 R
4 66 17.92 100 R
4 60 17.92 100 R
8 50 17.92 100 R
2 46 17.92 100 R
4 36 17.92 100 R
2 28 17.92 100 R
4 22 17.92 100 R
6 10 17.92 100 R
2 6 17.92 100 R
4 0 17.92 100 R
/Helvetica-Bold findfont
dup length dict begin
{1 index /FID ne {def} {pop pop} ifelse} forall
@@ -48,7 +48,7 @@ currentdict
end
/Helvetica-ISOLatin1 exch definefont pop
/Helvetica-ISOLatin1 findfont 14 scalefont setfont
2.94 112 moveto
4.58 112 moveto
gsave
270 rotate
(Égjpqy) stringwidth pop -2 div 0 rmoveto
@@ -1,15 +1,15 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 246 117
%%BoundingBox: 0 0 246 118
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
116.28 0 0 246 R
117.92 0 0 246 R
0 0 0 setrgbcolor
100 16.28 I 0 4 R
100 17.92 I 0 4 R
I 6 2 R
I 12 2 R
I 22 2 R
@@ -51,6 +51,6 @@ currentdict
end
/Helvetica-ISOLatin1 exch definefont pop
/Helvetica-ISOLatin1 findfont 14 scalefont setfont
123 2.94 moveto
123 4.58 moveto
(A\\B\)ç\(D) stringwidth pop -2 div 0 rmoveto
(A\\B\)ç\(D) show
+5 -5
View File
@@ -1,15 +1,15 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 128 117
%%BoundingBox: 0 0 128 118
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
0.99 0.59 0.19 setrgbcolor
116.28 0 0 128 R
117.92 0 0 128 R
0.08 0.48 0.82 setrgbcolor
100 16.28 I 0 2 R
100 17.92 I 0 2 R
I 6 2 R
I 10 4 R
I 16 4 R
@@ -35,6 +35,6 @@ I 114 4 R
I 120 4 R
126 2 R
/Helvetica findfont 14 scalefont setfont
64 2.94 moveto
64 4.58 moveto
(*123*) stringwidth pop -2 div 0 rmoveto
(*123*) show
@@ -1,15 +1,15 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 128 117
%%BoundingBox: 0 0 128 118
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
0 0.4 0.81 0.01 setcmykcolor
116.28 0 0 128 R
117.92 0 0 128 R
0.9 0.41 0 0.18 setcmykcolor
100 16.28 I 0 2 R
100 17.92 I 0 2 R
I 6 2 R
I 10 4 R
I 16 4 R
@@ -35,6 +35,6 @@ I 114 4 R
I 120 4 R
126 2 R
/Helvetica findfont 14 scalefont setfont
64 2.94 moveto
64 4.58 moveto
(*123*) stringwidth pop -2 div 0 rmoveto
(*123*) show
+4 -4
View File
@@ -1,13 +1,13 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 128 117
%%BoundingBox: 0 0 128 118
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
0.9 0.4 0 0.09 setcmykcolor
100 16.28 I 0 2 R
100 17.92 I 0 2 R
I 6 2 R
I 10 4 R
I 16 4 R
@@ -33,6 +33,6 @@ I 114 4 R
I 120 4 R
126 2 R
/Helvetica findfont 14 scalefont setfont
64 2.94 moveto
64 4.58 moveto
(*123*) stringwidth pop -2 div 0 rmoveto
(*123*) show
+5 -5
View File
@@ -1,15 +1,15 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 128 113
%%BoundingBox: 0 0 128 114
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
112.2 0 0 128 R
113.37 0 0 128 R
0 0 0 setrgbcolor
100 12.2 I 0 2 R
100 13.37 I 0 2 R
I 6 2 R
I 10 4 R
I 16 4 R
@@ -35,6 +35,6 @@ I 114 4 R
I 120 4 R
126 2 R
/Helvetica findfont 10 scalefont setfont
64 2.1 moveto
64 3.27 moveto
(*123*) stringwidth pop -2 div 0 rmoveto
(*123*) show
@@ -1,15 +1,15 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.12.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 158 117
%%BoundingBox: 0 0 158 118
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
116.28 0 0 158 R
117.92 0 0 158 R
0 0 0 setrgbcolor
100 16.28 I 2 2 R
100 17.92 I 2 2 R
I 10 4 R
I 18 4 R
I 28 4 R
@@ -33,6 +33,6 @@ I 132 4 R
I 140 4 R
146 2 R
/Helvetica-Bold findfont 14 scalefont setfont
79 2.94 moveto
79 4.58 moveto
(\(01\)15012345678907) stringwidth pop -2 div 0 rmoveto
(\(01\)15012345678907) show
@@ -0,0 +1,83 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 100 212
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
211.88 0 0 100 R
0 0 0 setrgbcolor
66 145.88 I 2 2 R
I 14 2 R
I 18 2 R
I 30 2 R
I 34 2 R
I 42 16 R
I 62 2 R
I 66 8 R
I 76 4 R
I 82 2 R
I 86 6 R
96 2 R
2 143.88 I 8 6 R
I 16 2 R
I 20 10 R
I 32 2 R
I 36 2 R
40 2 R
6 139.88 58 2 R
2 143.88 64 2 R
6 139.88 74 2 R
2 143.88 I 80 2 R
84 2 R
2 141.88 I 10 2 R
I 14 2 R
18 2 R
4 139.88 22 2 R
2 141.88 I 26 2 R
I 30 2 R
I 34 2 R
I 38 2 R
I 42 2 R
46 2 R
4 139.88 I 50 2 R
54 2 R
2 141.88 I 62 2 R
I 66 2 R
I 70 2 R
I 78 2 R
I 82 2 R
I 86 2 R
90 2 R
2 139.88 I 8 4 R
I 16 2 R
I 28 6 R
I 36 2 R
I 64 4 R
I 80 2 R
88 4 R
66 73.88 I 0 2 R
I 4 2 R
I 12 4 R
I 18 4 R
I 24 4 R
I 34 2 R
I 38 12 R
I 60 4 R
I 68 6 R
I 76 4 R
I 82 6 R
I 92 4 R
98 2 R
/Helvetica findfont 21 scalefont setfont
50 54.86 moveto
(\(01\)09501) stringwidth pop -2 div 0 rmoveto
(\(01\)09501) show
50 30.86 moveto
(10153000) stringwidth pop -2 div 0 rmoveto
(10153000) show
50 6.86 moveto
(3) stringwidth pop -2 div 0 rmoveto
(3) show
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 B

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 B

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 B

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 B

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.
Binary file not shown.
@@ -0,0 +1,23 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 38 118
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
117.92 0 0 38 R
0 0 0 setrgbcolor
100 17.92 I 0 2 R
I 4 2 R
I 8 2 R
I 12 2 R
I 16 2 R
I 22 2 R
I 28 2 R
32 6 R
/Helvetica findfont 14 scalefont setfont
19 4.58 moveto
(12) stringwidth pop -2 div 0 rmoveto
(12) show
+5 -5
View File
@@ -1,15 +1,15 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.13.0.9
%%Creator: Zint 2.16.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 136 117
%%BoundingBox: 0 0 136 118
%%EndComments
/R { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/I { 2 copy } bind def
1 1 1 setrgbcolor
116.28 0 0 136 R
117.92 0 0 136 R
0 0 0 setrgbcolor
100 16.28 I 0 4 R
100 17.92 I 0 4 R
I 6 2 R
I 12 2 R
I 22 2 R
@@ -29,6 +29,6 @@ I 120 6 R
I 128 2 R
132 4 R
/Helvetica findfont 14 scalefont setfont
68 2.94 moveto
68 4.58 moveto
(AIM) stringwidth pop -2 div 0 rmoveto
(AIM) show
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 B

After

Width:  |  Height:  |  Size: 158 B

@@ -0,0 +1,12 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="38" height="118" version="1.1" xmlns="http://www.w3.org/2000/svg">
<desc>Zint Generated Symbol</desc>
<g id="barcode" fill="#000000">
<rect x="0" y="0" width="38" height="118" fill="#FFFFFF"/>
<path d="M0 0h2v100h-2ZM4 0h2v100h-2ZM8 0h2v100h-2ZM12 0h2v100h-2ZM16 0h2v100h-2ZM22 0h2v100h-2ZM28 0h2v100h-2ZM32 0h6v100h-6Z"/>
<text x="19" y="113.34" text-anchor="middle" font-family="Arimo, Arial, sans-serif" font-size="14">
12
</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 609 B

+2 -2
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="136" height="117" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg width="136" height="118" version="1.1" xmlns="http://www.w3.org/2000/svg">
<desc>Zint Generated Symbol</desc>
<g id="barcode" fill="#000000">
<rect x="0" y="0" width="136" height="117" fill="#FFFFFF"/>
<rect x="0" y="0" width="136" height="118" fill="#FFFFFF"/>
<path d="M0 0h4v100h-4ZM6 0h2v100h-2ZM12 0h2v100h-2ZM22 0h2v100h-2ZM26 0h2v100h-2ZM34 0h4v100h-4ZM44 0h4v100h-4ZM54 0h2v100h-2ZM62 0h2v100h-2ZM66 0h2v100h-2ZM70 0h6v100h-6ZM78 0h4v100h-4ZM88 0h2v100h-2ZM92 0h6v100h-6ZM100 0h4v100h-4ZM110 0h4v100h-4ZM120 0h6v100h-6ZM128 0h2v100h-2ZM132 0h4v100h-4Z"/>
<text x="68" y="113.34" text-anchor="middle" font-family="Arimo, Arial, sans-serif" font-size="14">
AIM

Before

Width:  |  Height:  |  Size: 783 B

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
AA 92 E
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="46" height="57" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg width="46" height="58" version="1.1" xmlns="http://www.w3.org/2000/svg">
<desc>Zint Generated Symbol</desc>
<g id="barcode" fill="#001FCC">
<path d="M0 0h2v40h-2ZM4 0h2v40h-2ZM8 0h2v40h-2ZM12 0h2v40h-2ZM16 0h2v40h-2ZM22 0h2v40h-2ZM26 0h6v40h-6ZM38 0h2v40h-2ZM42 0h4v40h-4Z"/>

Before

Width:  |  Height:  |  Size: 553 B

After

Width:  |  Height:  |  Size: 553 B

+2 -2
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="180" height="117" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg width="180" height="118" version="1.1" xmlns="http://www.w3.org/2000/svg">
<desc>Zint Generated Symbol</desc>
<g id="barcode" fill="#000000">
<rect x="0" y="0" width="180" height="117" fill="#FFFFFF"/>
<rect x="0" y="0" width="180" height="118" fill="#FFFFFF"/>
<path d="M0 0h4v100h-4ZM6 0h2v100h-2ZM12 0h2v100h-2ZM22 0h6v100h-6ZM32 0h4v100h-4ZM38 0h2v100h-2ZM44 0h4v100h-4ZM50 0h4v100h-4ZM56 0h4v100h-4ZM66 0h4v100h-4ZM74 0h4v100h-4ZM82 0h4v100h-4ZM88 0h2v100h-2ZM94 0h4v100h-4ZM102 0h2v100h-2ZM110 0h2v100h-2ZM116 0h4v100h-4ZM126 0h2v100h-2ZM132 0h4v100h-4ZM138 0h6v100h-6ZM146 0h2v100h-2ZM154 0h4v100h-4ZM164 0h6v100h-6ZM172 0h2v100h-2ZM176 0h4v100h-4Z"/>
<text x="90" y="113.34" text-anchor="middle" font-family="Arimo, Arial, sans-serif" font-size="14">
&lt;&gt;&quot;&amp;&apos;

Before

Width:  |  Height:  |  Size: 901 B

After

Width:  |  Height:  |  Size: 901 B

@@ -1,9 +1,9 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="224" height="117" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg width="224" height="118" version="1.1" xmlns="http://www.w3.org/2000/svg">
<desc>Zint Generated Symbol</desc>
<g id="barcode" fill="#000000">
<rect x="0" y="0" width="224" height="117" fill="#FFFFFF"/>
<rect x="0" y="0" width="224" height="118" fill="#FFFFFF"/>
<path d="M0 0h4v100h-4ZM6 0h2v100h-2ZM12 0h2v100h-2ZM22 0h2v100h-2ZM26 0h8v100h-8ZM36 0h6v100h-6ZM44 0h4v100h-4ZM54 0h2v100h-2ZM62 0h2v100h-2ZM66 0h2v100h-2ZM72 0h4v100h-4ZM78 0h2v100h-2ZM88 0h2v100h-2ZM98 0h4v100h-4ZM106 0h2v100h-2ZM110 0h2v100h-2ZM114 0h2v100h-2ZM120 0h8v100h-8ZM132 0h2v100h-2ZM138 0h2v100h-2ZM142 0h8v100h-8ZM154 0h4v100h-4ZM160 0h4v100h-4ZM166 0h8v100h-8ZM176 0h2v100h-2ZM184 0h4v100h-4ZM194 0h2v100h-2ZM198 0h4v100h-4ZM208 0h6v100h-6ZM216 0h2v100h-2ZM220 0h4v100h-4Z"/>
<text x="112" y="113.34" text-anchor="middle" font-family="Arimo, Arial, sans-serif" font-size="14" font-weight="bold">
Égjpqy

Before

Width:  |  Height:  |  Size: 999 B

After

Width:  |  Height:  |  Size: 999 B

@@ -1,9 +1,9 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="236" height="129" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg width="236" height="130" version="1.1" xmlns="http://www.w3.org/2000/svg">
<desc>Zint Generated Symbol</desc>
<g id="barcode" fill="#000000">
<rect x="0" y="0" width="236" height="129" fill="#FFFFFF"/>
<rect x="0" y="0" width="236" height="130" fill="#FFFFFF"/>
<path d="M6 6h4v100h-4ZM12 6h2v100h-2ZM18 6h2v100h-2ZM28 6h2v100h-2ZM32 6h8v100h-8ZM42 6h6v100h-6ZM50 6h4v100h-4ZM60 6h2v100h-2ZM68 6h2v100h-2ZM72 6h2v100h-2ZM78 6h4v100h-4ZM84 6h2v100h-2ZM94 6h2v100h-2ZM104 6h4v100h-4ZM112 6h2v100h-2ZM116 6h2v100h-2ZM120 6h2v100h-2ZM126 6h8v100h-8ZM138 6h2v100h-2ZM144 6h2v100h-2ZM148 6h8v100h-8ZM160 6h4v100h-4ZM166 6h4v100h-4ZM172 6h8v100h-8ZM182 6h2v100h-2ZM190 6h4v100h-4ZM200 6h2v100h-2ZM204 6h4v100h-4ZM214 6h6v100h-6ZM222 6h2v100h-2ZM226 6h4v100h-4ZM0 0h236v6h-236ZM0 106h236v6h-236ZM0 6h6v100h-6ZM230 6h6v100h-6Z"/>
<text x="118" y="125.34" text-anchor="middle" font-family="Arimo, Arial, sans-serif" font-size="14" font-weight="bold">
Égjpqy

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

@@ -1,9 +1,9 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="240" height="133" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg width="240" height="134" version="1.1" xmlns="http://www.w3.org/2000/svg">
<desc>Zint Generated Symbol</desc>
<g id="barcode" fill="#000000">
<rect x="0" y="0" width="240" height="133" fill="#FFFFFF"/>
<rect x="0" y="0" width="240" height="134" fill="#FFFFFF"/>
<path d="M8 8h4v100h-4ZM14 8h2v100h-2ZM20 8h2v100h-2ZM30 8h2v100h-2ZM34 8h8v100h-8ZM44 8h6v100h-6ZM52 8h4v100h-4ZM62 8h2v100h-2ZM70 8h2v100h-2ZM74 8h2v100h-2ZM80 8h4v100h-4ZM86 8h2v100h-2ZM96 8h2v100h-2ZM106 8h4v100h-4ZM114 8h2v100h-2ZM118 8h2v100h-2ZM122 8h2v100h-2ZM128 8h8v100h-8ZM140 8h2v100h-2ZM146 8h2v100h-2ZM150 8h8v100h-8ZM162 8h4v100h-4ZM168 8h4v100h-4ZM174 8h8v100h-8ZM184 8h2v100h-2ZM192 8h4v100h-4ZM202 8h2v100h-2ZM206 8h4v100h-4ZM216 8h6v100h-6ZM224 8h2v100h-2ZM228 8h4v100h-4ZM0 4h240v4h-240ZM0 108h240v4h-240ZM0 8h4v100h-4ZM236 8h4v100h-4Z"/>
<text x="120" y="125.34" text-anchor="middle" font-family="Arimo, Arial, sans-serif" font-size="14" font-weight="bold">
Égjpqy

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More