misc/libfreetype/src/pfr/pfrload.h
author sheepluva
Thu, 03 May 2012 14:21:53 +0200
changeset 7017 19a434fc91fc
parent 5172 88f2e05288ba
permissions -rw-r--r--
visually indicate when map preview generation is in progress.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
/*  pfrload.h                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
/*    FreeType PFR loader (specification).                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*  Copyright 2002 by                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
#ifndef __PFRLOAD_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#define __PFRLOAD_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
#include "pfrobjs.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
#include FT_INTERNAL_STREAM_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
FT_BEGIN_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
#ifdef PFR_CONFIG_NO_CHECKS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
#define PFR_CHECK( x )  do { } while ( 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
#define PFR_CHECK( x )  do                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
                        {                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
                          if ( p + (x) > limit ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
                            goto Too_Short;      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
                        } while ( 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
#define PFR_NEXT_BYTE( p )    FT_NEXT_BYTE( p )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
#define PFR_NEXT_INT8( p )    FT_NEXT_CHAR( p )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
#define PFR_NEXT_SHORT( p )   FT_NEXT_SHORT( p )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
#define PFR_NEXT_USHORT( p )  FT_NEXT_USHORT( p )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
#define PFR_NEXT_LONG( p )    FT_NEXT_OFF3( p )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
#define PFR_NEXT_ULONG( p )   FT_NEXT_UOFF3( p )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
 /* handling extra items */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
  (*PFR_ExtraItem_ParseFunc)( FT_Byte*    p,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
                              FT_Byte*    limit,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
                              FT_Pointer  data );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
  typedef struct  PFR_ExtraItemRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
    FT_UInt                  type;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
    PFR_ExtraItem_ParseFunc  parser;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
  } PFR_ExtraItemRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
  typedef const struct PFR_ExtraItemRec_*  PFR_ExtraItem;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
  pfr_extra_items_skip( FT_Byte*  *pp,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
                        FT_Byte*  limit );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
  pfr_extra_items_parse( FT_Byte*      *pp,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
                         FT_Byte*       limit,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
                         PFR_ExtraItem  item_list,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
                         FT_Pointer     item_data );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
  /* load a PFR header */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
  pfr_header_load( PFR_Header  header,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
                   FT_Stream   stream );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
  /* check a PFR header */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
  FT_LOCAL( FT_Bool )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
  pfr_header_check( PFR_Header  header );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
  /* return number of logical fonts in this file */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
  pfr_log_font_count( FT_Stream   stream,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
                      FT_UInt32   log_section_offset,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
                      FT_UInt    *acount );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
  /* load a pfr logical font entry */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
  pfr_log_font_load( PFR_LogFont  log_font,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
                     FT_Stream    stream,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
                     FT_UInt      face_index,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
                     FT_UInt32    section_offset,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
                     FT_Bool      size_increment );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
  /* load a physical font entry */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
  pfr_phy_font_load( PFR_PhyFont  phy_font,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
                     FT_Stream    stream,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
                     FT_UInt32    offset,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
                     FT_UInt32    size );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
  /* finalize a physical font */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
  FT_LOCAL( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
  pfr_phy_font_done( PFR_PhyFont  phy_font,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
                     FT_Memory    memory );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
  /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
FT_END_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
#endif /* __PFRLOAD_H__ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
/* END */