]>
git.saurik.com Git - wxWidgets.git/blob - src/freetype/base/ftnames.c
1 /***************************************************************************/
5 /* Simple interface to access SFNT name tables (which are used */
6 /* to hold font names, copyright info, notices, etc.). */
8 /* This is _not_ used to retrieve glyph names! */
10 /* Copyright 1996-2000 by */
11 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
13 /* This file is part of the FreeType project, and may only be used, */
14 /* modified, and distributed under the terms of the FreeType project */
15 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
16 /* this file you indicate that you have read the license and */
17 /* understand and accept it fully. */
19 /***************************************************************************/
22 #include <freetype/ftnames.h>
23 #include <freetype/internal/tttypes.h>
26 #ifdef FT_CONFIG_OPTION_SFNT_NAMES
29 FT_EXPORT_FUNC( FT_UInt
) FT_Get_Sfnt_Name_Count( FT_Face face
)
31 return face
&& ( FT_IS_SFNT( face
) ? ((TT_Face
)face
)->num_names
: 0 );
35 FT_EXPORT_FUNC( FT_Error
) FT_Get_Sfnt_Name( FT_Face face
,
39 FT_Error error
= FT_Err_Invalid_Argument
;
42 if ( aname
&& face
&& FT_IS_SFNT( face
) )
44 TT_Face ttface
= (TT_Face
)face
;
47 if ( index
< ttface
->num_names
)
49 TT_NameRec
* name
= ttface
->name_table
.names
+ index
;
52 aname
->platform_id
= name
->platformID
;
53 aname
->encoding_id
= name
->encodingID
;
54 aname
->language_id
= name
->languageID
;
55 aname
->name_id
= name
->nameID
;
56 aname
->string
= (FT_Byte
*)name
->string
;
57 aname
->string_len
= name
->stringLength
;
67 #endif /* FT_CONFIG_OPTION_SFNT_NAMES */