michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* ftbdf.h */ michael@0: /* */ michael@0: /* FreeType API for accessing BDF-specific strings (specification). */ michael@0: /* */ michael@0: /* Copyright 2002-2004, 2006, 2009, 2014 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 __FTBDF_H__ michael@0: #define __FTBDF_H__ 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: /* bdf_fonts */ michael@0: /* */ michael@0: /* */ michael@0: /* BDF and PCF Files */ michael@0: /* */ michael@0: /* <Abstract> */ michael@0: /* BDF and PCF specific API. */ michael@0: /* */ michael@0: /* <Description> */ michael@0: /* This section contains the declaration of functions specific to BDF */ michael@0: /* and PCF fonts. */ michael@0: /* */ michael@0: /*************************************************************************/ michael@0: michael@0: michael@0: /********************************************************************** michael@0: * michael@0: * @enum: michael@0: * FT_PropertyType michael@0: * michael@0: * @description: michael@0: * A list of BDF property types. michael@0: * michael@0: * @values: michael@0: * BDF_PROPERTY_TYPE_NONE :: michael@0: * Value~0 is used to indicate a missing property. michael@0: * michael@0: * BDF_PROPERTY_TYPE_ATOM :: michael@0: * Property is a string atom. michael@0: * michael@0: * BDF_PROPERTY_TYPE_INTEGER :: michael@0: * Property is a 32-bit signed integer. michael@0: * michael@0: * BDF_PROPERTY_TYPE_CARDINAL :: michael@0: * Property is a 32-bit unsigned integer. michael@0: */ michael@0: typedef enum BDF_PropertyType_ michael@0: { michael@0: BDF_PROPERTY_TYPE_NONE = 0, michael@0: BDF_PROPERTY_TYPE_ATOM = 1, michael@0: BDF_PROPERTY_TYPE_INTEGER = 2, michael@0: BDF_PROPERTY_TYPE_CARDINAL = 3 michael@0: michael@0: } BDF_PropertyType; michael@0: michael@0: michael@0: /********************************************************************** michael@0: * michael@0: * @type: michael@0: * BDF_Property michael@0: * michael@0: * @description: michael@0: * A handle to a @BDF_PropertyRec structure to model a given michael@0: * BDF/PCF property. michael@0: */ michael@0: typedef struct BDF_PropertyRec_* BDF_Property; michael@0: michael@0: michael@0: /********************************************************************** michael@0: * michael@0: * @struct: michael@0: * BDF_PropertyRec michael@0: * michael@0: * @description: michael@0: * This structure models a given BDF/PCF property. michael@0: * michael@0: * @fields: michael@0: * type :: michael@0: * The property type. michael@0: * michael@0: * u.atom :: michael@0: * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be michael@0: * NULL, indicating an empty string. michael@0: * michael@0: * u.integer :: michael@0: * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. michael@0: * michael@0: * u.cardinal :: michael@0: * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. michael@0: */ michael@0: typedef struct BDF_PropertyRec_ michael@0: { michael@0: BDF_PropertyType type; michael@0: union { michael@0: const char* atom; michael@0: FT_Int32 integer; michael@0: FT_UInt32 cardinal; michael@0: michael@0: } u; michael@0: michael@0: } BDF_PropertyRec; michael@0: michael@0: michael@0: /********************************************************************** michael@0: * michael@0: * @function: michael@0: * FT_Get_BDF_Charset_ID michael@0: * michael@0: * @description: michael@0: * Retrieve a BDF font character set identity, according to michael@0: * the BDF specification. michael@0: * michael@0: * @input: michael@0: * face :: michael@0: * A handle to the input face. michael@0: * michael@0: * @output: michael@0: * acharset_encoding :: michael@0: * Charset encoding, as a C~string, owned by the face. michael@0: * michael@0: * acharset_registry :: michael@0: * Charset registry, as a C~string, owned by the face. michael@0: * michael@0: * @return: michael@0: * FreeType error code. 0~means success. michael@0: * michael@0: * @note: michael@0: * This function only works with BDF faces, returning an error otherwise. michael@0: */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Get_BDF_Charset_ID( FT_Face face, michael@0: const char* *acharset_encoding, michael@0: const char* *acharset_registry ); michael@0: michael@0: michael@0: /********************************************************************** michael@0: * michael@0: * @function: michael@0: * FT_Get_BDF_Property michael@0: * michael@0: * @description: michael@0: * Retrieve a BDF property from a BDF or PCF font file. michael@0: * michael@0: * @input: michael@0: * face :: A handle to the input face. michael@0: * michael@0: * name :: The property name. michael@0: * michael@0: * @output: michael@0: * aproperty :: The property. michael@0: * michael@0: * @return: michael@0: * FreeType error code. 0~means success. michael@0: * michael@0: * @note: michael@0: * This function works with BDF _and_ PCF fonts. It returns an error michael@0: * otherwise. It also returns an error if the property is not in the michael@0: * font. michael@0: * michael@0: * A `property' is a either key-value pair within the STARTPROPERTIES michael@0: * ... ENDPROPERTIES block of a BDF font or a key-value pair from the michael@0: * `info->props' array within a `FontRec' structure of a PCF font. michael@0: * michael@0: * Integer properties are always stored as `signed' within PCF fonts; michael@0: * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value michael@0: * for BDF fonts only. michael@0: * michael@0: * In case of error, `aproperty->type' is always set to michael@0: * @BDF_PROPERTY_TYPE_NONE. michael@0: */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Get_BDF_Property( FT_Face face, michael@0: const char* prop_name, michael@0: BDF_PropertyRec *aproperty ); michael@0: michael@0: /* */ michael@0: michael@0: FT_END_HEADER michael@0: michael@0: #endif /* __FTBDF_H__ */ michael@0: michael@0: michael@0: /* END */