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

Re: fontname postfixes




> Ok, my head is spinning now :-)

> I have this insane ambition of making xdvik work with t1 fonts with
> minimal font maps and not too complex font decoding code inside xdvi
> either.  I dislike psfonts.map of dvips.  Maybe some of you (err, is
> tes-fonts just Karl?) can shed some light, come up with ideas.

> When xdvik sees 'ptmr8r' I want it to load the Times Roman font
> and 8r encode it.  A naive first stab resulted in this heuristic
> (or whatever it's called):

> 1. Look for ptmr8r which is what the dvi file says it wants.
>    (This is good for finding cmr10.pfb when the dvi file wants cmr10)

> 2. Not found?  Is that ending a encoding we know? Yes 8r is a known
>    encoding, remove it.  We get ptmr.
> 3. Look for ptmr.
> 4. Found ptmr.pfa load and 8r encode it.
> 5. Font ready for rendering and painting.

Wrong.

  2. Not found?  Skip over the config file line until you find 
     "SomeEncoding ReEncodeFont".
  3. Look as the next statement: Does it say "<8r.enc"? If so, 
     look for 8r.enc and use that file to reencode the font later.
  4. Have we reached the end of the line?  
  4a.) If no, look at the next statement: Does it say "<ptmr8a.pfb"
       (or some other font name)?  Use it.
  4a.) Otherwise, this must be a built-in font, so assume 8a encoding,
       and look for ptmr8a.pfa or ptmr8a.pfb.

> I have a tool to set up ghostscript and standard t1 fonts in the texmf
> hierarchy matching such a scheme and I have a xdvik set up which can
> find fonts named this way.

> A look in the map files tells me this would work with ... a lot of fonts.
> The exceptions that needs to be listed in a map file are few.

> The encodings would come from a map file such as this:

> % Ending   Encoding file
> 8r		8r.enc
> 8y		texnansi.enc

Good idea, but maybe you should add another column for the encoding name:

  % Ending   	Encoding name		Encoding file
  8a		StandardEncoding	8a.enc
  8r		TeXBase1Encoding	8r.enc
  8y		TeXnANSIEncoding	texnansi.enc
  8t		T1Encoding		tex256.enc

> More can be listed as they come into use.  I also want to map the fonts
> that does not fit this scheme: ones that need extention, slanting, or
> have names that are not 'orthogonal' in the naive decoding scheme, such
> as phvr8rn for Helvetica-Narrow (n=informal?).  

No, n=narrow?

> In teTeXs current psfonts.map:

> - not 'orthogonal': 66
> - extended: 26
> - slanted: 27

> Ok, that's not a _short_ list, but it's less than 311.

SlantFont will be a common problem, since you'll typically get two
slanted fonts for every four normal fonts per typeface family.

ExtendFont, however, will be only be a problem when using faked
narrow fonts, which are not produced by default in fontinst.

> Is this insane?  Does code exist that would let me do this?  Ideas?

I recommend looking into dvips and or pdftex sources for code related
to parsing map files.

Cheers, Ulrik.