mirror of https://github.com/freetype/freetype
Savannah patch #5929.
* include/freetype/tttables.h, src/base/ftobjcs.c (FT_Get_CMap_Format): New function. * include/freetype/internal/services/svttcmap.c (TT_CMapInfo): Add `format' member. * src/sfnt/ttcmap.c (tt_cmap{0,2,4,6,8,10,12}_get_info): Set cmap_info->format.
This commit is contained in:
parent
6f99c88801
commit
b826fa7589
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2007-05-19 Derek Clegg <dclegg@apple.com>
|
||||
|
||||
Savannah patch #5929.
|
||||
|
||||
* include/freetype/tttables.h, src/base/ftobjcs.c
|
||||
(FT_Get_CMap_Format): New function.
|
||||
|
||||
* include/freetype/internal/services/svttcmap.c (TT_CMapInfo): Add
|
||||
`format' member.
|
||||
* src/sfnt/ttcmap.c (tt_cmap{0,2,4,6,8,10,12}_get_info): Set
|
||||
cmap_info->format.
|
||||
|
||||
2007-05-19 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/truetype/ttgload.c (load_truetype_glyph): Save graphics state
|
||||
|
|
|
@ -52,6 +52,7 @@ FT_BEGIN_HEADER
|
|||
typedef struct TT_CMapInfo_
|
||||
{
|
||||
FT_ULong language;
|
||||
FT_Long format;
|
||||
|
||||
} TT_CMapInfo;
|
||||
|
||||
|
|
|
@ -725,6 +725,26 @@ FT_BEGIN_HEADER
|
|||
FT_EXPORT( FT_ULong )
|
||||
FT_Get_CMap_Language_ID( FT_CharMap charmap );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_CMap_Format */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return TrueType/sfnt specific cmap format. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* charmap :: */
|
||||
/* The target charmap. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The format of `charmap'. If `charmap' doesn't belong to a */
|
||||
/* TrueType/sfnt face, return -1. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Long )
|
||||
FT_Get_CMap_Format( FT_CharMap charmap );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
|
|
@ -3026,6 +3026,30 @@
|
|||
}
|
||||
|
||||
|
||||
/* documentation is in tttables.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Long )
|
||||
FT_Get_CMap_Format( FT_CharMap charmap )
|
||||
{
|
||||
FT_Service_TTCMaps service;
|
||||
FT_Face face;
|
||||
TT_CMapInfo cmap_info;
|
||||
|
||||
|
||||
if ( !charmap || !charmap->face )
|
||||
return -1;
|
||||
|
||||
face = charmap->face;
|
||||
FT_FACE_FIND_SERVICE( face, service, TT_CMAP );
|
||||
if ( service == NULL )
|
||||
return -1;
|
||||
if ( service->get_cmap_info( charmap, &cmap_info ))
|
||||
return -1;
|
||||
|
||||
return cmap_info.format;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftsizes.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
|
|
|
@ -155,6 +155,7 @@
|
|||
FT_Byte* p = cmap->data + 4;
|
||||
|
||||
|
||||
cmap_info->format = 0;
|
||||
cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
|
||||
|
||||
return SFNT_Err_Ok;
|
||||
|
@ -527,6 +528,7 @@
|
|||
FT_Byte* p = cmap->data + 4;
|
||||
|
||||
|
||||
cmap_info->format = 2;
|
||||
cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
|
||||
|
||||
return SFNT_Err_Ok;
|
||||
|
@ -1303,6 +1305,7 @@
|
|||
FT_Byte* p = cmap->data + 4;
|
||||
|
||||
|
||||
cmap_info->format = 4;
|
||||
cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
|
||||
|
||||
return SFNT_Err_Ok;
|
||||
|
@ -1462,6 +1465,7 @@
|
|||
FT_Byte* p = cmap->data + 4;
|
||||
|
||||
|
||||
cmap_info->format = 6;
|
||||
cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
|
||||
|
||||
return SFNT_Err_Ok;
|
||||
|
@ -1715,6 +1719,7 @@
|
|||
FT_Byte* p = cmap->data + 8;
|
||||
|
||||
|
||||
cmap_info->format = 8;
|
||||
cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
|
||||
|
||||
return SFNT_Err_Ok;
|
||||
|
@ -1863,6 +1868,7 @@
|
|||
FT_Byte* p = cmap->data + 8;
|
||||
|
||||
|
||||
cmap_info->format = 10;
|
||||
cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
|
||||
|
||||
return SFNT_Err_Ok;
|
||||
|
@ -2179,6 +2185,7 @@
|
|||
FT_Byte* p = cmap->data + 8;
|
||||
|
||||
|
||||
cmap_info->format = 12;
|
||||
cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
|
||||
|
||||
return SFNT_Err_Ok;
|
||||
|
|
Loading…
Reference in New Issue