freetype-devel
[Top][All Lists]
Advanced

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

RE: [Devel] Mac language ID


From: Turner David
Subject: RE: [Devel] Mac language ID
Date: Tue, 16 Dec 2003 11:38:45 +0100

Hi,

What about an API like the following instead::

  FT_Get_CMap_Language_ID( cmap ) => language_ID, 0 by default

it would be simpler to use than through a TT_CMapInfo, since
we cannot extend public structures that are used as output
parameters unless we want to break binary compatibility.

Regards,

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

> -----Original Message-----
> From: address@hidden [mailto:address@hidden
> Behalf Of Masatake YAMATO
> Sent: Tuesday, December 16, 2003 11:16 AM
> To: address@hidden; address@hidden
> Cc: address@hidden
> Subject: Re: [Devel] Mac language ID
> 
> 
> > > If we are not permitted to add language_id field to FT_CharMapRec_
> > > because the addition breaks binary compatibility (or for 
> some other
> > > reason), we have to add the language_id to TT_CMap.
> > > 
> > >   typedef struct  TT_CMapRec_
> > >   {
> > >     FT_CMapRec  cmap;
> > >     /* here */
> > >     FT_Byte*    data;         /* pointer to in-memory 
> cmap table */
> > >   } TT_CMapRec, *TT_CMap;
> > > 
> > > In this case we have to consider about the filed accessor because
> > > the TT_CMapRec is sfnt private.
> > 
> > Perhaps an equivalent to the the fttype1.c file; something like an
> > `FT_Get_TT_CMap_Info' function.  This would be a candidate for a
> > Freetype service since the cff and type 42 drivers are affected
> > also...
> 
> I've implemented. I added one type and one function to the 
> public interface.
> 
>   
> /*************************************************************
> ************/
>   /*                                                          
>              */
>   /* <Struct>                                                 
>              */
>   /*    TT_CMapInfo                                           
>              */
>   /*                                                          
>              */
>   /* <Description>                                            
>              */
>   /*    A structure used to store truetype/sfnt specific cmap 
> information  */
>   /*    which is not covered by generic FT_CharMap structure. 
> This         */
>   /*    structure can be accessed with FT_Get_TT_CMap_Info 
> function.       */
>   /*                                                          
>              */
>   /* <Fields>                                                 
>              */
>   /*    language               :: language ID used in Mac 
> fonts.           */
>   /*                              Definitions of values are 
> in             */
>   /*                              freetype/ttnameid.h.        
>              */
>   /*                                                          
>              */
>   typedef struct  TT_CMapInfo_
>   {
>     FT_ULong language;
>   } TT_CMapInfo;
> 
>   
> /*************************************************************
> ************/
>   /*                                                          
>              */
>   /* <Function>                                               
>              */
>   /*    FT_Get_TT_CMap_Info                                   
>              */
>   /*                                                          
>              */
>   /* <Description>                                            
>              */
>   /*    Get truetype/sfnt specific cmap information for given 
> charmap.     */
>   /*                                                          
>              */
>   /* <Input>                                                  
>              */
>   /*    charmap :: target charmap.                            
>              */
>   /*                                                          
>              */
>   /* <Output>                                                 
>              */
>   /*    cmap_info :: truetype/sfnt specific cmap information. 
>              */
>   /*                                                          
>              */
>   /* <Return>                                                 
>              */
>   /*    FreeType errror code. 0 means success.                
>              */
>   /*                                                          
>              */
>   FT_EXPORT( FT_Error )
>   FT_Get_TT_CMap_Info( FT_CharMap   charmap,
>                      TT_CMapInfo  *cmap_info );
> 
> 
> I've added language field to the private data structure.
> 
>   typedef struct  TT_CMapRec_
>   {
>     FT_CMapRec  cmap;
>     FT_Byte*    data;           /* pointer to in-memory cmap table */
>     FT_ULong    language;     /* Used in Mac platform */
> 
>   } TT_CMapRec, *TT_CMap;
> 
> We can do the same thing with language field(`data' field 
> holds the language data). 
> I should provide a function which extracts language field 
> from data instead of
> providing language field which is set by TT_CMap initialize 
> phase. Give me comments.
> 
> language.c is for the test. Compile with patched freetype2 
> and run with font files.
> language.patch is the patch.
> 
> Regards,
> Masatake YAMATO
> 

--
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]