Skip to content

Commit d0482df

Browse files
committed
databarlimitedcomposite: Uplift
1 parent 2be49e2 commit d0482df

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

src/databarlimitedcomposite.ps.src

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Barcode Writer in Pure PostScript
22
% https://bwipp.terryburton.co.uk
33
%
4-
% Copyright (c) 2004-2024 Terry Burton
4+
% Copyright (c) 2004-2025 Terry Burton
55
%
66
% $Id$
77
%
@@ -47,11 +47,16 @@ dup /gs1process dup /uk.co.terryburton.bwipp findresource put
4747
dup /renlinear dup /uk.co.terryburton.bwipp findresource put
4848
dup /renmatrix dup /uk.co.terryburton.bwipp findresource put
4949
begin
50+
51+
/databarlimitedcomposite.sepleft [ 0 0 0 ] readonly def
52+
/databarlimitedcomposite.sepright [ 0 0 0 0 0 0 0 0 0 ] readonly def
53+
5054
/databarlimitedcomposite {
5155

52-
20 dict begin % Confine variables to local scope
56+
20 dict begin
5357

5458
/ctx null def
59+
5560
/dontdraw false def
5661
/usematrix false def
5762
/parse false def
@@ -63,7 +68,9 @@ begin
6368

6469
dontdraw { /usematrix true def } if
6570

71+
%
6672
% Split the linear and composite parts
73+
%
6774
barcode (|) search {
6875
/linear exch def
6976
pop
@@ -80,30 +87,38 @@ begin
8087
options (dontdraw) true put
8188
options (dontlint) true put
8289

90+
%
8391
% Lint the combined AI element strings
92+
%
8493
linear length comp length add string
8594
dup 0 linear putinterval
8695
dup linear length comp putinterval
8796
/ai //gs1process exec pop pop pop
8897

98+
%
8999
% Plot the linear part
100+
%
90101
linear options //databarlimited exec
91102
dup (sbs) get /linsbs exch def
92103
dup (bhs) get 0 get 72 mul /linheight exch def
93104
usematrix not { //renlinear exec } { pop } ifelse
94105

106+
%
95107
% Plot the separator
108+
%
96109
mark
97110
1 linsbs {1 index 0 eq {{1}} {{0}} ifelse repeat} forall
98111
counttomark 1 sub array astore /sep exch def pop pop
99-
sep 0 [0 0 0] putinterval
100-
sep sep length 9 sub [0 0 0 0 0 0 0 0 0] putinterval % 4 + 5 right guard spaces
112+
sep 0 //databarlimitedcomposite.sepleft putinterval
113+
sep sep length 9 sub //databarlimitedcomposite.sepright putinterval % 4 + 5 right guard spaces
101114

102115
usematrix not {
103116

104117
currentpoint
105118

119+
%
106120
% Plot the 2D part
121+
%
107122
comp options //gs1-cc exec
108123
dup (pixx) get 72 exch sub linheight 1 add rmoveto
109124
//renmatrix exec

0 commit comments

Comments
 (0)