groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Re: groff + mp


From: Werner LEMBERG
Subject: [Groff] Re: groff + mp
Date: Fri, 03 Feb 2006 07:44:54 +0100 (CET)

Dear Michail,


surprise, surprise!  I have now found some time to answer your
questions.

>   If we want to follow TeX conventions, then we'd better make tfm
>   files named following fontname guidelines and invent some new
>   encoding (I have called it 8g).

OK.  I've just sent a letter to Karl Berry so that `8g' gets
registered.

>   file, produced by fixmp (that requires gnu sed), has
> %%EndComments
> %%IncludeResource: font Symbol-Slanted
> %%IncludeResource: font ZapfDingbats-Reverse
> %%IncludeResource: font FreeEuro
> %%BeginProlog
>    Are IncludeResource lines placed properly?

No.  Thanks for the pointer.  According to the DSC, (file
5001.DSC_Spec.pdf, from Adobe), %%IncludeResource lines should be in
the %%BeginSetup ... %%EndSetup section.  Attached is a fixmp script
which corrects this problem, and which should work with BSD sed also
(I've checked it with sed's --posix option).

Please test.

>   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).

  . The definition of /RE belongs into the %%BeginSetup ... %%EndSetup
    section.

  . A `%%BeginProlog' declaration is missing.

  . 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).

I've also attached my new version of grdemo-doc.ps.

>   Do we need to embed 3 groff fonts, if the file is to be included
>   in a larger document (in general case, not just for groff)?

This depends on the program which handles the file.  For example,
grops knows where to find those three fonts, and dvips probably can do
this also (I haven't tested that).  If you want a stand-alone EPS they
should be included.

> 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).

>   . Similarly, the file `psfonts.map' is needed also, mapping from
>     TFM names to PostScript font names.
>
> Comment: It is better to integrate groff.map in autogenerated
>          psfonts.map

Yes, of course.

>    Or name tfm files with full PS font names, thus avoiding mapping.

Hmm, I like the other solution more.

>      Note that, by default, the typesetting commands in  the
>    btex ... etex blocks in the above example are processed by
>
>       eqn -d\$\$ | troff -Tpost
>
>    This  doesn't  work  with groff (there is no `post' device).
>
> Comment: It is fixed in new metapost (at least 0.9),
>  makempx there uses
>        ${TROFF='eqn -Tps -d\$\$ | troff -Tps'}

Aah, good to know, so the text should be updated.


    Werner
#! /bin/sed -f

/^%%DocumentFonts: / {
  s/^%%DocumentFonts://
: loop1
  h
  N
  s/\n%%+//
  t loop1
  x
  s/^ //
  s/ /\
%%+ font /g
  s/^/%%DocumentNeededResources: font /
  s/$/\
%%EndComments/
  p
  s/^.*Symbol-Slanted.*$/&\
%%IncludeResource: font Symbol-Slanted/
  s/^.*ZapfDingbats-Reverse.*$/&\
%%IncludeResource: font ZapfDingbats-Reverse/
  s/^.*FreeEuro.*$/&\
%%IncludeResource: font FreeEuro/
  s/^.*%%EndComments\n//
  w fixmp.tmp
  g
  r groff.enc
  D
}

/^ \/grofeuro/ b
/^ \/grofs/ b
/^ \/grofss/ b
/^ \/grofzd/ b
/^ \/grofzdr/ b
/^ \/grof/ {
  s/^ //
  s/ def$//
  h
  s/\([^ ][^ ]*\) \([^ ][^ ]*\)$/ \2-groff groffEncoding \2 RE/
  p
  g
  s/\([^ ][^ ]*\) \([^ ][^ ]*\)$/ \1 \2-groff def/
}

/^%%EndProlog/ {
  a\
%%BeginSetup
  r fixmp.tmp
  a\
%%EndSetup
}

Attachment: grdemo-doc.ps
Description: PostScript document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]