1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-09 21:15:57 +00:00

zint.h: increase symbol->text size 160 -> 200;

rename `ZINT_CAP_EXTENDABLE` -> `ZINT_CAP_EANUPC`
  (`ZINT_CAP_EXTENDABLE` marked as legacy)
CODE128: increase no. symbol chars max 60 -> 99
EAN-2/EAN-5: fix `BARCODE_BIND_TOP/BIND/BOX` output
GS1_128: warn if data > 48 (GS1 General Specifications max)
common: `is_extendable()` -> `is_ucpean()`
raster: add `ZFONT_HALIGN_CENTRE/LEFT/RIGHT` flags and process
  in `draw_string()` (for drawing EAN/UPC outside digits), and
  for `ZFONT_HALIGN_CENTRE` round when calculating centre
  (shifts some texts 1 pixel left)
raster/vector: use offsets into `symbol->text` for EAN/UPC
  instead of `out_upcean_split_text()` (removed)
BMP/EMF/GIF/PCX/PNG/PS/SVG/TIF: use new `out_colour_get_rgb()`
  routine (replaces `colour_to_XXX()`)
general: simplify/fix some `error_number` handling/returning
frontend: truncate overlong `--primary` instead of ignoring;
  negative floating pt option (for `--textgap`)
man page: list size detail for matrix symbols (`--vers`)
manual: further fiddling with scaling text; some typos
This commit is contained in:
gitlost
2023-11-19 19:39:54 +00:00
parent ca964f9098
commit 323b34502b
113 changed files with 2016 additions and 1550 deletions

View File

@@ -105,7 +105,7 @@ INTERNAL int png_pixel_plot(struct zint_symbol *symbol, const unsigned char *pix
png_color palette[32];
int num_palette;
unsigned char trans_alpha[32];
int num_trans;
int num_trans = 0;
int bit_depth;
int compression_strategy;
const unsigned char *pb;
@@ -117,22 +117,11 @@ INTERNAL int png_pixel_plot(struct zint_symbol *symbol, const unsigned char *pix
(void) out_colour_get_rgb(symbol->fgcolour, &fg.red, &fg.green, &fg.blue, &fg_alpha);
(void) out_colour_get_rgb(symbol->bgcolour, &bg.red, &bg.green, &bg.blue, &bg_alpha);
num_trans = 0;
if (symbol->symbology == BARCODE_ULTRA) {
static const int ultra_chars[8] = { 'W', 'C', 'B', 'M', 'R', 'Y', 'G', 'K' };
static const png_color ultra_colours[8] = {
{ 0xff, 0xff, 0xff, }, /* White */
{ 0, 0xff, 0xff, }, /* Cyan */
{ 0, 0, 0xff, }, /* Blue */
{ 0xff, 0, 0xff, }, /* Magenta */
{ 0xff, 0, 0, }, /* Red */
{ 0xff, 0xff, 0, }, /* Yellow */
{ 0, 0xff, 0, }, /* Green */
{ 0, 0, 0, }, /* Black */
};
static const unsigned char ultra_chars[8] = { 'W', 'C', 'B', 'M', 'R', 'Y', 'G', 'K' };
for (i = 0; i < 8; i++) {
map[ultra_chars[i]] = i;
palette[i] = ultra_colours[i];
out_colour_char_to_rgb(ultra_chars[i], &palette[i].red, &palette[i].green, &palette[i].blue);
if (fg_alpha != 0xff) {
trans_alpha[i] = fg_alpha;
}
@@ -170,10 +159,11 @@ INTERNAL int png_pixel_plot(struct zint_symbol *symbol, const unsigned char *pix
palette[num_palette++] = bg;
} else {
/* Alpha and no foreground alpha - add to front & move white to end */
png_color white = palette[0]; /* Take copy */
map['0'] = 0;
palette[0] = bg;
map['W'] = num_palette;
palette[num_palette++] = ultra_colours[0];
palette[num_palette++] = white;
}
if (bg_alpha != 0xff) {
trans_alpha[num_trans++] = bg_alpha;