michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* ftsnames.h */ michael@0: /* */ michael@0: /* Simple interface to access SFNT name tables (which are used */ michael@0: /* to hold font names, copyright info, notices, etc.) (specification). */ michael@0: /* */ michael@0: /* This is _not_ used to retrieve glyph names! */ michael@0: /* */ michael@0: /* Copyright 1996-2003, 2006, 2009, 2010, 2013 by */ michael@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ michael@0: /* */ michael@0: /* This file is part of the FreeType project, and may only be used, */ michael@0: /* modified, and distributed under the terms of the FreeType project */ michael@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ michael@0: /* this file you indicate that you have read the license and */ michael@0: /* understand and accept it fully. */ michael@0: /* */ michael@0: /***************************************************************************/ michael@0: michael@0: michael@0: #ifndef __FT_SFNT_NAMES_H__ michael@0: #define __FT_SFNT_NAMES_H__ michael@0: michael@0: michael@0: #include michael@0: #include FT_FREETYPE_H michael@0: michael@0: #ifdef FREETYPE_H michael@0: #error "freetype.h of FreeType 1 has been loaded!" michael@0: #error "Please fix the directory search order for header files" michael@0: #error "so that freetype.h of FreeType 2 is found first." michael@0: #endif michael@0: michael@0: michael@0: FT_BEGIN_HEADER michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /*
*/ michael@0: /* sfnt_names */ michael@0: /* */ michael@0: /* */ michael@0: /* SFNT Names */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* Access the names embedded in TrueType and OpenType files. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* The TrueType and OpenType specifications allow the inclusion of */ michael@0: /* a special `names table' in font files. This table contains */ michael@0: /* textual (and internationalized) information regarding the font, */ michael@0: /* like family name, copyright, version, etc. */ michael@0: /* */ michael@0: /* The definitions below are used to access them if available. */ michael@0: /* */ michael@0: /* Note that this has nothing to do with glyph names! */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Struct> */ michael@0: /* FT_SfntName */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* A structure used to model an SFNT `name' table entry. */ michael@0: /* */ michael@0: /* <Fields> */ michael@0: /* platform_id :: The platform ID for `string'. */ michael@0: /* */ michael@0: /* encoding_id :: The encoding ID for `string'. */ michael@0: /* */ michael@0: /* language_id :: The language ID for `string'. */ michael@0: /* */ michael@0: /* name_id :: An identifier for `string'. */ michael@0: /* */ michael@0: /* string :: The `name' string. Note that its format differs */ michael@0: /* depending on the (platform,encoding) pair. It can */ michael@0: /* be a Pascal String, a UTF-16 one, etc. */ michael@0: /* */ michael@0: /* Generally speaking, the string is not */ michael@0: /* zero-terminated. Please refer to the TrueType */ michael@0: /* specification for details. */ michael@0: /* */ michael@0: /* string_len :: The length of `string' in bytes. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* Possible values for `platform_id', `encoding_id', `language_id', */ michael@0: /* and `name_id' are given in the file `ttnameid.h'. For details */ michael@0: /* please refer to the TrueType or OpenType specification. */ michael@0: /* */ michael@0: /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */ michael@0: /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */ michael@0: /* */ michael@0: typedef struct FT_SfntName_ michael@0: { michael@0: FT_UShort platform_id; michael@0: FT_UShort encoding_id; michael@0: FT_UShort language_id; michael@0: FT_UShort name_id; michael@0: michael@0: FT_Byte* string; /* this string is *not* null-terminated! */ michael@0: FT_UInt string_len; /* in bytes */ michael@0: michael@0: } FT_SfntName; michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_Sfnt_Name_Count */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Retrieve the number of name strings in the SFNT `name' table. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to the source face. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* The number of strings in the `name' table. */ michael@0: /* */ michael@0: FT_EXPORT( FT_UInt ) michael@0: FT_Get_Sfnt_Name_Count( FT_Face face ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* <Function> */ michael@0: /* FT_Get_Sfnt_Name */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* Retrieve a string of the SFNT `name' table for a given index. */ michael@0: /* */ michael@0: /* <Input> */ michael@0: /* face :: A handle to the source face. */ michael@0: /* */ michael@0: /* idx :: The index of the `name' string. */ michael@0: /* */ michael@0: /* <Output> */ michael@0: /* aname :: The indexed @FT_SfntName structure. */ michael@0: /* */ michael@0: /* <Return> */ michael@0: /* FreeType error code. 0~means success. */ michael@0: /* */ michael@0: /* <Note> */ michael@0: /* The `string' array returned in the `aname' structure is not */ michael@0: /* null-terminated. The application should deallocate it if it is no */ michael@0: /* longer in use. */ michael@0: /* */ michael@0: /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ michael@0: /* `name' table entries, then do a loop until you get the right */ michael@0: /* platform, encoding, and name ID. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Get_Sfnt_Name( FT_Face face, michael@0: FT_UInt idx, michael@0: FT_SfntName *aname ); michael@0: michael@0: michael@0: /*************************************************************************** michael@0: * michael@0: * @constant: michael@0: * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY michael@0: * michael@0: * @description: michael@0: * A constant used as the tag of @FT_Parameter structures to make michael@0: * FT_Open_Face() ignore preferred family subfamily names in `name' michael@0: * table since OpenType version 1.4. For backwards compatibility with michael@0: * legacy systems that have a 4-face-per-family restriction. michael@0: * michael@0: */ michael@0: #define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) michael@0: michael@0: michael@0: /*************************************************************************** michael@0: * michael@0: * @constant: michael@0: * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY michael@0: * michael@0: * @description: michael@0: * A constant used as the tag of @FT_Parameter structures to make michael@0: * FT_Open_Face() ignore preferred subfamily names in `name' table since michael@0: * OpenType version 1.4. For backwards compatibility with legacy michael@0: * systems that have a 4-face-per-family restriction. michael@0: * michael@0: */ michael@0: #define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' ) michael@0: michael@0: /* */ michael@0: michael@0: michael@0: FT_END_HEADER michael@0: michael@0: #endif /* __FT_SFNT_NAMES_H__ */ michael@0: michael@0: michael@0: /* END */