Skip to content

Commit 0c5551d

Browse files
committed
Extend primary symbol's main bars to the separator
1 parent 75ee2cf commit 0c5551d

File tree

5 files changed

+42
-4
lines changed

5 files changed

+42
-4
lines changed

src/ean13composite.ps.src

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,19 @@ begin
148148
bhsrow b bbsrow b get bhs b get 72 mul add put
149149
} for
150150

151+
% Main symbol bars extend to full height connecting to separator; add-on bars keep their height
152+
/linheight 0 bhsrow { ceiling cvi 2 copy lt { exch } if pop } forall def
153+
/mainbars nbars def
154+
0 1 sbs length 1 sub {
155+
dup sbs exch get type /realtype eq { 1 add 2 idiv /mainbars exch def exit } { pop } ifelse
156+
} for
157+
0 1 mainbars 1 sub { bhsrow exch linheight put } for
158+
151159
% Rasterize linear rows, deduplicating identical adjacent rows using a string buffer
152160
/rowbuf pixx string def
153161
/prevrow () def /linrowmult 72 array def /lri 0 def
154162
/linpixs [
155-
71 -1 0 {
163+
linheight 1 sub -1 0 {
156164
/y exch def
157165
/p 0 def
158166
linpad { rowbuf p 3 -1 roll put /p p 1 add def } forall

src/ean8composite.ps.src

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,19 @@ begin
158158
bhsrow b bbsrow b get bhs b get 72 mul add put
159159
} for
160160

161+
% Main symbol bars extend to full height connecting to separator; add-on bars keep their height
162+
/linheight 0 bhsrow { ceiling cvi 2 copy lt { exch } if pop } forall def
163+
/mainbars nbars def
164+
0 1 sbs length 1 sub {
165+
dup sbs exch get type /realtype eq { 1 add 2 idiv /mainbars exch def exit } { pop } ifelse
166+
} for
167+
0 1 mainbars 1 sub { bhsrow exch linheight put } for
168+
161169
% Rasterize linear rows, deduplicating identical adjacent rows using a string buffer
162170
/rowbuf pixx string def
163171
/prevrow () def /linrowmult 72 array def /lri 0 def
164172
/linpixs [
165-
71 -1 0 {
173+
linheight 1 sub -1 0 {
166174
/y exch def
167175
/p 0 def
168176
linpad { rowbuf p 3 -1 roll put /p p 1 add def } forall

src/upcacomposite.ps.src

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,19 @@ begin
148148
bhsrow b bbsrow b get bhs b get 72 mul add put
149149
} for
150150

151+
% Main symbol bars extend to full height connecting to separator; add-on bars keep their height
152+
/linheight 0 bhsrow { ceiling cvi 2 copy lt { exch } if pop } forall def
153+
/mainbars nbars def
154+
0 1 sbs length 1 sub {
155+
dup sbs exch get type /realtype eq { 1 add 2 idiv /mainbars exch def exit } { pop } ifelse
156+
} for
157+
0 1 mainbars 1 sub { bhsrow exch linheight put } for
158+
151159
% Rasterize linear rows, deduplicating identical adjacent rows using a string buffer
152160
/rowbuf pixx string def
153161
/prevrow () def /linrowmult 72 array def /lri 0 def
154162
/linpixs [
155-
71 -1 0 {
163+
linheight 1 sub -1 0 {
156164
/y exch def
157165
/p 0 def
158166
linpad { rowbuf p 3 -1 roll put /p p 1 add def } forall

src/upcecomposite.ps.src

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,19 @@ begin
155155
bhsrow b bbsrow b get bhs b get 72 mul add put
156156
} for
157157

158+
% Main symbol bars extend to full height connecting to separator; add-on bars keep their height
159+
/linheight 0 bhsrow { ceiling cvi 2 copy lt { exch } if pop } forall def
160+
/mainbars nbars def
161+
0 1 sbs length 1 sub {
162+
dup sbs exch get type /realtype eq { 1 add 2 idiv /mainbars exch def exit } { pop } ifelse
163+
} for
164+
0 1 mainbars 1 sub { bhsrow exch linheight put } for
165+
158166
% Rasterize linear rows, deduplicating identical adjacent rows using a string buffer
159167
/rowbuf pixx string def
160168
/prevrow () def /linrowmult 72 array def /lri 0 def
161169
/linpixs [
162-
71 -1 0 {
170+
linheight 1 sub -1 0 {
163171
/y exch def
164172
/p 0 def
165173
linpad { rowbuf p 3 -1 roll put /p p 1 add def } forall

tests/ps_tests/ean13composite.ps.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,5 +197,11 @@
197197
0 0 0 1 0 1 0 1 1 1 1 0 1 0 0 1 0 0 0 1 0 1 1 0 0 1 1 0 0 1 0 0 1 1 0 1 0 0 0 0 1 0 1 0 0 0 1 1 0 1 0 1 0 1 0 0 1 1 1 0 1 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 0 1 0 0 1 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 1
198198
] eq_tmpl
199199

200+
% height option affects only linear bars, not the CC component
201+
{
202+
(331234567890|(99)1234-abcd) (dontdraw ccversion=a height=0.5) ean13composite
203+
dup /height get exch /pixy get 72 div sub abs 0.001 lt % height = pixy/72 (natural, not user's 0.5)
204+
} true isEqual
205+
200206
% Missing composite component (no pipe character)
201207
{ (331234567890) (dontdraw) ean13composite } /bwipp.missingCompositeComponent isError

0 commit comments

Comments
 (0)