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: Joris van der Hoeven
Subject: Re: [Freetype] Certain characters of pbf fonts don't render?
Date: Fri, 23 Jan 2004 16:22:29 +0100 (CET)

On Fri, 23 Jan 2004, Jan-Åke Larsson wrote:
> 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)

Thanks for your answer. You are probably right; I forgot about this.
In fact, I already have my own names for all characters and
I already know the character indices for all TeX fonts.
Can I somehow tell FreeType to get the character by its raw index?

Best wishes, Joris


-----------------------------------------------------------
Joris van der Hoeven <address@hidden>
http://www.texmacs.org: GNU TeXmacs scientific text editor
http://www.math.u-psud.fr/~vdhoeven: personal homepage
-----------------------------------------------------------




reply via email to

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