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 0d7d316 commit bc71874
Show file tree
Hide file tree
Showing 22 changed files with 148,427 additions and 145,832 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ or as SVG (all platforms).
## Status

* Current bwip-js version is 4.3.2 (2024-03-19)
* Current BWIPP version is 2024-01-03
* Current bwip-js version is 4.4.0 (2024-06-18)
* Current BWIPP version is 2024-06-18
* Node.js compatibility: 0.12+
* Browser compatibility: Edge, Firefox, Chrome

Expand Down Expand Up @@ -104,10 +104,10 @@ The bwip-js options are:
- `padding` : Shorthand for setting `paddingtop`, `paddingleft`, `paddingright`, and `paddingbottom`.
- `paddingwidth` : Shorthand for setting `paddingleft` and `paddingright`.
- `paddingheight` : Shorthand for setting `paddingtop` and `paddingbottom`.
- `paddingtop` : Sets the height of the padding area, in points, on the top of the barcode image. Rotates and scales with the image.
- `paddingleft` : Sets the width of the padding area, in points, on the left side of the barcode image. Rotates and scales with the image.
- `paddingright` : Sets the width of the padding area, in points, on the right side of the barcode image. Rotates and scales with the image.
- `paddingbottom` : Sets the height of the padding area, in points, on the bottom of the barcode image. Rotates and scales with the image.
- `paddingtop` : Sets the height of the padding area, in points, on the top of the barcode image. Must be an integer >= 0. Rotates and scales with the image.
- `paddingleft` : Sets the width of the padding area, in points, on the left side of the barcode image. Must be an integer >= 0. Rotates and scales with the image.
- `paddingright` : Sets the width of the padding area, in points, on the right side of the barcode image. Must be an integer >= 0. Rotates and scales with the image.
- `paddingbottom` : Sets the height of the padding area, in points, on the bottom of the barcode image. Must be an integer >= 0. Rotates and scales with the image.
- `backgroundcolor` : This is actually a BWIPP option but is better handled by the bwip-js drawing code. Expects either a hex RGB, RRGGBB or CCMMYYKK string value or CSS-style #RGB or #RRGGBB string value.

For the BWIPP specific options, you will need to consult the
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
2 changes: 1 addition & 1 deletion dist/bwip-js-gen.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for bwip-js 4.3.2 (2024-03-19)
// Type definitions for bwip-js 4.4.0 (2024-06-18)
//
// THIS DEFINITION FILE IS MACHINE GENERATED - DO NOT EDIT
//
Expand Down
19 changes: 13 additions & 6 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 @@ -33,7 +33,7 @@
import { bwipp_auspost,bwipp_azteccode,bwipp_azteccodecompact,bwipp_aztecrune,bwipp_bc412,bwipp_channelcode,bwipp_codablockf,bwipp_code11,bwipp_code128,bwipp_code16k,bwipp_code2of5,bwipp_code32,bwipp_code39,bwipp_code39ext,bwipp_code49,bwipp_code93,bwipp_code93ext,bwipp_codeone,bwipp_coop2of5,bwipp_daft,bwipp_databarexpanded,bwipp_databarexpandedcomposite,bwipp_databarexpandedstacked,bwipp_databarexpandedstackedcomposite,bwipp_databarlimited,bwipp_databarlimitedcomposite,bwipp_databaromni,bwipp_databaromnicomposite,bwipp_databarstacked,bwipp_databarstackedcomposite,bwipp_databarstackedomni,bwipp_databarstackedomnicomposite,bwipp_databartruncated,bwipp_databartruncatedcomposite,bwipp_datalogic2of5,bwipp_datamatrix,bwipp_datamatrixrectangular,bwipp_datamatrixrectangularextension,bwipp_dotcode,bwipp_ean13,bwipp_ean13composite,bwipp_ean14,bwipp_ean2,bwipp_ean5,bwipp_ean8,bwipp_ean8composite,bwipp_flattermarken,bwipp_gs1_128,bwipp_gs1_128composite,bwipp_gs1_cc,bwipp_gs1datamatrix,bwipp_gs1datamatrixrectangular,bwipp_gs1dldatamatrix,bwipp_gs1dlqrcode,bwipp_gs1dotcode,bwipp_gs1northamericancoupon,bwipp_gs1qrcode,bwipp_hanxin,bwipp_hibcazteccode,bwipp_hibccodablockf,bwipp_hibccode128,bwipp_hibccode39,bwipp_hibcdatamatrix,bwipp_hibcdatamatrixrectangular,bwipp_hibcmicropdf417,bwipp_hibcpdf417,bwipp_hibcqrcode,bwipp_iata2of5,bwipp_identcode,bwipp_industrial2of5,bwipp_interleaved2of5,bwipp_isbn,bwipp_ismn,bwipp_issn,bwipp_itf14,bwipp_jabcode,bwipp_japanpost,bwipp_kix,bwipp_leitcode,bwipp_mailmark,bwipp_mands,bwipp_matrix2of5,bwipp_maxicode,bwipp_micropdf417,bwipp_microqrcode,bwipp_msi,bwipp_onecode,bwipp_pdf417,bwipp_pdf417compact,bwipp_pharmacode,bwipp_pharmacode2,bwipp_planet,bwipp_plessey,bwipp_posicode,bwipp_postnet,bwipp_pzn,bwipp_qrcode,bwipp_rationalizedCodabar,bwipp_raw,bwipp_rectangularmicroqrcode,bwipp_royalmail,bwipp_sscc18,bwipp_swissqrcode,bwipp_symbol,bwipp_telepen,bwipp_telepennumeric,bwipp_ultracode,bwipp_upca,bwipp_upcacomposite,bwipp_upce,bwipp_upcecomposite,bwipp_lookup,bwipp_encode,BWIPP_VERSION } from './bwipp.mjs';

// exports.js
const BWIPJS_VERSION = '4.3.2 (2024-03-19)';
const BWIPJS_VERSION = '4.4.0 (2024-06-18)';


// bwipjs.toSVG(options)
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.

2 changes: 1 addition & 1 deletion dist/bwip-js-node.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for bwip-js 4.3.2 (2024-03-19)
// Type definitions for bwip-js 4.4.0 (2024-06-18)
//
// THIS DEFINITION FILE IS MACHINE GENERATED - DO NOT EDIT
//
Expand Down
Loading

0 comments on commit bc71874

Please sign in to comment.