diff options
author | David Boddie <dboddie@trolltech.com> | 2009-08-14 17:18:48 +0200 |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-08-14 17:18:48 +0200 |
commit | 9db9c1f2215e32047c7329ab769d54dd3c1ddeb7 (patch) | |
tree | 98acb9a60cf237138f939b5dadb0d9ae7722ddeb /src/3rdparty/freetype/src/base/ftcid.c | |
parent | e9d32707afeddfdd2906af7bed60c375b1035dd6 (diff) | |
parent | 3c8f4512df30dee4a867a498fff6d2b27b881e4b (diff) |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/3rdparty/freetype/src/base/ftcid.c')
-rw-r--r-- | src/3rdparty/freetype/src/base/ftcid.c | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/src/3rdparty/freetype/src/base/ftcid.c b/src/3rdparty/freetype/src/base/ftcid.c index 5a8b50ff2..733aae147 100644 --- a/src/3rdparty/freetype/src/base/ftcid.c +++ b/src/3rdparty/freetype/src/base/ftcid.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing CID font information. */ /* */ -/* Copyright 2007 by Derek Clegg. */ +/* Copyright 2007, 2009 by Derek Clegg, Michael Toftdal. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ @@ -16,6 +16,7 @@ #include <ft2build.h> +#include FT_CID_H #include FT_INTERNAL_OBJECTS_H #include FT_SERVICE_CID_H @@ -60,4 +61,57 @@ } + FT_EXPORT_DEF( FT_Error ) + FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face, + FT_Bool *is_cid ) + { + FT_Error error = FT_Err_Invalid_Argument; + FT_Bool ic = 0; + + + if ( face ) + { + FT_Service_CID service; + + + FT_FACE_FIND_SERVICE( face, service, CID ); + + if ( service && service->get_is_cid ) + error = service->get_is_cid( face, &ic); + } + + if ( is_cid ) + *is_cid = ic; + + return error; + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Get_CID_From_Glyph_Index( FT_Face face, + FT_UInt glyph_index, + FT_UInt *cid ) + { + FT_Error error = FT_Err_Invalid_Argument; + FT_UInt c = 0; + + + if ( face ) + { + FT_Service_CID service; + + + FT_FACE_FIND_SERVICE( face, service, CID ); + + if ( service && service->get_cid_from_glyph_index ) + error = service->get_cid_from_glyph_index( face, glyph_index, &c); + } + + if ( cid ) + *cid = c; + + return error; + } + + /* END */ |