[tex-k] Plans about supporting TrueType/Type42 fonts in dvips?

Paul Vojta vojta at Math.Berkeley.EDU
Thu Sep 1 20:47:46 CEST 2005


On Thu, Sep 01, 2005 at 09:51:51PM +0400, Vladimir Volovich wrote:
> "PV" == Paul Vojta writes:
> 
>  PV> I have looked into supporting TrueType in xdvi.  A key subsidiary
>  PV> issue that came up (and stopped it for me) was compatibility with
>  PV> ttf2tfm and ttf2pk.  They come up with their own character
>  PV> encoding that basically (as I recall) chooses the lowest-numbered
>  PV> 255 or 256 available characters into the encoding vector.  Adding
>  PV> to the difficulties is the fact that ttf2tfm/ttf2pk use the old
>  PV> (version 1) freetype library.  I tried porting these programs to
>  PV> freetype2, but the latter lacks some features of the original
>  PV> freetype, and is never likely to have them (Werner Lemberg said
>  PV> that programs should use pango instead for these features).
> 
> above you wrote "I have looked into supporting TrueType in xdvi",
> which as far as i understand shall mean ability to render (using
> freetype library) glyphs directly from TrueType fonts,

Correct (so far)

> and of course
> also selecting the needed glyphs of the TrueType fonts according to
> the ReEncodeFont instructions from the MAP files.

AFAIK there is only one .map file, ttfonts.map, which plays a role similar
to that played by psfonts.map used by dvips.

> yet, later you write about ttf2tfm and ttf2pk and how they are using
> old freetype library etc.
> 
> i do not see any relation between "support of TrueType in xdvi" and
> those two programs - ttf2tfm and ttf2pk. there is no relation
> whatsoever. ttf2tfm is one of the many ways to create TFM metrics from
> the TrueType fonts, and ttf2pk is, as you know, just a converter from
> TrueType to PK for those programs which DO NOT support TrueType, and
> thus need to fall back to use PK fonts.
> 
> could you please explain what do you mean?

AFAIK ttf2tfm is the only (or at least the most commonly used) way to
create tfm files from ttf fonts.  The problem is that I need to be able
to mimic ttf2tfm's way of assigning character codes.  It messes them up,
and I don't fully understand its algorithm due to its use of features
present in freetype1 but not freetype2.  For example, do the following:

	% cp /xp/WINDOWS/Fonts/comic.ttf .
	% ttf2tfm comic.ttf -P 1 -E 0
	% echo 'comic comic.ttf Pid=1 Eid=0' > ttfonts.map
	% ttf2pk comic 300
	% tex testfont
	This is TeX, Version 3.141592 (Web2C 7.5.4)
	(/usr/local/texmf/tex/plain/base/testfont.tex 
	Name of the font to test = comic
	Now type a test command (\help for help):)
	*\table\bye
	[1]
	Output written on testfont.dvi (1 page, 11184 bytes).
	Transcript written on testfont.log.
	% xdvi testfont

Notice that 'A' (ascii '101) appears instead in position '041.  And so on.

If a user's document was TeXxed using tfm files created by ttf2tfm, then
xdvi needs to use that same encoding.

--Paul Vojta, vojta at math.berkeley.edu



More information about the tex-k mailing list