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/cid/cidobjs.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/cid/cidobjs.c')
-rw-r--r-- | src/3rdparty/freetype/src/cid/cidobjs.c | 81 |
1 files changed, 41 insertions, 40 deletions
diff --git a/src/3rdparty/freetype/src/cid/cidobjs.c b/src/3rdparty/freetype/src/cid/cidobjs.c index 1b3bfbf74..9647d8701 100644 --- a/src/3rdparty/freetype/src/cid/cidobjs.c +++ b/src/3rdparty/freetype/src/cid/cidobjs.c @@ -4,7 +4,7 @@ /* */ /* CID objects manager (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -193,61 +193,61 @@ FT_LOCAL_DEF( void ) cid_face_done( FT_Face cidface ) /* CID_Face */ { - CID_Face face = (CID_Face)cidface; - FT_Memory memory; + CID_Face face = (CID_Face)cidface; + FT_Memory memory; + CID_FaceInfo cid; + PS_FontInfo info; - if ( face ) - { - CID_FaceInfo cid = &face->cid; - PS_FontInfo info = &cid->font_info; + if ( !face ) + return; + cid = &face->cid; + info = &cid->font_info; + memory = cidface->memory; - memory = cidface->memory; + /* release subrs */ + if ( face->subrs ) + { + FT_Int n; - /* release subrs */ - if ( face->subrs ) + + for ( n = 0; n < cid->num_dicts; n++ ) { - FT_Int n; + CID_Subrs subr = face->subrs + n; - for ( n = 0; n < cid->num_dicts; n++ ) + if ( subr->code ) { - CID_Subrs subr = face->subrs + n; - - - if ( subr->code ) - { - FT_FREE( subr->code[0] ); - FT_FREE( subr->code ); - } + FT_FREE( subr->code[0] ); + FT_FREE( subr->code ); } - - FT_FREE( face->subrs ); } - /* release FontInfo strings */ - FT_FREE( info->version ); - FT_FREE( info->notice ); - FT_FREE( info->full_name ); - FT_FREE( info->family_name ); - FT_FREE( info->weight ); + FT_FREE( face->subrs ); + } - /* release font dictionaries */ - FT_FREE( cid->font_dicts ); - cid->num_dicts = 0; + /* release FontInfo strings */ + FT_FREE( info->version ); + FT_FREE( info->notice ); + FT_FREE( info->full_name ); + FT_FREE( info->family_name ); + FT_FREE( info->weight ); - /* release other strings */ - FT_FREE( cid->cid_font_name ); - FT_FREE( cid->registry ); - FT_FREE( cid->ordering ); + /* release font dictionaries */ + FT_FREE( cid->font_dicts ); + cid->num_dicts = 0; - cidface->family_name = 0; - cidface->style_name = 0; + /* release other strings */ + FT_FREE( cid->cid_font_name ); + FT_FREE( cid->registry ); + FT_FREE( cid->ordering ); - FT_FREE( face->binary_data ); - FT_FREE( face->cid_stream ); - } + cidface->family_name = 0; + cidface->style_name = 0; + + FT_FREE( face->binary_data ); + FT_FREE( face->cid_stream ); } @@ -324,6 +324,7 @@ goto Exit; /* check the face index */ + /* XXX: handle CID fonts with more than a single face */ if ( face_index != 0 ) { FT_ERROR(( "cid_face_init: invalid face index\n" )); |