Dear Werner,
On Fri, 3 Feb 2006, Werner LEMBERG wrote:
Please, take a look at the file, produced by fixgrofffonts.awk.
Is it a valid eps file?
From the point of DSC, your grdemo.ps file isn't.
. According to the DSC it is better to use %%DocumentNeededResources
and %%DocumentSuppliedResources than %%DocumentNeededFonts and
%%DocumentSuppliedFonts. Consequently, the %%DocumentFonts line
is no longer necessary.
. %%BeginResource: font ... %%EndResource blocks should be put into
the %%BeginSetup ... %%EndSetup section (which comes after the
%%BeginProlog ... %%EndProlog section).
OK
. The definition of /RE belongs into the %%BeginSetup ... %%EndSetup
section.
Or, maybe, to %%BeginProlog %%BeginResource: procset ... %%EndResource
%%EndProlog?
. A `%%BeginProlog' declaration is missing.
An old metapost version.
BTW. %%EndComments is also missing.
And Prolog seems to be abused.
Font name definitions are not to be there (AFAI understand your comments
and DSC 3 document from Adobe).
May be it is the result of DSC ver 1 conformance from prehistoric times.
Time to make a bug report to metapost people?
. You are missing the `%%IncludeResource: font XXX' lines (within
the %%BeginSetup ... %EndSetup section) for all fonts not embedded
in the document.
. A line `%%DocumentSuppliedResources: encoding groffEncoding' is
missing (using the new groff.enc version).
OK
Some comments on what you have said:
. The file `trchars.adj' is intentionally an empty file. It is
needed by `mpost' (the MetaPost binary).
Comment: my patch to dmp makes it unnecessary
I know that, but not everybody has this.
. For the moment, `groffmp.sh' expects input files in the current
directory. Note that its output is not intended as a standalone
file; it must be embedded into a groff document to give its PS
front end, `grops', a chance to include all needed resources.
Comment: fixgroffonts.awk makes a standalone file
Yes, this is an alternative. Probably both scripts should be provided
(or rather, unified, with a proper command line option).
Or name tfm files with full PS font names, thus avoiding mapping.
Hmm, I like the other solution more.
I see a difference in approaches.
You are after metapost for groff (metapost pictures in groff document),
while I am after groff for metapost (groff-made labels in metapost
output).
I want us to try to push groff support into the next metapost version.
I do not think that it is possible to make some "contrib" set
of files to make groff work with output of arbitrary TeX setup.
(PS font names as filenames was a step in that diction, since
it allowed to be orthogonal to psfonts.map and TeX font naming issues).
BTW. why your sed script downloads groffEncoding into the ps file?
Since the ps file is bound to end up as a part of groff document,
ENC0 may be used.
One more question:
why reencoding is done in 2 steps:
/Times-Roman-groff groffEncoding /Times-Roman RE
/groftr /Times-Roman-groff def
Sincerely, Michail
PS. New awk script attached.
!/^\%\%DocumentFonts\:/
/^\%\%DocumentFonts\:/ {
do {
for (i=2;i<=NF;i++)
Fonts[$(i)]=1
getline
line = $0
} while ( /^\%\%\+ / )
for (Font in Fonts)
if( Font=="ZapfDingbats-Reverse" ) {
ZDR=1
Fonts["ZapfDingbats"]=1
NeededFonts["ZapfDingbats"]=1
SuppliedFonts[Font]=1
}
else if( Font=="Symbol-Slanted" ) {
SS=1
Fonts["Symbol"]=1
NeededFonts["Symbol"]=1
SuppliedFonts[Font]=1
}
else if( Font=="FreeEuro" ) {
EURO=1
SuppliedFonts[Font]=1
}
else {
NeededFonts[Font]=1
}
if (DSCline != DSClineinit) print DSCline
DSClineinit = "%%DocumentNeededResources: font"
DSCline = DSClineinit
for (Font in NeededFonts)
if (length(DSCline) + length(Font) < 80)
DSCline = DSCline " " Font
else {
print DSCline
DSCline = "%%+ font " Font
}
if (DSCline != DSClineinit) print DSCline
print "%%DocumentSuppliedResources: encoding groffEncoding"
DSClineinit = "%%+ font"
DSCline = DSClineinit
for (Font in SuppliedFonts)
if (length(DSCline) + length(Font) < 80)
DSCline = DSCline " " Font
else {
print DSCline
DSCline = "%%+ font " Font
}
if (DSCline != DSClineinit) print DSCline
DSCline = ""
print "%%BeginSetup"
for (Font in NeededFonts)
print "%%IncludeResource: font " Font
"kpsepath troff_font" | getline DEVPS
if( SS ) {
print "%%BeginResource: font Symbol-Slanted"
PFA=DEVPS "/symbolsl.pfa"
while ( (getline < PFA) > 0 )
print
print "%%EndResource"
}
if( ZDR ){
print "%%BeginResource: font ZapfDingbats-Reverse"
PFA=DEVPS "/zapfdr.pfa"
while ( (getline < PFA) > 0 )
print
print "%%EndResource"
}
if( EURO ){
print "%%BeginResource: font FreeEuro"
PFA=DEVPS "/freeeuro.pfa"
while ( (getline < PFA) > 0 )
print
print "%%EndResource"
}
print "/RE{"
print "findfont"
print "dup maxlength 1 index/FontName known not{1 add}if dict begin"
print "{"
print "1 index/FID ne{def}{pop pop}ifelse"
print "}forall"
print "/Encoding exch def"
print "dup/FontName exch def"
print "currentdict end definefont pop"
print "}bind def"
"kpsewhich groff.enc" | getline GROFFENC
while ( (getline < GROFFENC) > 0 )
print
$0 = line
while ( !/^%%EndProlog$/ ) {
if ( /^ \/[^ ]*8g / ) {
print " " $2 "-groff groffEncoding " $2 " RE"
print " " $1 " " $2 "-groff def"
}
else
print
getline
}
print "%%EndSetup"
}
_______________________________________________
Groff mailing list
Groff@gnu.org
http://lists.gnu.org/mailman/listinfo/groff