2000-07-20 08:57:41 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftnames.c */
|
|
|
|
/* */
|
|
|
|
/* Simple interface to access SFNT name tables (which are used */
|
2000-10-17 05:38:43 +02:00
|
|
|
/* to hold font names, copyright info, notices, etc.) (body). */
|
2000-07-20 08:57:41 +02:00
|
|
|
/* */
|
|
|
|
/* This is _not_ used to retrieve glyph names! */
|
|
|
|
/* */
|
|
|
|
/* Copyright 1996-2000 by */
|
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
|
|
|
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
|
|
|
/* this file you indicate that you have read the license and */
|
|
|
|
/* understand and accept it fully. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2000-07-19 19:13:03 +02:00
|
|
|
#include <freetype/ftnames.h>
|
|
|
|
#include <freetype/internal/tttypes.h>
|
|
|
|
|
|
|
|
|
2000-10-15 19:59:17 +02:00
|
|
|
#ifdef TT_CONFIG_OPTION_SFNT_NAMES
|
2000-07-19 19:13:03 +02:00
|
|
|
|
|
|
|
|
2000-11-07 18:21:11 +01:00
|
|
|
/* documentation is in ftnames.h */
|
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_EXPORT_DEF( FT_UInt ) FT_Get_Sfnt_Name_Count( FT_Face face )
|
2000-07-19 19:13:03 +02:00
|
|
|
{
|
2000-11-29 05:45:26 +01:00
|
|
|
return (face && FT_IS_SFNT( face )) ? ((TT_Face)face)->num_names : 0;
|
2000-07-19 19:13:03 +02:00
|
|
|
}
|
2000-10-31 21:42:18 +01:00
|
|
|
|
|
|
|
|
2000-11-07 18:21:11 +01:00
|
|
|
/* documentation is in ftnames.h */
|
|
|
|
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Get_Sfnt_Name( FT_Face face,
|
|
|
|
FT_UInt index,
|
2000-11-07 07:30:29 +01:00
|
|
|
FT_SfntName *aname )
|
2000-07-19 19:13:03 +02:00
|
|
|
{
|
|
|
|
FT_Error error = FT_Err_Invalid_Argument;
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2000-07-20 08:57:41 +02:00
|
|
|
|
|
|
|
if ( aname && face && FT_IS_SFNT( face ) )
|
2000-07-19 19:13:03 +02:00
|
|
|
{
|
|
|
|
TT_Face ttface = (TT_Face)face;
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2000-07-20 08:57:41 +02:00
|
|
|
|
|
|
|
if ( index < ttface->num_names )
|
2000-07-19 19:13:03 +02:00
|
|
|
{
|
|
|
|
TT_NameRec* name = ttface->name_table.names + index;
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2000-07-20 08:57:41 +02:00
|
|
|
|
2000-07-19 19:13:03 +02:00
|
|
|
aname->platform_id = name->platformID;
|
|
|
|
aname->encoding_id = name->encodingID;
|
|
|
|
aname->language_id = name->languageID;
|
|
|
|
aname->name_id = name->nameID;
|
|
|
|
aname->string = (FT_Byte*)name->string;
|
|
|
|
aname->string_len = name->stringLength;
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2000-07-19 19:13:03 +02:00
|
|
|
error = FT_Err_Ok;
|
|
|
|
}
|
|
|
|
}
|
2000-10-31 21:42:18 +01:00
|
|
|
|
2000-07-19 19:13:03 +02:00
|
|
|
return error;
|
2000-10-31 21:42:18 +01:00
|
|
|
}
|
2000-07-20 08:57:41 +02:00
|
|
|
|
|
|
|
|
2000-10-15 19:59:17 +02:00
|
|
|
#endif /* TT_CONFIG_OPTION_SFNT_NAMES */
|
2000-07-20 08:57:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|