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

Re: BlueSky fonts and subfont (and FixFont, dvips & PDF)



I wrote:
>> [...] I'm using the marvelous `FixFont' utility for [the task of
>> converting some legacy PostScript files (without the original DVI
>> files that created them) from using bitmaps to using BlueSky outline
>> fonts].

... and Berthold replied:
> Could you amplify on that?

Certainly, see http://www.emrg.com/texpdf.html for details, or just
download it from http://www.emrg.com/FixFont.tar and read the README
file.

Basically, it uses a database which has 32-bit hash-codes for each glyph
of each CM font at each resolution. It tries to match the glyphs in the
PS file's bitmap fonts to these hashes, and when it thinks it has a
match (you can vary how many matches it needs before it substitutes),
it substitutes the font for the outline version. Obviously, the resolution
needs to be in the database and the Metafont mode fairly similar. You
can make your own database for local modes, but the provided database
has worked remarkably well on the files I've tried.

And all of the above is necessary because older dvips versions never
cared to put in any comments as to just what PK fonts it was inserting.

Berthold also writes:
> Important point, as you say [when including the outline fonts in the
> PostScript file for distiller] you want the fonts to be `unsubsetted'
> Otherwise Distiller thinks they are complete fonts.  In your case they
> would naturally be unsubsetted, but I have seen people produce bad
> PDF by having partial fonts in the PS files (as opposed to none which
> is by far the best - or complete fonts).

Can you explain why this is bad PDF? I fear that in the past I may have
made just such files, since my dvips is configured to always subset
fonts (and include fonts not in the `Standard 35') and I've given that
output to distiller. (I have distiller configured to always subset fonts
too, which seems to result in some (useful) font renaming in this case,
the subset of `cmmi10', which dvips 5.60a called `cmmi10', got called
`AGPGAL+cmmi10' in the PDF file).

> You don't see this problem when you produce output from DVIPS directly
> using Type 1 fonts, since it forces the same fixed resolution onto
> the Type 1 fonts by redefining their metrics.

Ah. This explains things then; FixFont just uses:

  /DvipsFontMatrix [ 4 0 0 -4 0 0 ] def
  % ... and later ...
  /Fa { /CMR10 findfont 10.000 scalefont DvipsFontMatrix makefont setfont } def

...whereas dvips, when asked to use BlueSky fonts directly dvips utters:
  /rf{findfont dup length 1 add dict begin{1 index /FID ne 2
      index /UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll
      exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metrics
      exch def dict begin Encoding{exch dup type /integertype ne{pop pop 1
      sub dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div
      def} ifelse}forall Metrics /Metrics currentdict end def[2 index
      currentdict end definefont 3 -1 roll makefont /setfont load]cvx def}def
  % ... and later ...
  /Fa 141[33 2[42 2[23 6[37 46 12[85 14[62 22[42 2[23 46[{}9 83.022003
      /CMR10 rf

I guess I could fix things for FixFont so it too munged the metrics of
the font, but my PostScript hacking isn't too great. Anyone else want to
try it? Myself, while I can readily understand FixFont's incantation, it
would probably take me a whole evening with the Red Book beside me to
figure out how to extract the relevant parts of what dvips is doing.

Best Regards,

    Melissa.