Skip to content

Commit

Permalink
BWIPP 2024-06-18 : fix for #335 qrcode suppresskanjimode
Browse files Browse the repository at this point in the history
  • Loading branch information
metafloor committed Jun 18, 2024
1 parent 47fddef commit 4edacfa
Show file tree
Hide file tree
Showing 31 changed files with 149,161 additions and 146,176 deletions.
8 changes: 7 additions & 1 deletion barcode-ftr.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ function bwipp_encode(bwipjs, encoder, text, opts, dontdraw) {
}
var eq = tmp[i].indexOf('=');
if (eq == -1) {
opts[tmp[i]] = true;
if (tmp[i][0] == '!') {
// boolean !name
opts[tmp[i].substr(1)] = false;
} else {
// boolean name
opts[tmp[i]] = true;
}
} else {
opts[tmp[i].substr(0, eq)] = tmp[i].substr(eq+1);
}
Expand Down
Binary file modified barcode.ps
Binary file not shown.
2 changes: 2 additions & 0 deletions bin/bwip-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ var optlist = [
'You must specify --showborder for this setting to take effect.' },
{ name: 'textcolor', type: 'string',
desc: 'Color of the text, either as a hex RGB or RRGGBB value or a hex CCMMYYKK value.' },
/*
{ name: 'addontextfont', type: 'string',
desc: 'The font name to use for the add-on text in ISBN, ISMN, and ISSN barcodes.' },
{ name: 'addontextsize', type: 'int',
Expand All @@ -199,6 +200,7 @@ var optlist = [
desc: 'Overrides the default positioning for the add on text.' },
{ name: 'addontextyoffset', type: 'int',
desc: 'Overrides the default positioning for the add on text.' },
*/
{ name: 'guardwhitespace', type: 'boolean',
desc: 'Display white space guards.' },
{ name: 'guardwidth', type: 'int',
Expand Down
8 changes: 7 additions & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@
}
var eq = aopts[i].indexOf('=');
if (eq == -1) {
opts[aopts[i]] = true;
// !name => false
// name => true
if (aopts[i][0] == '!') {
opts[aopts[i].substr(1)] = false;
} else {
opts[aopts[i]] = true;
}
} else {
opts[aopts[i].substr(0, eq)] = aopts[i].substr(eq+1);
}
Expand Down
17 changes: 12 additions & 5 deletions dist/bwip-js-gen.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Copyright (c) 2011-2024 Mark Warren
//
// This file contains code automatically generated from:
// Barcode Writer in Pure PostScript - Version 2024-01-03
// Barcode Writer in Pure PostScript - Version 2024-06-18
// Copyright (c) 2004-2024 Terry Burton
//
// The MIT License
Expand Down Expand Up @@ -98,14 +98,21 @@ function FixupOptions(opts) {

return opts;

// a is the most specific padding value, e.g. paddingleft
// b is the next most specific value, e.g. paddingwidth
// c is the general padding value.
// s is the scale, either scalex or scaley
function padding(a, b, c, s) {
if (a != null) {
return a*s;
a = a >>> 0;
return a*s >>> 0;
}
if (b != null) {
return b*s;
b = b >>> 0;
return b*s >>> 0;
}
return c*s || 0;
c = c >>> 0;
return (c*s >>> 0) || 0;
}
}

Expand Down Expand Up @@ -207,7 +214,7 @@ function ToRaw(bcid, text, options) {
}

// The drawing interface is just needed for the pre-init() calls.
// Don't need to fixup the options - drawing specific.
// Don't need to fixup the drawing specific options.
var drawing = DrawingBuiltin();
drawing.setopts(options);

Expand Down
6 changes: 3 additions & 3 deletions dist/bwip-js-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4edacfa

Please sign in to comment.