diff options
author | Werner Lemberg <wl@gnu.org> | 2011-03-09 06:18:28 +0100 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2011-03-09 06:18:28 +0100 |
commit | cecd9127478e4e2c26105d5df71b3ed9b5dc4018 (patch) | |
tree | baad88b8d46dc3d59a108229c5066d2acf988f69 /src | |
parent | d87389e9d38e69e132b2885a8332b45cef4750aa (diff) |
Make FT_Sfnt_Table_Info return the number of SFNT tables.
* src/sfnt/sfdriver.c (sfnt_table_info): Implement it.
* include/freetype/tttables.h: Update documentation.
* docs/CHANGES: Updated.
Diffstat (limited to 'src')
-rw-r--r-- | src/sfnt/sfdriver.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index b74679b3..247aa679 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -4,7 +4,7 @@ /* */ /* High-level SFNT driver interface (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ +/* Copyright 1996-2007, 2009-2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -117,15 +117,20 @@ FT_ULong *offset, FT_ULong *length ) { - if ( !tag || !offset || !length ) + if ( !offset || !length ) return SFNT_Err_Invalid_Argument; - if ( idx >= face->num_tables ) - return SFNT_Err_Table_Missing; + if ( !tag ) + *length = face->num_tables; + else + { + if ( idx >= face->num_tables ) + return SFNT_Err_Table_Missing; - *tag = face->dir_tables[idx].Tag; - *offset = face->dir_tables[idx].Offset; - *length = face->dir_tables[idx].Length; + *tag = face->dir_tables[idx].Tag; + *offset = face->dir_tables[idx].Offset; + *length = face->dir_tables[idx].Length; + } return SFNT_Err_Ok; } |