misc/libfreetype/src/sfnt/ttcmap.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
/*  ttcmap.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
/*    TrueType character mapping table (cmap) support (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, 2003, 2004, 2005 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 __TTCMAP_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#define __TTCMAP_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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
#include FT_INTERNAL_TRUETYPE_TYPES_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
#include FT_INTERNAL_VALIDATE_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#include FT_SERVICE_TT_CMAP_H
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
FT_BEGIN_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
#define TT_CMAP_FLAG_UNSORTED     1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
#define TT_CMAP_FLAG_OVERLAPPING  2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
  typedef struct  TT_CMapRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
    FT_CMapRec  cmap;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
    FT_Byte*    data;           /* pointer to in-memory cmap table */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
    FT_Int      flags;          /* for format 4 only               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
  } TT_CMapRec, *TT_CMap;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
  typedef const struct TT_CMap_ClassRec_*  TT_CMap_Class;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
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
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
  (*TT_CMap_ValidateFunc)( FT_Byte*      data,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
                           FT_Validator  valid );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
  typedef struct  TT_CMap_ClassRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
    FT_CMap_ClassRec      clazz;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
    FT_UInt               format;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
    TT_CMap_ValidateFunc  validate;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
    TT_CMap_Info_GetFunc  get_cmap_info;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
  } TT_CMap_ClassRec;
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
#ifndef FT_CONFIG_OPTION_PIC
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
#define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_,          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
    char_next_, char_var_index_, char_var_default_, variant_list_,           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
    charvariant_list_,variantchar_list_,                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
    format_, validate_, get_cmap_info_)                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
  FT_CALLBACK_TABLE_DEF                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
  const TT_CMap_ClassRec class_ =                                            \
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
    {size_, init_, done_, char_index_,                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
     char_next_, char_var_index_, char_var_default_, variant_list_,          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
     charvariant_list_, variantchar_list_},                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
    format_, validate_, get_cmap_info_                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
  };
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
#else /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
#define FT_DEFINE_TT_CMAP(class_, size_, init_, done_, char_index_,          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
    char_next_, char_var_index_, char_var_default_, variant_list_,           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
    charvariant_list_,variantchar_list_,                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
    format_, validate_, get_cmap_info_)                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
  void                                                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
  FT_Init_Class_##class_( TT_CMap_ClassRec*  clazz )                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
    clazz->clazz.size = size_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
    clazz->clazz.init = init_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
    clazz->clazz.done = done_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
    clazz->clazz.char_index = char_index_;                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
    clazz->clazz.char_next = char_next_;                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
    clazz->clazz.char_var_index = char_var_index_;                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
    clazz->clazz.char_var_default = char_var_default_;                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
    clazz->clazz.variant_list = variant_list_;                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
    clazz->clazz.charvariant_list = charvariant_list_;                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
    clazz->clazz.variantchar_list = variantchar_list_;                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
    clazz->format = format_;                                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
    clazz->validate = validate_;                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
    clazz->get_cmap_info = get_cmap_info_;                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
  } 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
#endif /* FT_CONFIG_OPTION_PIC */ 
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
  typedef struct  TT_ValidatorRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
    FT_ValidatorRec  validator;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
    FT_UInt          num_glyphs;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
  } TT_ValidatorRec, *TT_Validator;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
#define TT_VALIDATOR( x )          ((TT_Validator)( x ))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
#define TT_VALID_GLYPH_COUNT( x )  TT_VALIDATOR( x )->num_glyphs
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
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
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
  tt_face_build_cmaps( TT_Face  face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
  /* used in tt-cmaps service */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
  tt_get_cmap_info( FT_CharMap    charmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
                    TT_CMapInfo  *cmap_info );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
FT_END_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
#endif /* __TTCMAP_H__ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
/* END */