Output formatting issue in a2ps
Jonathan Seidel <[email protected]> Tue, 12 Jan 2016 16:15:49 +0000
| Newsgroups | gmane.comp.printing.a2ps.bugs |
|---|---|
| Message-ID | <D2BA66BD.2C264%[email protected]> |
--_000_D2BA66BD2C264jonathanseidelmacyscom_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi... Just started using a2ps (nice) and have a problem:
The output font switches between a fixed-width font to a proportional font =
every time there is a single quote in the output.
For example:
If cmp_target =3D~ {cmp_expected}/
cmp_result =3D 'Passed'
else
cmp_result =3D 'Failed'
End
(If email hoses the display, then the words "Passed" and "Failed" above are=
fixed-width while the rest is proportional font.)
This happens even if the single-quote is contained in a quoted string or in=
a regular expression string, such as:
cmp_expected =3D expected_value.gsub(/["',@#%&=3D_\s]/, '')
Printing to an HP color printer with default options; installed through Hom=
ebrew on Mac OS X 10.11.2
Configuration status of a2ps 4.14
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Sheets:
-------
medium =3D A4, landscape
page layout =3D 2 x 1, rows first
borders =3D yes
file alignment =3D page
interior margin =3D 0
Virtual pages:
--------------
number lines =3D no
format =3D 80 characters per line
tabulation size =3D 8
non printable format =3D caret (i.e., `^C', `M-^C' etc.)
Headers:
--------
header =3D %a
left footer =3D #?l!%E!#?v|%E|%s./%s#|!
footer =3D #?l|#!s-$f-, -||
right footer =3D #?l!%s./%s#!#?v|%s./%s#|%E|!
left title =3D #?2||$e $T|
center title =3D #?1|$t1|$n|
right title =3D #?2|$t2|$Q|
under lay =3D
Input:
------
truncate lines =3D no
interpret =3D yes
end of line =3D any type
encoding =3D ISO-8859-1
document title =3D #10!f|$n|, |
prologue =3D bw
print anyway =3D no
delegating =3D yes
Pretty-printing:
----------------
style sheet =3D selected automatically
highlight level =3D normal
strip level =3D 0
Output:
-------
destination =3D sent to the default printer
version control =3D numbered backups of files already numbered,
and simple of others
backup suffix =3D ~
PostScript:
-----------
magic number =3D %!PS-Adobe-3.0
Printer Description (PPD) =3D selected automatically
default PPD =3D level1
page label format =3D #{pl.short}
number of copies =3D 1
sides per sheet =3D Simplex
page device definitions =3D
statusdict definitions =3D
page prefeed =3D no
Internals:
----------
verbosity level =3D 2
file command =3D /usr/bin/file
library path =3D
/Users/yc98js1/.a2ps
/usr/local/Cellar/a2ps/4.14/share/a2ps/sheets
/usr/local/Cellar/a2ps/4.14/share/a2ps/ps
/usr/local/Cellar/a2ps/4.14/share/a2ps/encoding
/usr/local/Cellar/a2ps/4.14/share/a2ps/afm
/usr/local/Cellar/a2ps/4.14/share/ogonkify/afm
/usr/local/Cellar/a2ps/4.14/share/a2ps/ppd
/usr/local/Cellar/a2ps/4.14/share/a2ps/fonts
/usr/local/Cellar/a2ps/4.14/share/ogonkify/fonts
/usr/local/Cellar/a2ps/4.14/share/a2ps
--_000_D2BA66BD2C264jonathanseidelmacyscom_
Content-Type: text/html; charset="iso-8859-1"
Content-ID: <[email protected]>
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
</head>
<body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-lin=
e-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px;">
<div style=3D"font-family: Calibri, sans-serif;">Hi… Just started usi=
ng a2ps (nice) and have a problem:</div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
<div style=3D"font-family: Calibri, sans-serif;">The output font switches b=
etween a fixed-width font to a proportional font every time there is a sing=
le quote in the output.</div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
<div style=3D"font-family: Calibri, sans-serif;">For example:</div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
<div style=3D"font-family: Calibri, sans-serif;">If cmp_target =3D~ {cmp_ex=
pected}/</div>
<div><font face=3D"Calibri,sans-serif"> cmp_result =3D ‘</font>=
<font face=3D"Andale Mono">Passed</font><font face=3D"Calibri,sans-serif">&=
#8217;</font></div>
<div style=3D"font-family: Calibri, sans-serif;">else</div>
<div><span style=3D"font-family: Calibri, sans-serif;"> cmp_result =
=3D ‘</span><font face=3D"Andale Mono">Failed</font><font face=3D"Cal=
ibri,sans-serif">’</font></div>
<div style=3D"font-family: Calibri, sans-serif;">End</div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
<div style=3D"font-family: Calibri, sans-serif;">(If email hoses the displa=
y, then the words “Passed” and “Failed” above are f=
ixed-width while the rest is proportional font.)</div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
<div style=3D"font-family: Calibri, sans-serif;">This happens even if the s=
ingle-quote is contained in a quoted string or in a regular expression stri=
ng, such as:</div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
<div style=3D"font-family: Calibri, sans-serif;">cmp_expected =3D expected_=
value.gsub(/["',@#%&=3D_\s]/, ‘')</div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
<div style=3D"font-family: Calibri, sans-serif;">Printing to an HP color pr=
inter with default options; installed through Homebrew on Mac OS X 10.11.2<=
/div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
<div style=3D"font-family: Calibri, sans-serif;">
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
 =
; Configuration status of a2ps 4.14</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0); min-height: 16px;">
<br>
</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
Sheets:</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
-------</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
medium =3D A4, landscape</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
page layout =3D 2 x 1, rows first</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
borders =3D yes</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
file alignment =3D page</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
interior margin =3D 0</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0); min-height: 16px;">
<br>
</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
Virtual pages:</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
--------------</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
number lines =3D no</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
format =3D 80 chara=
cters per line</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
tabulation size =3D 8</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
non printable format =3D caret (i.e., `^C', `M-^C' etc.)</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0); min-height: 16px;">
<br>
</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
Headers:</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
--------</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
header =3D %a</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
left footer =3D #?l!%E!#?v|%E|%s./%s#|!</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
footer =3D #?l|#!s-$f-, -||</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
right footer =3D #?l!%s./%s#!#?v|%s./%s#|%E|!</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
left title =3D #?2||$e $T|</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
center title =3D #?1|$t1|$n|</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
right title =3D #?2|$t2|$Q|</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
under lay =3D </p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0); min-height: 16px;">
<br>
</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
Input:</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
------</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
truncate lines =3D no</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
interpret =3D yes</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
end of line =3D any type</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
encoding =3D ISO-8859-1</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
document title =3D #10!f|$n|, |</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
prologue =3D bw</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
print anyway =3D no</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
delegating =3D yes</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0); min-height: 16px;">
<br>
</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
Pretty-printing:</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
----------------</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
style sheet =3D selected automatically</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
highlight level =3D normal</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
strip level =3D 0</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0); min-height: 16px;">
<br>
</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
Output:</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
-------</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
destination =3D sent to the default printer</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
version control =3D numbered backups of files already numbered,</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
 =
; and simple of others</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
backup suffix =3D ~</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0); min-height: 16px;">
<br>
</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
PostScript:</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
-----------</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
magic number =3D %!P=
S-Adobe-3.0</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
Printer Description (PPD) =3D selected automatically</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
default PPD =3D lev=
el1</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
page label format =3D #{pl.short}</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
number of copies =3D 1</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
sides per sheet =3D Simplex</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
page device definitions =3D </p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
statusdict definitions =3D </p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
page prefeed =3D no<=
/p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0); min-height: 16px;">
<br>
</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
Internals:</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
----------</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
verbosity level =3D 2</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
file command =3D /usr/bin/file</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
library path =3D </p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/Users/yc98=
js1/.a2ps</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/usr/local/=
Cellar/a2ps/4.14/share/a2ps/sheets</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/usr/local/=
Cellar/a2ps/4.14/share/a2ps/ps</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/usr/local/=
Cellar/a2ps/4.14/share/a2ps/encoding</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/usr/local/=
Cellar/a2ps/4.14/share/a2ps/afm</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/usr/local/=
Cellar/a2ps/4.14/share/ogonkify/afm</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/usr/local/=
Cellar/a2ps/4.14/share/a2ps/ppd</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/usr/local/=
Cellar/a2ps/4.14/share/a2ps/fonts</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/usr/local/=
Cellar/a2ps/4.14/share/ogonkify/fonts</p>
<p style=3D"margin: 0px; line-height: normal; font-family: Consolas; color:=
rgb(41, 249, 20); background-color: rgb(0, 0, 0);">
<span class=3D"Apple-tab-span" style=3D"white-space:pre"></span>/usr/local/=
Cellar/a2ps/4.14/share/a2ps</p>
</div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
<div style=3D"font-family: Calibri, sans-serif;"><br>
</div>
</body>
</html>
--_000_D2BA66BD2C264jonathanseidelmacyscom_--