freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Certain characters of pbf fonts don't render?


From: Jan-Åke Larsson
Subject: Re: [Freetype] Certain characters of pbf fonts don't render?
Date: Fri, 23 Jan 2004 10:32:45 +0100
User-agent: Mutt/1.4i

Joris van der Hoeven wrote:
> I just implemented the support for pfb font rendering inside GNU TeXmacs,
> but it seems that certain characters are not rendered at all...
> For example, nor the "fi" ligature (character 12) of cmr10,
> nor most symbols in cmsy10 are rendered. Is this a known problem,
> or did I do something wrong?

This is most probably an encoding problem. You _do_ translate the
character code into a glyph index? Usually this is done by

   FT_Get_Char_Index( face, c )

These glyphs are not (as far as I know) accessible in any of the ADOBE
encodings (you probably selected one of those). Well, ISTR that
FT_ENCODING_ADOBE_CUSTOM works in some cases but not in others.
Anyway, the TeX fonts have their own encodings, usually present on
disk in an .enc file. My solution to this was to load such an encoding
from disk and use it. This is a map from character code to glyph
_name_. I then get the glyph index by

   FT_Get_Name_Index( face, enc_charname[c] )

I would have liked FT2 to load the encoding, but I could not find
anything in the API docs for it. There is a possibility to attach .afm
(metric) files to a font, but not custom encodings like this. It is
not difficult to code this, of course. If you want to see an example,
look at the dvipng code (a fast DVI-to-PNG translater), accessible at 

  http://sourceforge.net/projects/preview-latex

The CVS is at

  http://cvs.sourceforge.net/viewcvs.py/preview-latex/preview/dvipng/

You will want to look at the files ft.c and enc.c (and possibly fontmap.c)

Jan-Åke



reply via email to

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