1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/modules/freetype2/include/ftbdf.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,210 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftbdf.h */ 1.7 +/* */ 1.8 +/* FreeType API for accessing BDF-specific strings (specification). */ 1.9 +/* */ 1.10 +/* Copyright 2002-2004, 2006, 2009, 2014 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +#ifndef __FTBDF_H__ 1.23 +#define __FTBDF_H__ 1.24 + 1.25 +#include <ft2build.h> 1.26 +#include FT_FREETYPE_H 1.27 + 1.28 +#ifdef FREETYPE_H 1.29 +#error "freetype.h of FreeType 1 has been loaded!" 1.30 +#error "Please fix the directory search order for header files" 1.31 +#error "so that freetype.h of FreeType 2 is found first." 1.32 +#endif 1.33 + 1.34 + 1.35 +FT_BEGIN_HEADER 1.36 + 1.37 + 1.38 + /*************************************************************************/ 1.39 + /* */ 1.40 + /* <Section> */ 1.41 + /* bdf_fonts */ 1.42 + /* */ 1.43 + /* <Title> */ 1.44 + /* BDF and PCF Files */ 1.45 + /* */ 1.46 + /* <Abstract> */ 1.47 + /* BDF and PCF specific API. */ 1.48 + /* */ 1.49 + /* <Description> */ 1.50 + /* This section contains the declaration of functions specific to BDF */ 1.51 + /* and PCF fonts. */ 1.52 + /* */ 1.53 + /*************************************************************************/ 1.54 + 1.55 + 1.56 + /********************************************************************** 1.57 + * 1.58 + * @enum: 1.59 + * FT_PropertyType 1.60 + * 1.61 + * @description: 1.62 + * A list of BDF property types. 1.63 + * 1.64 + * @values: 1.65 + * BDF_PROPERTY_TYPE_NONE :: 1.66 + * Value~0 is used to indicate a missing property. 1.67 + * 1.68 + * BDF_PROPERTY_TYPE_ATOM :: 1.69 + * Property is a string atom. 1.70 + * 1.71 + * BDF_PROPERTY_TYPE_INTEGER :: 1.72 + * Property is a 32-bit signed integer. 1.73 + * 1.74 + * BDF_PROPERTY_TYPE_CARDINAL :: 1.75 + * Property is a 32-bit unsigned integer. 1.76 + */ 1.77 + typedef enum BDF_PropertyType_ 1.78 + { 1.79 + BDF_PROPERTY_TYPE_NONE = 0, 1.80 + BDF_PROPERTY_TYPE_ATOM = 1, 1.81 + BDF_PROPERTY_TYPE_INTEGER = 2, 1.82 + BDF_PROPERTY_TYPE_CARDINAL = 3 1.83 + 1.84 + } BDF_PropertyType; 1.85 + 1.86 + 1.87 + /********************************************************************** 1.88 + * 1.89 + * @type: 1.90 + * BDF_Property 1.91 + * 1.92 + * @description: 1.93 + * A handle to a @BDF_PropertyRec structure to model a given 1.94 + * BDF/PCF property. 1.95 + */ 1.96 + typedef struct BDF_PropertyRec_* BDF_Property; 1.97 + 1.98 + 1.99 + /********************************************************************** 1.100 + * 1.101 + * @struct: 1.102 + * BDF_PropertyRec 1.103 + * 1.104 + * @description: 1.105 + * This structure models a given BDF/PCF property. 1.106 + * 1.107 + * @fields: 1.108 + * type :: 1.109 + * The property type. 1.110 + * 1.111 + * u.atom :: 1.112 + * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be 1.113 + * NULL, indicating an empty string. 1.114 + * 1.115 + * u.integer :: 1.116 + * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. 1.117 + * 1.118 + * u.cardinal :: 1.119 + * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. 1.120 + */ 1.121 + typedef struct BDF_PropertyRec_ 1.122 + { 1.123 + BDF_PropertyType type; 1.124 + union { 1.125 + const char* atom; 1.126 + FT_Int32 integer; 1.127 + FT_UInt32 cardinal; 1.128 + 1.129 + } u; 1.130 + 1.131 + } BDF_PropertyRec; 1.132 + 1.133 + 1.134 + /********************************************************************** 1.135 + * 1.136 + * @function: 1.137 + * FT_Get_BDF_Charset_ID 1.138 + * 1.139 + * @description: 1.140 + * Retrieve a BDF font character set identity, according to 1.141 + * the BDF specification. 1.142 + * 1.143 + * @input: 1.144 + * face :: 1.145 + * A handle to the input face. 1.146 + * 1.147 + * @output: 1.148 + * acharset_encoding :: 1.149 + * Charset encoding, as a C~string, owned by the face. 1.150 + * 1.151 + * acharset_registry :: 1.152 + * Charset registry, as a C~string, owned by the face. 1.153 + * 1.154 + * @return: 1.155 + * FreeType error code. 0~means success. 1.156 + * 1.157 + * @note: 1.158 + * This function only works with BDF faces, returning an error otherwise. 1.159 + */ 1.160 + FT_EXPORT( FT_Error ) 1.161 + FT_Get_BDF_Charset_ID( FT_Face face, 1.162 + const char* *acharset_encoding, 1.163 + const char* *acharset_registry ); 1.164 + 1.165 + 1.166 + /********************************************************************** 1.167 + * 1.168 + * @function: 1.169 + * FT_Get_BDF_Property 1.170 + * 1.171 + * @description: 1.172 + * Retrieve a BDF property from a BDF or PCF font file. 1.173 + * 1.174 + * @input: 1.175 + * face :: A handle to the input face. 1.176 + * 1.177 + * name :: The property name. 1.178 + * 1.179 + * @output: 1.180 + * aproperty :: The property. 1.181 + * 1.182 + * @return: 1.183 + * FreeType error code. 0~means success. 1.184 + * 1.185 + * @note: 1.186 + * This function works with BDF _and_ PCF fonts. It returns an error 1.187 + * otherwise. It also returns an error if the property is not in the 1.188 + * font. 1.189 + * 1.190 + * A `property' is a either key-value pair within the STARTPROPERTIES 1.191 + * ... ENDPROPERTIES block of a BDF font or a key-value pair from the 1.192 + * `info->props' array within a `FontRec' structure of a PCF font. 1.193 + * 1.194 + * Integer properties are always stored as `signed' within PCF fonts; 1.195 + * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value 1.196 + * for BDF fonts only. 1.197 + * 1.198 + * In case of error, `aproperty->type' is always set to 1.199 + * @BDF_PROPERTY_TYPE_NONE. 1.200 + */ 1.201 + FT_EXPORT( FT_Error ) 1.202 + FT_Get_BDF_Property( FT_Face face, 1.203 + const char* prop_name, 1.204 + BDF_PropertyRec *aproperty ); 1.205 + 1.206 + /* */ 1.207 + 1.208 +FT_END_HEADER 1.209 + 1.210 +#endif /* __FTBDF_H__ */ 1.211 + 1.212 + 1.213 +/* END */