Blame include/freetype/ftbdf.h

Packit cf904d
/***************************************************************************/
Packit cf904d
/*                                                                         */
Packit cf904d
/*  ftbdf.h                                                                */
Packit cf904d
/*                                                                         */
Packit cf904d
/*    FreeType API for accessing BDF-specific strings (specification).     */
Packit cf904d
/*                                                                         */
Packit cf904d
/*  Copyright 2002-2017 by                                                 */
Packit cf904d
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
Packit cf904d
/*                                                                         */
Packit cf904d
/*  This file is part of the FreeType project, and may only be used,       */
Packit cf904d
/*  modified, and distributed under the terms of the FreeType project      */
Packit cf904d
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
Packit cf904d
/*  this file you indicate that you have read the license and              */
Packit cf904d
/*  understand and accept it fully.                                        */
Packit cf904d
/*                                                                         */
Packit cf904d
/***************************************************************************/
Packit cf904d
Packit cf904d
Packit cf904d
#ifndef FTBDF_H_
Packit cf904d
#define FTBDF_H_
Packit cf904d
Packit cf904d
#include <ft2build.h>
Packit cf904d
#include FT_FREETYPE_H
Packit cf904d
Packit cf904d
#ifdef FREETYPE_H
Packit cf904d
#error "freetype.h of FreeType 1 has been loaded!"
Packit cf904d
#error "Please fix the directory search order for header files"
Packit cf904d
#error "so that freetype.h of FreeType 2 is found first."
Packit cf904d
#endif
Packit cf904d
Packit cf904d
Packit cf904d
FT_BEGIN_HEADER
Packit cf904d
Packit cf904d
Packit cf904d
  /*************************************************************************/
Packit cf904d
  /*                                                                       */
Packit cf904d
  /* <Section>                                                             */
Packit cf904d
  /*    bdf_fonts                                                          */
Packit cf904d
  /*                                                                       */
Packit cf904d
  /* <Title>                                                               */
Packit cf904d
  /*    BDF and PCF Files                                                  */
Packit cf904d
  /*                                                                       */
Packit cf904d
  /* <Abstract>                                                            */
Packit cf904d
  /*    BDF and PCF specific API.                                          */
Packit cf904d
  /*                                                                       */
Packit cf904d
  /* <Description>                                                         */
Packit cf904d
  /*    This section contains the declaration of functions specific to BDF */
Packit cf904d
  /*    and PCF fonts.                                                     */
Packit cf904d
  /*                                                                       */
Packit cf904d
  /*************************************************************************/
Packit cf904d
Packit cf904d
Packit cf904d
  /**********************************************************************
Packit cf904d
   *
Packit cf904d
   * @enum:
Packit cf904d
   *    BDF_PropertyType
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *    A list of BDF property types.
Packit cf904d
   *
Packit cf904d
   * @values:
Packit cf904d
   *    BDF_PROPERTY_TYPE_NONE ::
Packit cf904d
   *      Value~0 is used to indicate a missing property.
Packit cf904d
   *
Packit cf904d
   *    BDF_PROPERTY_TYPE_ATOM ::
Packit cf904d
   *      Property is a string atom.
Packit cf904d
   *
Packit cf904d
   *    BDF_PROPERTY_TYPE_INTEGER ::
Packit cf904d
   *      Property is a 32-bit signed integer.
Packit cf904d
   *
Packit cf904d
   *    BDF_PROPERTY_TYPE_CARDINAL ::
Packit cf904d
   *      Property is a 32-bit unsigned integer.
Packit cf904d
   */
Packit cf904d
  typedef enum  BDF_PropertyType_
Packit cf904d
  {
Packit cf904d
    BDF_PROPERTY_TYPE_NONE     = 0,
Packit cf904d
    BDF_PROPERTY_TYPE_ATOM     = 1,
Packit cf904d
    BDF_PROPERTY_TYPE_INTEGER  = 2,
Packit cf904d
    BDF_PROPERTY_TYPE_CARDINAL = 3
Packit cf904d
Packit cf904d
  } BDF_PropertyType;
Packit cf904d
Packit cf904d
Packit cf904d
  /**********************************************************************
Packit cf904d
   *
Packit cf904d
   * @type:
Packit cf904d
   *    BDF_Property
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *    A handle to a @BDF_PropertyRec structure to model a given
Packit cf904d
   *    BDF/PCF property.
Packit cf904d
   */
Packit cf904d
  typedef struct BDF_PropertyRec_*  BDF_Property;
Packit cf904d
Packit cf904d
Packit cf904d
 /**********************************************************************
Packit cf904d
  *
Packit cf904d
  * @struct:
Packit cf904d
  *    BDF_PropertyRec
Packit cf904d
  *
Packit cf904d
  * @description:
Packit cf904d
  *    This structure models a given BDF/PCF property.
Packit cf904d
  *
Packit cf904d
  * @fields:
Packit cf904d
  *    type ::
Packit cf904d
  *      The property type.
Packit cf904d
  *
Packit cf904d
  *    u.atom ::
Packit cf904d
  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.  May be
Packit cf904d
  *      NULL, indicating an empty string.
Packit cf904d
  *
Packit cf904d
  *    u.integer ::
Packit cf904d
  *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
Packit cf904d
  *
Packit cf904d
  *    u.cardinal ::
Packit cf904d
  *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
Packit cf904d
  */
Packit cf904d
  typedef struct  BDF_PropertyRec_
Packit cf904d
  {
Packit cf904d
    BDF_PropertyType  type;
Packit cf904d
    union {
Packit cf904d
      const char*     atom;
Packit cf904d
      FT_Int32        integer;
Packit cf904d
      FT_UInt32       cardinal;
Packit cf904d
Packit cf904d
    } u;
Packit cf904d
Packit cf904d
  } BDF_PropertyRec;
Packit cf904d
Packit cf904d
Packit cf904d
 /**********************************************************************
Packit cf904d
  *
Packit cf904d
  * @function:
Packit cf904d
  *    FT_Get_BDF_Charset_ID
Packit cf904d
  *
Packit cf904d
  * @description:
Packit cf904d
  *    Retrieve a BDF font character set identity, according to
Packit cf904d
  *    the BDF specification.
Packit cf904d
  *
Packit cf904d
  * @input:
Packit cf904d
  *    face ::
Packit cf904d
  *       A handle to the input face.
Packit cf904d
  *
Packit cf904d
  * @output:
Packit cf904d
  *    acharset_encoding ::
Packit cf904d
  *       Charset encoding, as a C~string, owned by the face.
Packit cf904d
  *
Packit cf904d
  *    acharset_registry ::
Packit cf904d
  *       Charset registry, as a C~string, owned by the face.
Packit cf904d
  *
Packit cf904d
  * @return:
Packit cf904d
  *   FreeType error code.  0~means success.
Packit cf904d
  *
Packit cf904d
  * @note:
Packit cf904d
  *   This function only works with BDF faces, returning an error otherwise.
Packit cf904d
  */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Get_BDF_Charset_ID( FT_Face       face,
Packit cf904d
                         const char*  *acharset_encoding,
Packit cf904d
                         const char*  *acharset_registry );
Packit cf904d
Packit cf904d
Packit cf904d
 /**********************************************************************
Packit cf904d
  *
Packit cf904d
  * @function:
Packit cf904d
  *    FT_Get_BDF_Property
Packit cf904d
  *
Packit cf904d
  * @description:
Packit cf904d
  *    Retrieve a BDF property from a BDF or PCF font file.
Packit cf904d
  *
Packit cf904d
  * @input:
Packit cf904d
  *    face :: A handle to the input face.
Packit cf904d
  *
Packit cf904d
  *    name :: The property name.
Packit cf904d
  *
Packit cf904d
  * @output:
Packit cf904d
  *    aproperty :: The property.
Packit cf904d
  *
Packit cf904d
  * @return:
Packit cf904d
  *   FreeType error code.  0~means success.
Packit cf904d
  *
Packit cf904d
  * @note:
Packit cf904d
  *   This function works with BDF _and_ PCF fonts.  It returns an error
Packit cf904d
  *   otherwise.  It also returns an error if the property is not in the
Packit cf904d
  *   font.
Packit cf904d
  *
Packit cf904d
  *   A `property' is a either key-value pair within the STARTPROPERTIES
Packit cf904d
  *   ... ENDPROPERTIES block of a BDF font or a key-value pair from the
Packit cf904d
  *   `info->props' array within a `FontRec' structure of a PCF font.
Packit cf904d
  *
Packit cf904d
  *   Integer properties are always stored as `signed' within PCF fonts;
Packit cf904d
  *   consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
Packit cf904d
  *   for BDF fonts only.
Packit cf904d
  *
Packit cf904d
  *   In case of error, `aproperty->type' is always set to
Packit cf904d
  *   @BDF_PROPERTY_TYPE_NONE.
Packit cf904d
  */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Get_BDF_Property( FT_Face           face,
Packit cf904d
                       const char*       prop_name,
Packit cf904d
                       BDF_PropertyRec  *aproperty );
Packit cf904d
Packit cf904d
  /* */
Packit cf904d
Packit cf904d
FT_END_HEADER
Packit cf904d
Packit cf904d
#endif /* FTBDF_H_ */
Packit cf904d
Packit cf904d
Packit cf904d
/* END */