freetype-devel
[Top][All Lists]
Advanced

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

[Devel] CFF & FT_Get_First_Char Problem


From: Ivan Nincic
Subject: [Devel] CFF & FT_Get_First_Char Problem
Date: Thu, 15 May 2003 23:07:49 +0000

Ok. I tested the this font/code on several other implementations/fonts and it seems that this is a bug in CFF driver. Can someone confirm this?

---
In regards to CID CFF fonts I have another question.

In order to get a glyph index it seems thar the library user needs to do something like this

// Get ghlyph index for given cid
CFF_Font cff = (CFF_Font)((TT_Face) m_font_face)->extra.data;
for (UInt j = 0; j < cff->num_glyphs; ++j)  {
 if (cff->charset.sids[j] == cid) {
   return j;
 }
}

Now isn't this code supposed to be encapsulated in the library itself?
Why FT_Get_Char_Index(cid) can't do the same job?


Ivan Nincic



-----Original Message-----
Hello,

I have a problem reading glyph outlines from the following Typ1/CFF font:

 http://www3.telus.net/public/ab114139/times.cff

The font has a custom encodings. I tried to extract char-names using the
following code:

char buf[2048;
for (int i=0; i<256; ++i) FT_Get_Glyph_Name(face, gindex, buf, 2048);

but got an exception when i==15.

Because this method does not produce char-code to glyph index mapping I
tried the following:

int result =  FT_Select_Charmap(face, FT_ENCODING_ADOBE_CUSTOM);
FT_UInt gindex;
FT_ULong charcode = FT_Get_First_Char( face, &gindex );
while (gindex != 0)
{
 ret = FT_Get_Glyph_Name(face, gindex, tmp_buf, tmp_buf_sz);
 charcode = FT_Get_Next_Char(face, charcode, &gindex);
}

however the loop breaks after a single iteration.

What is the best way to extract built-in encoding for Type1/CFF fonts?

Thanx,

Ivan Nincic

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail




reply via email to

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