freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] CFF & FT_Get_First_Char Problem


From: David Turner
Subject: Re: [Devel] CFF & FT_Get_First_Char Problem
Date: Fri, 16 May 2003 13:23:05 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312

Ivan Nincic wrote:

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;
 }
}

This code is likely to break in any future release of the library, since
it uses internal type declaration that are anything but stable. but I see
your point.

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?

Because a CID if not a character code, its an index into an external CMap
file that is capable of translating character codes into CIDs. We don't
support CMap files for now.

FT_Get_Char_Index is used to translate from Unicode to glyph indices, for
example. What you probably want is another function like "FT_Get_CID_Index(cid)"
that will only work with CID-based fonts.

Sorry to say, we don't have the time to code this for now, but patches are
welcomed.

- David Turner
- The FreeType Project  (www.freetype.org)


--
This message and any attachments (the "message") is intended solely for the
addressees and is confidential. If you receive this message in error, please
delete it and immediately notify the sender.
Any use not in accordance with its purpose, any dissemination or disclosure,
either whole or partial, is prohibited except formal approval.
The E-Mail transmission can not guarantee the integrity of this message.
CANAL+TECHNOLOGIES will not therefore be liable for the message if modified.





reply via email to

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