freetype-devel
[Top][All Lists]
Advanced

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

[Devel] glyph advance data from freeType


From: Mark Storer
Subject: [Devel] glyph advance data from freeType
Date: Wed, 9 Jan 2002 14:50:43 -0800

Background:  I'm writing an Acrobat-API PDF manipulation whatchamacallit.
C++/win32 (but with portability in mind).  We've recently added unicode
support.  CID fonts, CMaps, the whole bit (no vertical text yet).

I ran into a problem.  Using CID fonts, you can only draw characters that
are in one of Adobe's CID tables.  And you can't cross tables with the same
font/cmap combo.

So I turned to glyph IDs.  And the win32 API only provides that information
as of win2k, so that was out.

Enter FreeType.

I'm now successfully extracting glyph IDs from a given font, via
FT_Get_Char_Index().  The down side is that the Acrobat API is really
mangling the width information... it can't handle directly addressing glyph
IDs... it's still thinking in CIDs.

I know FreeType(2) can get glyph metrics.  FT_Face->glyph->horiAdvance.  No
problem, right?

Wrong.

The Question:

Shouldn't the 1000ths-of-an-EM width information from Acrobat's API match
that coming from FT?  Well... it doesn't.

Example:  'T' from ArialUnicodeMS... 
Glyph ID: 37
Acrobat's EM Advance (using the regular WinAnsiEncoding): 611
FT's EM advance (using the glyph ID): 1251

SO what's the deal?  Am I getting my information from the wrong place?



--Mark Storer
  Software Engineer
  Cardiff Software

#include <disclaimer>
typedef std::disclaimer<Cardiff> Discard;



reply via email to

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