vrshoot
diff libs/ft2static/freetype/ftsnames.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/ft2static/freetype/ftsnames.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,200 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftsnames.h */ 1.7 +/* */ 1.8 +/* Simple interface to access SFNT name tables (which are used */ 1.9 +/* to hold font names, copyright info, notices, etc.) (specification). */ 1.10 +/* */ 1.11 +/* This is _not_ used to retrieve glyph names! */ 1.12 +/* */ 1.13 +/* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */ 1.14 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.15 +/* */ 1.16 +/* This file is part of the FreeType project, and may only be used, */ 1.17 +/* modified, and distributed under the terms of the FreeType project */ 1.18 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.19 +/* this file you indicate that you have read the license and */ 1.20 +/* understand and accept it fully. */ 1.21 +/* */ 1.22 +/***************************************************************************/ 1.23 + 1.24 + 1.25 +#ifndef __FT_SFNT_NAMES_H__ 1.26 +#define __FT_SFNT_NAMES_H__ 1.27 + 1.28 + 1.29 +#include <ft2build.h> 1.30 +#include FT_FREETYPE_H 1.31 + 1.32 +#ifdef FREETYPE_H 1.33 +#error "freetype.h of FreeType 1 has been loaded!" 1.34 +#error "Please fix the directory search order for header files" 1.35 +#error "so that freetype.h of FreeType 2 is found first." 1.36 +#endif 1.37 + 1.38 + 1.39 +FT_BEGIN_HEADER 1.40 + 1.41 + 1.42 + /*************************************************************************/ 1.43 + /* */ 1.44 + /* <Section> */ 1.45 + /* sfnt_names */ 1.46 + /* */ 1.47 + /* <Title> */ 1.48 + /* SFNT Names */ 1.49 + /* */ 1.50 + /* <Abstract> */ 1.51 + /* Access the names embedded in TrueType and OpenType files. */ 1.52 + /* */ 1.53 + /* <Description> */ 1.54 + /* The TrueType and OpenType specifications allow the inclusion of */ 1.55 + /* a special `names table' in font files. This table contains */ 1.56 + /* textual (and internationalized) information regarding the font, */ 1.57 + /* like family name, copyright, version, etc. */ 1.58 + /* */ 1.59 + /* The definitions below are used to access them if available. */ 1.60 + /* */ 1.61 + /* Note that this has nothing to do with glyph names! */ 1.62 + /* */ 1.63 + /*************************************************************************/ 1.64 + 1.65 + 1.66 + /*************************************************************************/ 1.67 + /* */ 1.68 + /* <Struct> */ 1.69 + /* FT_SfntName */ 1.70 + /* */ 1.71 + /* <Description> */ 1.72 + /* A structure used to model an SFNT `name' table entry. */ 1.73 + /* */ 1.74 + /* <Fields> */ 1.75 + /* platform_id :: The platform ID for `string'. */ 1.76 + /* */ 1.77 + /* encoding_id :: The encoding ID for `string'. */ 1.78 + /* */ 1.79 + /* language_id :: The language ID for `string'. */ 1.80 + /* */ 1.81 + /* name_id :: An identifier for `string'. */ 1.82 + /* */ 1.83 + /* string :: The `name' string. Note that its format differs */ 1.84 + /* depending on the (platform,encoding) pair. It can */ 1.85 + /* be a Pascal String, a UTF-16 one, etc. */ 1.86 + /* */ 1.87 + /* Generally speaking, the string is not */ 1.88 + /* zero-terminated. Please refer to the TrueType */ 1.89 + /* specification for details. */ 1.90 + /* */ 1.91 + /* string_len :: The length of `string' in bytes. */ 1.92 + /* */ 1.93 + /* <Note> */ 1.94 + /* Possible values for `platform_id', `encoding_id', `language_id', */ 1.95 + /* and `name_id' are given in the file `ttnameid.h'. For details */ 1.96 + /* please refer to the TrueType or OpenType specification. */ 1.97 + /* */ 1.98 + /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */ 1.99 + /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */ 1.100 + /* */ 1.101 + typedef struct FT_SfntName_ 1.102 + { 1.103 + FT_UShort platform_id; 1.104 + FT_UShort encoding_id; 1.105 + FT_UShort language_id; 1.106 + FT_UShort name_id; 1.107 + 1.108 + FT_Byte* string; /* this string is *not* null-terminated! */ 1.109 + FT_UInt string_len; /* in bytes */ 1.110 + 1.111 + } FT_SfntName; 1.112 + 1.113 + 1.114 + /*************************************************************************/ 1.115 + /* */ 1.116 + /* <Function> */ 1.117 + /* FT_Get_Sfnt_Name_Count */ 1.118 + /* */ 1.119 + /* <Description> */ 1.120 + /* Retrieve the number of name strings in the SFNT `name' table. */ 1.121 + /* */ 1.122 + /* <Input> */ 1.123 + /* face :: A handle to the source face. */ 1.124 + /* */ 1.125 + /* <Return> */ 1.126 + /* The number of strings in the `name' table. */ 1.127 + /* */ 1.128 + FT_EXPORT( FT_UInt ) 1.129 + FT_Get_Sfnt_Name_Count( FT_Face face ); 1.130 + 1.131 + 1.132 + /*************************************************************************/ 1.133 + /* */ 1.134 + /* <Function> */ 1.135 + /* FT_Get_Sfnt_Name */ 1.136 + /* */ 1.137 + /* <Description> */ 1.138 + /* Retrieve a string of the SFNT `name' table for a given index. */ 1.139 + /* */ 1.140 + /* <Input> */ 1.141 + /* face :: A handle to the source face. */ 1.142 + /* */ 1.143 + /* idx :: The index of the `name' string. */ 1.144 + /* */ 1.145 + /* <Output> */ 1.146 + /* aname :: The indexed @FT_SfntName structure. */ 1.147 + /* */ 1.148 + /* <Return> */ 1.149 + /* FreeType error code. 0~means success. */ 1.150 + /* */ 1.151 + /* <Note> */ 1.152 + /* The `string' array returned in the `aname' structure is not */ 1.153 + /* null-terminated. The application should deallocate it if it is no */ 1.154 + /* longer in use. */ 1.155 + /* */ 1.156 + /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ 1.157 + /* `name' table entries, then do a loop until you get the right */ 1.158 + /* platform, encoding, and name ID. */ 1.159 + /* */ 1.160 + FT_EXPORT( FT_Error ) 1.161 + FT_Get_Sfnt_Name( FT_Face face, 1.162 + FT_UInt idx, 1.163 + FT_SfntName *aname ); 1.164 + 1.165 + 1.166 + /*************************************************************************** 1.167 + * 1.168 + * @constant: 1.169 + * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY 1.170 + * 1.171 + * @description: 1.172 + * A constant used as the tag of @FT_Parameter structures to make 1.173 + * FT_Open_Face() ignore preferred family subfamily names in `name' 1.174 + * table since OpenType version 1.4. For backwards compatibility with 1.175 + * legacy systems which has 4-face-per-family restriction. 1.176 + * 1.177 + */ 1.178 +#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) 1.179 + 1.180 + 1.181 + /*************************************************************************** 1.182 + * 1.183 + * @constant: 1.184 + * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY 1.185 + * 1.186 + * @description: 1.187 + * A constant used as the tag of @FT_Parameter structures to make 1.188 + * FT_Open_Face() ignore preferred subfamily names in `name' table since 1.189 + * OpenType version 1.4. For backwards compatibility with legacy 1.190 + * systems which has 4-face-per-family restriction. 1.191 + * 1.192 + */ 1.193 +#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' ) 1.194 + 1.195 + /* */ 1.196 + 1.197 + 1.198 +FT_END_HEADER 1.199 + 1.200 +#endif /* __FT_SFNT_NAMES_H__ */ 1.201 + 1.202 + 1.203 +/* END */