summaryrefslogtreecommitdiff
path: root/src/cid/cidriver.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2009-03-11 21:29:54 +0000
committerWerner Lemberg <wl@gnu.org>2009-03-11 21:29:54 +0000
commit07e818170f146053c876f6138e492ee79614e000 (patch)
tree0653cce76a8a371ddf7c952b70f96d1122b38ddb /src/cid/cidriver.c
parent9318df0cad2b85ddc3509191e83a9927252dc7c8 (diff)
downloadfreetype2-07e818170f146053c876f6138e492ee79614e000.tar.gz
Extend CID service functions to handle CID-keyed CFFs as CID fonts.
* include/freetype/ftcid.h (FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index): New functions. * include/freetype/internal/services/svcid.h (FT_CID_GetIsInternallyCIDKeyedFunc, FT_CID_GetCIDFromGlyphIndexFunc): New function typedefs. (CID Service): Use them. * src/base/ftcid.c: Include FT_CID_H. (FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index): New functions. * src/cff/cffdrivr.c (cff_get_is_cid, cff_get_cid_from_glyph_index): New functions. (cff_service_cid_info): Add them. * src/cff/cffload.c (cff_font_load): Don't free `font->charset.sids' -- it is needed for access as a CID-keyed font. It gets deleted later on. * src/cid/cidriver.c (cid_get_is_cid, cid_get_cid_from_glyph_index): New functions. (cid_service_cid_info): Add them. * docs/CHANGES: Updated.
Diffstat (limited to 'src/cid/cidriver.c')
-rw-r--r--src/cid/cidriver.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c
index f650ee1d9..b41d5d6f0 100644
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -122,9 +122,42 @@
}
+ static FT_Error
+ cid_get_is_cid( CID_Face face,
+ FT_Bool *is_cid )
+ {
+ FT_Error error = CID_Err_Ok;
+ FT_UNUSED( face );
+
+
+ if ( is_cid )
+ *is_cid = 1; /* cid driver is only used for CID keyed fonts */
+
+ return error;
+ }
+
+
+ static FT_Error
+ cid_get_cid_from_glyph_index( CID_Face face,
+ FT_UInt glyph_index,
+ FT_UInt *cid )
+ {
+ FT_Error error = CID_Err_Ok;
+ FT_UNUSED( face );
+
+
+ if ( cid )
+ *cid = glyph_index; /* identity mapping */
+
+ return error;
+ }
+
+
static const FT_Service_CIDRec cid_service_cid_info =
{
- (FT_CID_GetRegistryOrderingSupplementFunc)cid_get_ros
+ (FT_CID_GetRegistryOrderingSupplementFunc)cid_get_ros,
+ (FT_CID_GetIsInternallyCIDKeyedFunc) cid_get_is_cid,
+ (FT_CID_GetCIDFromGlyphIndexFunc) cid_get_cid_from_glyph_index
};