00001 /***************************************************************************/ 00002 /* */ 00003 /* ftwinfnt.h */ 00004 /* */ 00005 /* FreeType API for accessing Windows fnt-specific data. */ 00006 /* */ 00007 /* Copyright 2003, 2004, 2008 by */ 00008 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 00009 /* */ 00010 /* This file is part of the FreeType project, and may only be used, */ 00011 /* modified, and distributed under the terms of the FreeType project */ 00012 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 00013 /* this file you indicate that you have read the license and */ 00014 /* understand and accept it fully. */ 00015 /* */ 00016 /***************************************************************************/ 00017 00018 00019 #ifndef __FTWINFNT_H__ 00020 #define __FTWINFNT_H__ 00021 00022 #include <ft2build.h> 00023 #include FT_FREETYPE_H 00024 00025 #ifdef FREETYPE_H 00026 #error "freetype.h of FreeType 1 has been loaded!" 00027 #error "Please fix the directory search order for header files" 00028 #error "so that freetype.h of FreeType 2 is found first." 00029 #endif 00030 00031 00032 FT_BEGIN_HEADER 00033 00034 00035 /*************************************************************************/ 00036 /* */ 00037 /* <Section> */ 00038 /* winfnt_fonts */ 00039 /* */ 00040 /* <Title> */ 00041 /* Window FNT Files */ 00042 /* */ 00043 /* <Abstract> */ 00044 /* Windows FNT specific API. */ 00045 /* */ 00046 /* <Description> */ 00047 /* This section contains the declaration of Windows FNT specific */ 00048 /* functions. */ 00049 /* */ 00050 /*************************************************************************/ 00051 00052 00053 /************************************************************************* 00054 * 00055 * @enum: 00056 * FT_WinFNT_ID_XXX 00057 * 00058 * @description: 00059 * A list of valid values for the `charset' byte in 00060 * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX 00061 * encodings (except for cp1361) can be found at ftp://ftp.unicode.org 00062 * in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is 00063 * roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. 00064 * 00065 * @values: 00066 * FT_WinFNT_ID_DEFAULT :: 00067 * This is used for font enumeration and font creation as a 00068 * `don't care' value. Valid font files don't contain this value. 00069 * When querying for information about the character set of the font 00070 * that is currently selected into a specified device context, this 00071 * return value (of the related Windows API) simply denotes failure. 00072 * 00073 * FT_WinFNT_ID_SYMBOL :: 00074 * There is no known mapping table available. 00075 * 00076 * FT_WinFNT_ID_MAC :: 00077 * Mac Roman encoding. 00078 * 00079 * FT_WinFNT_ID_OEM :: 00080 * From Michael Pöttgen <michael@poettgen.de>: 00081 * 00082 * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM 00083 * is used for the charset of vector fonts, like `modern.fon', 00084 * `roman.fon', and `script.fon' on Windows. 00085 * 00086 * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value 00087 * specifies a character set that is operating-system dependent. 00088 * 00089 * The `IFIMETRICS' documentation from the `Windows Driver 00090 * Development Kit' says: This font supports an OEM-specific 00091 * character set. The OEM character set is system dependent. 00092 * 00093 * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the 00094 * second default codepage that most international versions of 00095 * Windows have. It is one of the OEM codepages from 00096 * 00097 * http://www.microsoft.com/globaldev/reference/cphome.mspx, 00098 * 00099 * and is used for the `DOS boxes', to support legacy applications. 00100 * A German Windows version for example usually uses ANSI codepage 00101 * 1252 and OEM codepage 850. 00102 * 00103 * FT_WinFNT_ID_CP874 :: 00104 * A superset of Thai TIS 620 and ISO 8859-11. 00105 * 00106 * FT_WinFNT_ID_CP932 :: 00107 * A superset of Japanese Shift-JIS (with minor deviations). 00108 * 00109 * FT_WinFNT_ID_CP936 :: 00110 * A superset of simplified Chinese GB 2312-1980 (with different 00111 * ordering and minor deviations). 00112 * 00113 * FT_WinFNT_ID_CP949 :: 00114 * A superset of Korean Hangul KS~C 5601-1987 (with different 00115 * ordering and minor deviations). 00116 * 00117 * FT_WinFNT_ID_CP950 :: 00118 * A superset of traditional Chinese Big~5 ETen (with different 00119 * ordering and minor deviations). 00120 * 00121 * FT_WinFNT_ID_CP1250 :: 00122 * A superset of East European ISO 8859-2 (with slightly different 00123 * ordering). 00124 * 00125 * FT_WinFNT_ID_CP1251 :: 00126 * A superset of Russian ISO 8859-5 (with different ordering). 00127 * 00128 * FT_WinFNT_ID_CP1252 :: 00129 * ANSI encoding. A superset of ISO 8859-1. 00130 * 00131 * FT_WinFNT_ID_CP1253 :: 00132 * A superset of Greek ISO 8859-7 (with minor modifications). 00133 * 00134 * FT_WinFNT_ID_CP1254 :: 00135 * A superset of Turkish ISO 8859-9. 00136 * 00137 * FT_WinFNT_ID_CP1255 :: 00138 * A superset of Hebrew ISO 8859-8 (with some modifications). 00139 * 00140 * FT_WinFNT_ID_CP1256 :: 00141 * A superset of Arabic ISO 8859-6 (with different ordering). 00142 * 00143 * FT_WinFNT_ID_CP1257 :: 00144 * A superset of Baltic ISO 8859-13 (with some deviations). 00145 * 00146 * FT_WinFNT_ID_CP1258 :: 00147 * For Vietnamese. This encoding doesn't cover all necessary 00148 * characters. 00149 * 00150 * FT_WinFNT_ID_CP1361 :: 00151 * Korean (Johab). 00152 */ 00153 00154 #define FT_WinFNT_ID_CP1252 0 00155 #define FT_WinFNT_ID_DEFAULT 1 00156 #define FT_WinFNT_ID_SYMBOL 2 00157 #define FT_WinFNT_ID_MAC 77 00158 #define FT_WinFNT_ID_CP932 128 00159 #define FT_WinFNT_ID_CP949 129 00160 #define FT_WinFNT_ID_CP1361 130 00161 #define FT_WinFNT_ID_CP936 134 00162 #define FT_WinFNT_ID_CP950 136 00163 #define FT_WinFNT_ID_CP1253 161 00164 #define FT_WinFNT_ID_CP1254 162 00165 #define FT_WinFNT_ID_CP1258 163 00166 #define FT_WinFNT_ID_CP1255 177 00167 #define FT_WinFNT_ID_CP1256 178 00168 #define FT_WinFNT_ID_CP1257 186 00169 #define FT_WinFNT_ID_CP1251 204 00170 #define FT_WinFNT_ID_CP874 222 00171 #define FT_WinFNT_ID_CP1250 238 00172 #define FT_WinFNT_ID_OEM 255 00173 00174 00175 /*************************************************************************/ 00176 /* */ 00177 /* <Struct> */ 00178 /* FT_WinFNT_HeaderRec */ 00179 /* */ 00180 /* <Description> */ 00181 /* Windows FNT Header info. */ 00182 /* */ 00183 typedef struct FT_WinFNT_HeaderRec_ 00184 { 00185 FT_UShort version; 00186 FT_ULong file_size; 00187 FT_Byte copyright[60]; 00188 FT_UShort file_type; 00189 FT_UShort nominal_point_size; 00190 FT_UShort vertical_resolution; 00191 FT_UShort horizontal_resolution; 00192 FT_UShort ascent; 00193 FT_UShort internal_leading; 00194 FT_UShort external_leading; 00195 FT_Byte italic; 00196 FT_Byte underline; 00197 FT_Byte strike_out; 00198 FT_UShort weight; 00199 FT_Byte charset; 00200 FT_UShort pixel_width; 00201 FT_UShort pixel_height; 00202 FT_Byte pitch_and_family; 00203 FT_UShort avg_width; 00204 FT_UShort max_width; 00205 FT_Byte first_char; 00206 FT_Byte last_char; 00207 FT_Byte default_char; 00208 FT_Byte break_char; 00209 FT_UShort bytes_per_row; 00210 FT_ULong device_offset; 00211 FT_ULong face_name_offset; 00212 FT_ULong bits_pointer; 00213 FT_ULong bits_offset; 00214 FT_Byte reserved; 00215 FT_ULong flags; 00216 FT_UShort A_space; 00217 FT_UShort B_space; 00218 FT_UShort C_space; 00219 FT_UShort color_table_offset; 00220 FT_ULong reserved1[4]; 00221 00222 } FT_WinFNT_HeaderRec; 00223 00224 00225 /*************************************************************************/ 00226 /* */ 00227 /* <Struct> */ 00228 /* FT_WinFNT_Header */ 00229 /* */ 00230 /* <Description> */ 00231 /* A handle to an @FT_WinFNT_HeaderRec structure. */ 00232 /* */ 00233 typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header; 00234 00235 00236 /********************************************************************** 00237 * 00238 * @function: 00239 * FT_Get_WinFNT_Header 00240 * 00241 * @description: 00242 * Retrieve a Windows FNT font info header. 00243 * 00244 * @input: 00245 * face :: A handle to the input face. 00246 * 00247 * @output: 00248 * aheader :: The WinFNT header. 00249 * 00250 * @return: 00251 * FreeType error code. 0~means success. 00252 * 00253 * @note: 00254 * This function only works with Windows FNT faces, returning an error 00255 * otherwise. 00256 */ 00257 FT_EXPORT( FT_Error ) 00258 FT_Get_WinFNT_Header( FT_Face face, 00259 FT_WinFNT_HeaderRec *aheader ); 00260 00261 00262 /* */ 00263 00264 FT_END_HEADER 00265 00266 #endif /* __FTWINFNT_H__ */ 00267 00268 00269 /* END */ 00270 00271 00272 /* Local Variables: */ 00273 /* coding: utf-8 */ 00274 /* End: */