ftbdf.h

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  ftbdf.h                                                                */
00004 /*                                                                         */
00005 /*    FreeType API for accessing BDF-specific strings (specification).     */
00006 /*                                                                         */
00007 /*  Copyright 2002, 2003, 2004, 2006, 2009 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 __FTBDF_H__
00020 #define __FTBDF_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   /*    bdf_fonts                                                          */
00039   /*                                                                       */
00040   /* <Title>                                                               */
00041   /*    BDF and PCF Files                                                  */
00042   /*                                                                       */
00043   /* <Abstract>                                                            */
00044   /*    BDF and PCF specific API.                                          */
00045   /*                                                                       */
00046   /* <Description>                                                         */
00047   /*    This section contains the declaration of functions specific to BDF */
00048   /*    and PCF fonts.                                                     */
00049   /*                                                                       */
00050   /*************************************************************************/
00051 
00052 
00053   /**********************************************************************
00054    *
00055    * @enum:
00056    *    FT_PropertyType
00057    *
00058    * @description:
00059    *    A list of BDF property types.
00060    *
00061    * @values:
00062    *    BDF_PROPERTY_TYPE_NONE ::
00063    *      Value~0 is used to indicate a missing property.
00064    *
00065    *    BDF_PROPERTY_TYPE_ATOM ::
00066    *      Property is a string atom.
00067    *
00068    *    BDF_PROPERTY_TYPE_INTEGER ::
00069    *      Property is a 32-bit signed integer.
00070    *
00071    *    BDF_PROPERTY_TYPE_CARDINAL ::
00072    *      Property is a 32-bit unsigned integer.
00073    */
00074   typedef enum  BDF_PropertyType_
00075   {
00076     BDF_PROPERTY_TYPE_NONE     = 0,
00077     BDF_PROPERTY_TYPE_ATOM     = 1,
00078     BDF_PROPERTY_TYPE_INTEGER  = 2,
00079     BDF_PROPERTY_TYPE_CARDINAL = 3
00080 
00081   } BDF_PropertyType;
00082 
00083 
00084   /**********************************************************************
00085    *
00086    * @type:
00087    *    BDF_Property
00088    *
00089    * @description:
00090    *    A handle to a @BDF_PropertyRec structure to model a given
00091    *    BDF/PCF property.
00092    */
00093   typedef struct BDF_PropertyRec_*  BDF_Property;
00094 
00095 
00096  /**********************************************************************
00097   *
00098   * @struct:
00099   *    BDF_PropertyRec
00100   *
00101   * @description:
00102   *    This structure models a given BDF/PCF property.
00103   *
00104   * @fields:
00105   *    type ::
00106   *      The property type.
00107   *
00108   *    u.atom ::
00109   *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
00110   *
00111   *    u.integer ::
00112   *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
00113   *
00114   *    u.cardinal ::
00115   *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
00116   */
00117   typedef struct  BDF_PropertyRec_
00118   {
00119     BDF_PropertyType  type;
00120     union {
00121       const char*     atom;
00122       FT_Int32        integer;
00123       FT_UInt32       cardinal;
00124 
00125     } u;
00126 
00127   } BDF_PropertyRec;
00128 
00129 
00130  /**********************************************************************
00131   *
00132   * @function:
00133   *    FT_Get_BDF_Charset_ID
00134   *
00135   * @description:
00136   *    Retrieve a BDF font character set identity, according to
00137   *    the BDF specification.
00138   *
00139   * @input:
00140   *    face ::
00141   *       A handle to the input face.
00142   *
00143   * @output:
00144   *    acharset_encoding ::
00145   *       Charset encoding, as a C~string, owned by the face.
00146   *
00147   *    acharset_registry ::
00148   *       Charset registry, as a C~string, owned by the face.
00149   *
00150   * @return:
00151   *   FreeType error code.  0~means success.
00152   *
00153   * @note:
00154   *   This function only works with BDF faces, returning an error otherwise.
00155   */
00156   FT_EXPORT( FT_Error )
00157   FT_Get_BDF_Charset_ID( FT_Face       face,
00158                          const char*  *acharset_encoding,
00159                          const char*  *acharset_registry );
00160 
00161 
00162  /**********************************************************************
00163   *
00164   * @function:
00165   *    FT_Get_BDF_Property
00166   *
00167   * @description:
00168   *    Retrieve a BDF property from a BDF or PCF font file.
00169   *
00170   * @input:
00171   *    face :: A handle to the input face.
00172   *
00173   *    name :: The property name.
00174   *
00175   * @output:
00176   *    aproperty :: The property.
00177   *
00178   * @return:
00179   *   FreeType error code.  0~means success.
00180   *
00181   * @note:
00182   *   This function works with BDF _and_ PCF fonts.  It returns an error
00183   *   otherwise.  It also returns an error if the property is not in the
00184   *   font.
00185   *
00186   *   A `property' is a either key-value pair within the STARTPROPERTIES
00187   *   ... ENDPROPERTIES block of a BDF font or a key-value pair from the
00188   *   `info->props' array within a `FontRec' structure of a PCF font.
00189   *
00190   *   Integer properties are always stored as `signed' within PCF fonts;
00191   *   consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
00192   *   for BDF fonts only.
00193   *
00194   *   In case of error, `aproperty->type' is always set to
00195   *   @BDF_PROPERTY_TYPE_NONE.
00196   */
00197   FT_EXPORT( FT_Error )
00198   FT_Get_BDF_Property( FT_Face           face,
00199                        const char*       prop_name,
00200                        BDF_PropertyRec  *aproperty );
00201 
00202  /* */
00203 
00204 FT_END_HEADER
00205 
00206 #endif /* __FTBDF_H__ */
00207 
00208 
00209 /* END */

Generated on Tue Jul 5 14:13:35 2011 for ROOT_528-00b_version by  doxygen 1.5.1