godot/thirdparty/freetype/src/bdf/bdflib.c

/*
 * Copyright 2000 Computing Research Labs, New Mexico State University
 * Copyright 2001-2014
 *   Francesco Zappa Nardelli
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
 * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

  /**************************************************************************
   *
   * This file is based on bdf.c,v 1.22 2000/03/16 20:08:50
   *
   * taken from Mark Leisher's xmbdfed package
   *
   */



#include <freetype/freetype.h>
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#include <freetype/internal/ftobjs.h>

#include "bdf.h"
#include "bdferror.h"


  /**************************************************************************
   *
   * The macro FT_COMPONENT is used in trace mode.  It is an implicit
   * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
   * messages during execution.
   */
#undef  FT_COMPONENT
#define FT_COMPONENT


#define BUFSIZE


  /**************************************************************************
   *
   * Default BDF font options.
   *
   */


  static const bdf_options_t  bdf_opts_ =;


  /**************************************************************************
   *
   * Builtin BDF font properties.
   *
   */

  /* List of most properties that might appear in a font.  Doesn't include */
  /* the RAW_* and AXIS_* properties in X11R6 polymorphic fonts.           */

  static const bdf_property_t  bdf_properties_[] =;

  static const unsigned long
  num_bdf_properties_ =;


  /* An auxiliary macro to parse properties, to be used in conditionals. */
  /* It behaves like `strncmp' but also tests the following character    */
  /* whether it is a whitespace or null.                                 */
  /* `property' is a constant string of length `n' to compare with.      */
#define _bdf_strncmp( name, property, n )

  /* Auto correction messages. */
#define ACMSG1
#define ACMSG2
#define ACMSG3
#define ACMSG4
#define ACMSG5
#define ACMSG6
#define ACMSG7
#define ACMSG8
#define ACMSG9
#define ACMSG10
#define ACMSG11
#define ACMSG13
#define ACMSG14
#define ACMSG15
#define ACMSG16
#define ACMSG17

  /* Error messages. */
#define ERRMSG1
#define ERRMSG2
#define ERRMSG3
#define ERRMSG4
#define ERRMSG5
#define ERRMSG6
#define ERRMSG7
#define ERRMSG8
#define ERRMSG9

  /* Debug messages. */
#define DBGMSG1
#define DBGMSG2


  /**************************************************************************
   *
   * Utility types and functions.
   *
   */


  /* Function type for parsing lines of a BDF font. */

  bdf_line_func_t_;


  /* List structure for splitting lines into fields. */

  bdf_list_t_;


  /* Structure used while loading BDF fonts. */

  bdf_parse_t_;


#define setsbit( m, cc )
#define sbitset( m, cc )


  static void
  bdf_list_init_( bdf_list_t_*  list,
                  FT_Memory     memory )
  {}


  static void
  bdf_list_done_( bdf_list_t_*  list )
  {}


  static FT_Error
  bdf_list_ensure_( bdf_list_t_*   list,
                    unsigned long  num_items ) /* same as bdf_list_t_.used */
  {}


  static void
  bdf_list_shift_( bdf_list_t_*   list,
                   unsigned long  n )
  {}


  /* An empty string for empty fields. */

  static const char  empty[] =;      /* XXX eliminate this */


  static char *
  bdf_list_join_( bdf_list_t_*    list,
                  int             c,
                  unsigned long  *alen )
  {}


  /* The code below ensures that we have at least 4 + 1 `field' */
  /* elements in `list' (which are possibly NULL) so that we    */
  /* don't have to check the number of fields in most cases.    */

  static FT_Error
  bdf_list_split_( bdf_list_t_*   list,
                   const char*    separators,
                   char*          line,
                   unsigned long  linelen )
  {}


#define NO_SKIP


  static FT_Error
  bdf_readstream_( FT_Stream         stream,
                   bdf_line_func_t_  callback,
                   void*             client_data,
                   unsigned long    *lno )
  {}


  /* XXX: make this work with EBCDIC also */

  static const unsigned char  a2i[128] =;

  static const unsigned char  ddigits[32] =;

  static const unsigned char  hdigits[32] =;


  /* Routine to convert a decimal ASCII string to an unsigned long integer. */
  static unsigned long
  bdf_atoul_( const char*  s )
  {}


  /* Routine to convert a decimal ASCII string to a signed long integer. */
  static long
  bdf_atol_( const char*  s )
  {}


  /* Routine to convert a decimal ASCII string to an unsigned short integer. */
  static unsigned short
  bdf_atous_( const char*  s )
  {}


  /* Routine to convert a decimal ASCII string to a signed short integer. */
  static short
  bdf_atos_( const char*  s )
  {}


  /* Routine to compare two glyphs by encoding so they can be sorted. */
  FT_COMPARE_DEF( int )
  by_encoding( const void*  a,
               const void*  b )
  {}


  static FT_Error
  bdf_create_property( const char*  name,
                       int          format,
                       bdf_font_t*  font )
  {}


  static bdf_property_t*
  bdf_get_property( const char*  name,
                    bdf_font_t*  font )
  {}


  /**************************************************************************
   *
   * BDF font file parsing flags and functions.
   *
   */


  /* Parse flags. */

#define BDF_START_
#define BDF_FONT_NAME_
#define BDF_SIZE_
#define BDF_FONT_BBX_
#define BDF_PROPS_
#define BDF_GLYPHS_
#define BDF_GLYPH_
#define BDF_ENCODING_
#define BDF_SWIDTH_
#define BDF_DWIDTH_
#define BDF_BBX_
#define BDF_BITMAP_

#define BDF_SWIDTH_ADJ_

#define BDF_GLYPH_BITS_

#define BDF_GLYPH_WIDTH_CHECK_
#define BDF_GLYPH_HEIGHT_CHECK_


  static FT_Error
  bdf_add_comment_( bdf_font_t*    font,
                    const char*    comment,
                    unsigned long  len )
  {}


  /* Set the spacing from the font name if it exists, or set it to the */
  /* default specified in the options.                                 */
  static FT_Error
  bdf_set_default_spacing_( bdf_font_t*     font,
                            bdf_options_t*  opts,
                            unsigned long   lineno )
  {}


  /* Determine whether the property is an atom or not.  If it is, then */
  /* clean it up so the double quotes are removed if they exist.       */
  static int
  bdf_is_atom_( char*          line,
                unsigned long  linelen,
                char**         name,
                char**         value,
                bdf_font_t*    font )
  {}


  static FT_Error
  bdf_add_property_( bdf_font_t*    font,
                     const char*    name,
                     char*          value,
                     unsigned long  lineno )
  {}


  static const unsigned char nibble_mask[8] =;


  static FT_Error
  bdf_parse_end_( char*          line,
                  unsigned long  linelen,
                  unsigned long  lineno,
                  void*          call_data,
                  void*          client_data )
  {}


  /* Actually parse the glyph info and bitmaps. */
  static FT_Error
  bdf_parse_glyphs_( char*          line,
                     unsigned long  linelen,
                     unsigned long  lineno,
                     void*          call_data,
                     void*          client_data )
  {}


  /* Load the font properties. */
  static FT_Error
  bdf_parse_properties_( char*          line,
                         unsigned long  linelen,
                         unsigned long  lineno,
                         void*          call_data,
                         void*          client_data )
  {}


  /* Load the font header. */
  static FT_Error
  bdf_parse_start_( char*          line,
                    unsigned long  linelen,
                    unsigned long  lineno,
                    void*          call_data,
                    void*          client_data )
  {}


  /**************************************************************************
   *
   * API.
   *
   */


  FT_LOCAL_DEF( FT_Error )
  bdf_load_font( FT_Stream       stream,
                 FT_Memory       memory,
                 bdf_options_t*  opts,
                 bdf_font_t*    *font )
  {}


  FT_LOCAL_DEF( void )
  bdf_free_font( bdf_font_t*  font )
  {}


  FT_LOCAL_DEF( bdf_property_t * )
  bdf_get_font_property( bdf_font_t*  font,
                         const char*  name )
  {}


/* END */