misc/libfreetype/include/freetype/ftcache.h
author koda
Mon, 25 Apr 2011 01:46:54 +0200
changeset 5172 88f2e05288ba
permissions -rw-r--r--
aaand let's add freetype as well while we are at it other smaller changes
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
/*  ftcache.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 Cache subsystem (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 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 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 __FTCACHE_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#define __FTCACHE_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_GLYPH_H
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
FT_BEGIN_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
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
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
   * <Section>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
   *    cache_subsystem
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
   * <Title>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
   *    Cache Sub-System
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
   * <Abstract>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
   *    How to cache face, size, and glyph data with FreeType~2.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
   * <Description>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
   *   This section describes the FreeType~2 cache sub-system, which is used
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
   *   to limit the number of concurrently opened @FT_Face and @FT_Size
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
   *   objects, as well as caching information like character maps and glyph
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
   *   images while limiting their maximum memory usage.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
   *   Note that all types and functions begin with the `FTC_' prefix.
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
   *   The cache is highly portable and thus doesn't know anything about the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
   *   fonts installed on your system, or how to access them.  This implies
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
   *   the following scheme:
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
   *   First, available or installed font faces are uniquely identified by
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
   *   @FTC_FaceID values, provided to the cache by the client.  Note that
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
   *   the cache only stores and compares these values, and doesn't try to
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
   *   interpret them in any way.
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
   *   Second, the cache calls, only when needed, a client-provided function
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
   *   to convert an @FTC_FaceID into a new @FT_Face object.  The latter is
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
   *   then completely managed by the cache, including its termination
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
   *   through @FT_Done_Face.  To monitor termination of face objects, the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
   *   finalizer callback in the `generic' field of the @FT_Face object can
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
   *   be used, which might also be used to store the @FTC_FaceID of the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
   *   face.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
   *   Clients are free to map face IDs to anything else.  The most simple
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
   *   usage is to associate them to a (pathname,face_index) pair that is
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
   *   used to call @FT_New_Face.  However, more complex schemes are also
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
   *   possible.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
   *   Note that for the cache to work correctly, the face ID values must be
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
   *   *persistent*, which means that the contents they point to should not
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
   *   change at runtime, or that their value should not become invalid.
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
   *   If this is unavoidable (e.g., when a font is uninstalled at runtime),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
   *   you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
   *   the cache get rid of any references to the old @FTC_FaceID it may
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
   *   keep internally.  Failure to do so will lead to incorrect behaviour
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
   *   or even crashes.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
   *   To use the cache, start with calling @FTC_Manager_New to create a new
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
   *   @FTC_Manager object, which models a single cache instance.  You can
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
   *   then look up @FT_Face and @FT_Size objects with
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
   *   @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
   *   If you want to use the charmap caching, call @FTC_CMapCache_New, then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
   *   later use @FTC_CMapCache_Lookup to perform the equivalent of
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
   *   @FT_Get_Char_Index, only much faster.
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
   *   If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
   *   later use @FTC_ImageCache_Lookup to retrieve the corresponding
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
   *   @FT_Glyph objects from the cache.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
   *   If you need lots of small bitmaps, it is much more memory efficient
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
   *   to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup.  This
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
   *   returns @FTC_SBitRec structures, which are used to store small
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
   *   bitmaps directly.  (A small bitmap is one whose metrics and
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
   *   dimensions all fit into 8-bit integers).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
   *   We hope to also provide a kerning cache in the near future.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
   * <Order>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
   *   FTC_Manager
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
   *   FTC_FaceID
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
   *   FTC_Face_Requester
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
   *   FTC_Manager_New
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
   *   FTC_Manager_Reset
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
   *   FTC_Manager_Done
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
   *   FTC_Manager_LookupFace
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
   *   FTC_Manager_LookupSize
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
   *   FTC_Manager_RemoveFaceID
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
   *   FTC_Node
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
   *   FTC_Node_Unref
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
   *   FTC_ImageCache
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
   *   FTC_ImageCache_New
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
   *   FTC_ImageCache_Lookup
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
   *   FTC_SBit
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
   *   FTC_SBitCache
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
   *   FTC_SBitCache_New
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
   *   FTC_SBitCache_Lookup
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
   *   FTC_CMapCache
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
   *   FTC_CMapCache_New
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
   *   FTC_CMapCache_Lookup
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
   *************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
  /*****                    BASIC TYPE DEFINITIONS                     *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   139
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
   * @type: FTC_FaceID
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
   *   An opaque pointer type that is used to identity face objects.  The
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
   *   contents of such objects is application-dependent.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
   *   These pointers are typically used to point to a user-defined
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
   *   structure containing a font file path, and face index.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
   *   Never use NULL as a valid @FTC_FaceID.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
   *   Face IDs are passed by the client to the cache manager, which calls,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
   *   when needed, the @FTC_Face_Requester to translate them into new
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
   *   @FT_Face objects.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
   *   If the content of a given face ID changes at runtime, or if the value
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
   *   becomes invalid (e.g., when uninstalling a font), you should
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
   *   immediately call @FTC_Manager_RemoveFaceID before any other cache
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
   *   function.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
   *   Failure to do so will result in incorrect behaviour or even
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
   *   memory leaks and crashes.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
  typedef FT_Pointer  FTC_FaceID;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
  /************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
   * @functype:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
   *   FTC_Face_Requester
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
   *   A callback function provided by client applications.  It is used by
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
   *   the cache manager to translate a given @FTC_FaceID into a new valid
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
   *   @FT_Face object, on demand.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
   * <Input>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
   *   face_id ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
   *     The face ID to resolve.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
   *   library ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
   *     A handle to a FreeType library object.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
   *   req_data ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
   *     Application-provided request data (see note below).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
   * <Output>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
   *   aface ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
   *     A new @FT_Face handle.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
   * <Return>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
   *   FreeType error code.  0~means success.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
   * <Note>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
   *   The third parameter `req_data' is the same as the one passed by the
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
   *   client when @FTC_Manager_New is called.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
   *   The face requester should not perform funny things on the returned
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
   *   face object, like creating a new @FT_Size for it, or setting a
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
   *   transformation through @FT_Set_Transform!
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
  (*FTC_Face_Requester)( FTC_FaceID  face_id,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
                         FT_Library  library,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
                         FT_Pointer  request_data,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
                         FT_Face*    aface );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
 /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   218
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   219
  /* these macros are incompatible with LLP64, should not be used */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   220
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   221
#define FT_POINTER_TO_ULONG( p )  ( (FT_ULong)(FT_Pointer)(p) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   222
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   223
#define FTC_FACE_ID_HASH( i )                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   224
          ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
                       ( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   227
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   228
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   232
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   233
  /*****                      CACHE MANAGER OBJECT                     *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   234
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   236
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   237
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   240
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   241
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
  /* <Type>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   243
  /*    FTC_Manager                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   244
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
  /*    This object corresponds to one instance of the cache-subsystem.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
  /*    It is used to cache one or more @FT_Face objects, along with       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
  /*    corresponding @FT_Size objects.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   249
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   250
  /*    The manager intentionally limits the total number of opened        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
  /*    @FT_Face and @FT_Size objects to control memory usage.  See the    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   252
  /*    `max_faces' and `max_sizes' parameters of @FTC_Manager_New.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   253
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   254
  /*    The manager is also used to cache `nodes' of various types while   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   255
  /*    limiting their total memory usage.                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   256
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
  /*    All limitations are enforced by keeping lists of managed objects   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   258
  /*    in most-recently-used order, and flushing old nodes to make room   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   259
  /*    for new ones.                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   260
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   261
  typedef struct FTC_ManagerRec_*  FTC_Manager;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   262
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   263
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   264
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
  /* <Type>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
  /*    FTC_Node                                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   268
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   269
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
  /*    An opaque handle to a cache node object.  Each cache node is       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
  /*    reference-counted.  A node with a count of~0 might be flushed      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   272
  /*    out of a full cache whenever a lookup request is performed.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   273
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   274
  /*    If you look up nodes, you have the ability to `acquire' them,      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   275
  /*    i.e., to increment their reference count.  This will prevent the   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   276
  /*    node from being flushed out of the cache until you explicitly      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   277
  /*    `release' it (see @FTC_Node_Unref).                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
  /*    See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup.         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   280
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   281
  typedef struct FTC_NodeRec_*  FTC_Node;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   282
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   283
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   284
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   285
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   286
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   287
  /*    FTC_Manager_New                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   288
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   289
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   290
  /*    Create a new cache manager.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   291
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   292
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   293
  /*    library   :: The parent FreeType library handle to use.            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   294
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   295
  /*    max_faces :: Maximum number of opened @FT_Face objects managed by  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   296
  /*                 this cache instance.  Use~0 for defaults.             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   297
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   298
  /*    max_sizes :: Maximum number of opened @FT_Size objects managed by  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   299
  /*                 this cache instance.  Use~0 for defaults.             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   300
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   301
  /*    max_bytes :: Maximum number of bytes to use for cached data nodes. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   302
  /*                 Use~0 for defaults.  Note that this value does not    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   303
  /*                 account for managed @FT_Face and @FT_Size objects.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   304
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   305
  /*    requester :: An application-provided callback used to translate    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   306
  /*                 face IDs into real @FT_Face objects.                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   307
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   308
  /*    req_data  :: A generic pointer that is passed to the requester     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   309
  /*                 each time it is called (see @FTC_Face_Requester).     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   310
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   311
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   312
  /*    amanager  :: A handle to a new manager object.  0~in case of       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   313
  /*                 failure.                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   314
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   315
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   316
  /*    FreeType error code.  0~means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   317
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   318
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   319
  FTC_Manager_New( FT_Library          library,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   320
                   FT_UInt             max_faces,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   321
                   FT_UInt             max_sizes,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   322
                   FT_ULong            max_bytes,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   323
                   FTC_Face_Requester  requester,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   324
                   FT_Pointer          req_data,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   325
                   FTC_Manager        *amanager );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   326
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   327
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   328
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   329
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   330
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   331
  /*    FTC_Manager_Reset                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   332
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   333
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   334
  /*    Empty a given cache manager.  This simply gets rid of all the      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   335
  /*    currently cached @FT_Face and @FT_Size objects within the manager. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   336
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   337
  /* <InOut>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   338
  /*    manager :: A handle to the manager.                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   339
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   340
  FT_EXPORT( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   341
  FTC_Manager_Reset( FTC_Manager  manager );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   342
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   343
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   344
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   345
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   346
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   347
  /*    FTC_Manager_Done                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   348
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   349
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   350
  /*    Destroy a given manager after emptying it.                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   351
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   352
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   353
  /*    manager :: A handle to the target cache manager object.            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   354
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   355
  FT_EXPORT( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   356
  FTC_Manager_Done( FTC_Manager  manager );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   357
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   358
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   359
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   360
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   361
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   362
  /*    FTC_Manager_LookupFace                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   363
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   364
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   365
  /*    Retrieve the @FT_Face object that corresponds to a given face ID   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   366
  /*    through a cache manager.                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   367
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   368
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   369
  /*    manager :: A handle to the cache manager.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   370
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   371
  /*    face_id :: The ID of the face object.                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   372
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   373
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   374
  /*    aface   :: A handle to the face object.                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   375
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   376
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   377
  /*    FreeType error code.  0~means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   378
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   379
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   380
  /*    The returned @FT_Face object is always owned by the manager.  You  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   381
  /*    should never try to discard it yourself.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   382
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   383
  /*    The @FT_Face object doesn't necessarily have a current size object */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   384
  /*    (i.e., face->size can be 0).  If you need a specific `font size',  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   385
  /*    use @FTC_Manager_LookupSize instead.                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   386
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   387
  /*    Never change the face's transformation matrix (i.e., never call    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   388
  /*    the @FT_Set_Transform function) on a returned face!  If you need   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   389
  /*    to transform glyphs, do it yourself after glyph loading.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   390
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   391
  /*    When you perform a lookup, out-of-memory errors are detected       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   392
  /*    _within_ the lookup and force incremental flushes of the cache     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   393
  /*    until enough memory is released for the lookup to succeed.         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   394
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   395
  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   396
  /*    already been completely flushed, and still no memory was available */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   397
  /*    for the operation.                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   398
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   399
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   400
  FTC_Manager_LookupFace( FTC_Manager  manager,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   401
                          FTC_FaceID   face_id,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   402
                          FT_Face     *aface );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   403
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   404
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   405
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   406
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   407
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   408
  /*    FTC_ScalerRec                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   409
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   410
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   411
  /*    A structure used to describe a given character size in either      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   412
  /*    pixels or points to the cache manager.  See                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   413
  /*    @FTC_Manager_LookupSize.                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   414
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   415
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   416
  /*    face_id :: The source face ID.                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   417
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   418
  /*    width   :: The character width.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   419
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   420
  /*    height  :: The character height.                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   421
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   422
  /*    pixel   :: A Boolean.  If 1, the `width' and `height' fields are   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   423
  /*               interpreted as integer pixel character sizes.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   424
  /*               Otherwise, they are expressed as 1/64th of points.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   425
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   426
  /*    x_res   :: Only used when `pixel' is value~0 to indicate the       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   427
  /*               horizontal resolution in dpi.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   428
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   429
  /*    y_res   :: Only used when `pixel' is value~0 to indicate the       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   430
  /*               vertical resolution in dpi.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   431
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   432
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   433
  /*    This type is mainly used to retrieve @FT_Size objects through the  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   434
  /*    cache manager.                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   435
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   436
  typedef struct  FTC_ScalerRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   437
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   438
    FTC_FaceID  face_id;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   439
    FT_UInt     width;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   440
    FT_UInt     height;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   441
    FT_Int      pixel;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   442
    FT_UInt     x_res;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   443
    FT_UInt     y_res;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   444
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   445
  } FTC_ScalerRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   446
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   447
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   448
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   449
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   450
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   451
  /*    FTC_Scaler                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   452
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   453
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   454
  /*    A handle to an @FTC_ScalerRec structure.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   455
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   456
  typedef struct FTC_ScalerRec_*  FTC_Scaler;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   457
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   458
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   459
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   460
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   461
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   462
  /*    FTC_Manager_LookupSize                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   463
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   464
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   465
  /*    Retrieve the @FT_Size object that corresponds to a given           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   466
  /*    @FTC_ScalerRec pointer through a cache manager.                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   467
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   468
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   469
  /*    manager :: A handle to the cache manager.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   470
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   471
  /*    scaler  :: A scaler handle.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   472
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   473
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   474
  /*    asize   :: A handle to the size object.                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   475
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   476
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   477
  /*    FreeType error code.  0~means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   478
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   479
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   480
  /*    The returned @FT_Size object is always owned by the manager.  You  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   481
  /*    should never try to discard it by yourself.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   482
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   483
  /*    You can access the parent @FT_Face object simply as `size->face'   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   484
  /*    if you need it.  Note that this object is also owned by the        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   485
  /*    manager.                                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   486
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   487
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   488
  /*    When you perform a lookup, out-of-memory errors are detected       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   489
  /*    _within_ the lookup and force incremental flushes of the cache     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   490
  /*    until enough memory is released for the lookup to succeed.         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   491
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   492
  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   493
  /*    already been completely flushed, and still no memory is available  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   494
  /*    for the operation.                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   495
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   496
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   497
  FTC_Manager_LookupSize( FTC_Manager  manager,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   498
                          FTC_Scaler   scaler,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   499
                          FT_Size     *asize );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   500
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   501
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   502
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   503
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   504
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   505
  /*    FTC_Node_Unref                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   506
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   507
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   508
  /*    Decrement a cache node's internal reference count.  When the count */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   509
  /*    reaches 0, it is not destroyed but becomes eligible for subsequent */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   510
  /*    cache flushes.                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   511
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   512
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   513
  /*    node    :: The cache node handle.                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   514
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   515
  /*    manager :: The cache manager handle.                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   516
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   517
  FT_EXPORT( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   518
  FTC_Node_Unref( FTC_Node     node,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   519
                  FTC_Manager  manager );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   520
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   521
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   522
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   523
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   524
   * @function:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   525
   *   FTC_Manager_RemoveFaceID
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   526
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   527
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   528
   *   A special function used to indicate to the cache manager that
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   529
   *   a given @FTC_FaceID is no longer valid, either because its
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   530
   *   content changed, or because it was deallocated or uninstalled.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   531
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   532
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   533
   *   manager ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   534
   *     The cache manager handle.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   535
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   536
   *   face_id ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   537
   *     The @FTC_FaceID to be removed.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   538
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   539
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   540
   *   This function flushes all nodes from the cache corresponding to this
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   541
   *   `face_id', with the exception of nodes with a non-null reference
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   542
   *   count.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   543
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   544
   *   Such nodes are however modified internally so as to never appear
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   545
   *   in later lookups with the same `face_id' value, and to be immediately
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   546
   *   destroyed when released by all their users.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   547
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   548
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   549
  FT_EXPORT( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   550
  FTC_Manager_RemoveFaceID( FTC_Manager  manager,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   551
                            FTC_FaceID   face_id );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   552
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   553
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   554
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   555
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   556
  /* <Section>                                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   557
  /*    cache_subsystem                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   558
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   559
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   560
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   561
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   562
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   563
   * @type:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   564
   *   FTC_CMapCache
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   565
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   566
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   567
   *   An opaque handle used to model a charmap cache.  This cache is to
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   568
   *   hold character codes -> glyph indices mappings.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   569
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   570
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   571
  typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   572
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   573
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   574
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   575
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   576
   * @function:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   577
   *   FTC_CMapCache_New
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   578
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   579
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   580
   *   Create a new charmap cache.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   581
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   582
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   583
   *   manager ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   584
   *     A handle to the cache manager.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   585
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   586
   * @output:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   587
   *   acache ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   588
   *     A new cache handle.  NULL in case of error.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   589
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   590
   * @return:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   591
   *   FreeType error code.  0~means success.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   592
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   593
   * @note:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   594
   *   Like all other caches, this one will be destroyed with the cache
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   595
   *   manager.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   596
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   597
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   598
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   599
  FTC_CMapCache_New( FTC_Manager     manager,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   600
                     FTC_CMapCache  *acache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   601
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   602
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   603
  /************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   604
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   605
   * @function:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   606
   *   FTC_CMapCache_Lookup
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   607
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   608
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   609
   *   Translate a character code into a glyph index, using the charmap
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   610
   *   cache.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   611
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   612
   * @input:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   613
   *   cache ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   614
   *     A charmap cache handle.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   615
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   616
   *   face_id ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   617
   *     The source face ID.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   618
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   619
   *   cmap_index ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   620
   *     The index of the charmap in the source face.  Any negative value
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   621
   *     means to use the cache @FT_Face's default charmap.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   622
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   623
   *   char_code ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   624
   *     The character code (in the corresponding charmap).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   625
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   626
   * @return:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   627
   *    Glyph index.  0~means `no glyph'.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   628
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   629
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   630
  FT_EXPORT( FT_UInt )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   631
  FTC_CMapCache_Lookup( FTC_CMapCache  cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   632
                        FTC_FaceID     face_id,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   633
                        FT_Int         cmap_index,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   634
                        FT_UInt32      char_code );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   635
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   636
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   637
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   638
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   639
  /* <Section>                                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   640
  /*    cache_subsystem                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   641
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   642
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   643
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   644
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   645
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   646
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   647
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   648
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   649
  /*****                       IMAGE CACHE OBJECT                      *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   650
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   651
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   652
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   653
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   654
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   655
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   656
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   657
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   658
   * @struct:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   659
   *   FTC_ImageTypeRec
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   660
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   661
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   662
   *   A structure used to model the type of images in a glyph cache.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   663
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   664
   * @fields:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   665
   *   face_id ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   666
   *     The face ID.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   667
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   668
   *   width ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   669
   *     The width in pixels.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   670
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   671
   *   height ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   672
   *     The height in pixels.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   673
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   674
   *   flags ::
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   675
   *     The load flags, as in @FT_Load_Glyph.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   676
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   677
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   678
  typedef struct  FTC_ImageTypeRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   679
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   680
    FTC_FaceID  face_id;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   681
    FT_Int      width;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   682
    FT_Int      height;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   683
    FT_Int32    flags;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   684
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   685
  } FTC_ImageTypeRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   686
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   687
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   688
  /*************************************************************************
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   689
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   690
   * @type:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   691
   *   FTC_ImageType
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   692
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   693
   * @description:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   694
   *   A handle to an @FTC_ImageTypeRec structure.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   695
   *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   696
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   697
  typedef struct FTC_ImageTypeRec_*  FTC_ImageType;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   698
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   699
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   700
  /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   701
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   702
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   703
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 )      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   704
          ( (d1)->face_id == (d2)->face_id && \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   705
            (d1)->width   == (d2)->width   && \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   706
            (d1)->flags   == (d2)->flags   )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   707
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   708
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   709
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   710
  /* this macro is incompatible with LLP64, should not be used */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   711
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   712
#define FTC_IMAGE_TYPE_HASH( d )                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   713
          (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id )  ^ \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   714
                      ( (d)->width << 8 ) ^ (d)->height ^ \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   715
                      ( (d)->flags << 4 )               )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   716
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   717
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   718
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   719
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   720
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   721
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   722
  /* <Type>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   723
  /*    FTC_ImageCache                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   724
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   725
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   726
  /*    A handle to an glyph image cache object.  They are designed to     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   727
  /*    hold many distinct glyph images while not exceeding a certain      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   728
  /*    memory threshold.                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   729
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   730
  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   731
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   732
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   733
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   734
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   735
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   736
  /*    FTC_ImageCache_New                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   737
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   738
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   739
  /*    Create a new glyph image cache.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   740
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   741
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   742
  /*    manager :: The parent manager for the image cache.                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   743
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   744
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   745
  /*    acache  :: A handle to the new glyph image cache object.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   746
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   747
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   748
  /*    FreeType error code.  0~means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   749
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   750
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   751
  FTC_ImageCache_New( FTC_Manager      manager,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   752
                      FTC_ImageCache  *acache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   753
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   754
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   755
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   756
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   757
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   758
  /*    FTC_ImageCache_Lookup                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   759
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   760
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   761
  /*    Retrieve a given glyph image from a glyph image cache.             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   762
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   763
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   764
  /*    cache  :: A handle to the source glyph image cache.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   765
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   766
  /*    type   :: A pointer to a glyph image type descriptor.              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   767
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   768
  /*    gindex :: The glyph index to retrieve.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   769
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   770
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   771
  /*    aglyph :: The corresponding @FT_Glyph object.  0~in case of        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   772
  /*              failure.                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   773
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   774
  /*    anode  :: Used to return the address of of the corresponding cache */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   775
  /*              node after incrementing its reference count (see note    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   776
  /*              below).                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   777
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   778
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   779
  /*    FreeType error code.  0~means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   780
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   781
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   782
  /*    The returned glyph is owned and managed by the glyph image cache.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   783
  /*    Never try to transform or discard it manually!  You can however    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   784
  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   785
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   786
  /*    If `anode' is _not_ NULL, it receives the address of the cache     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   787
  /*    node containing the glyph image, after increasing its reference    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   788
  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   789
  /*    always be kept in the cache until you call @FTC_Node_Unref to      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   790
  /*    `release' it.                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   791
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   792
  /*    If `anode' is NULL, the cache node is left unchanged, which means  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   793
  /*    that the @FT_Glyph could be flushed out of the cache on the next   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   794
  /*    call to one of the caching sub-system APIs.  Don't assume that it  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   795
  /*    is persistent!                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   796
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   797
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   798
  FTC_ImageCache_Lookup( FTC_ImageCache  cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   799
                         FTC_ImageType   type,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   800
                         FT_UInt         gindex,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   801
                         FT_Glyph       *aglyph,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   802
                         FTC_Node       *anode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   803
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   804
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   805
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   806
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   807
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   808
  /*    FTC_ImageCache_LookupScaler                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   809
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   810
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   811
  /*    A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   812
  /*    to specify the face ID and its size.                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   813
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   814
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   815
  /*    cache      :: A handle to the source glyph image cache.            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   816
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   817
  /*    scaler     :: A pointer to a scaler descriptor.                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   818
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   819
  /*    load_flags :: The corresponding load flags.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   820
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   821
  /*    gindex     :: The glyph index to retrieve.                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   822
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   823
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   824
  /*    aglyph     :: The corresponding @FT_Glyph object.  0~in case of    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   825
  /*                  failure.                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   826
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   827
  /*    anode      :: Used to return the address of of the corresponding   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   828
  /*                  cache node after incrementing its reference count    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   829
  /*                  (see note below).                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   830
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   831
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   832
  /*    FreeType error code.  0~means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   833
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   834
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   835
  /*    The returned glyph is owned and managed by the glyph image cache.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   836
  /*    Never try to transform or discard it manually!  You can however    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   837
  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   838
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   839
  /*    If `anode' is _not_ NULL, it receives the address of the cache     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   840
  /*    node containing the glyph image, after increasing its reference    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   841
  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   842
  /*    always be kept in the cache until you call @FTC_Node_Unref to      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   843
  /*    `release' it.                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   844
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   845
  /*    If `anode' is NULL, the cache node is left unchanged, which means  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   846
  /*    that the @FT_Glyph could be flushed out of the cache on the next   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   847
  /*    call to one of the caching sub-system APIs.  Don't assume that it  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   848
  /*    is persistent!                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   849
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   850
  /*    Calls to @FT_Set_Char_Size and friends have no effect on cached    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   851
  /*    glyphs; you should always use the FreeType cache API instead.      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   852
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   853
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   854
  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   855
                               FTC_Scaler      scaler,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   856
                               FT_ULong        load_flags,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   857
                               FT_UInt         gindex,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   858
                               FT_Glyph       *aglyph,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   859
                               FTC_Node       *anode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   860
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   861
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   862
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   863
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   864
  /* <Type>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   865
  /*    FTC_SBit                                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   866
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   867
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   868
  /*    A handle to a small bitmap descriptor.  See the @FTC_SBitRec       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   869
  /*    structure for details.                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   870
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   871
  typedef struct FTC_SBitRec_*  FTC_SBit;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   872
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   873
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   874
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   875
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   876
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   877
  /*    FTC_SBitRec                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   878
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   879
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   880
  /*    A very compact structure used to describe a small glyph bitmap.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   881
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   882
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   883
  /*    width     :: The bitmap width in pixels.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   884
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   885
  /*    height    :: The bitmap height in pixels.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   886
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   887
  /*    left      :: The horizontal distance from the pen position to the  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   888
  /*                 left bitmap border (a.k.a. `left side bearing', or    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   889
  /*                 `lsb').                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   890
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   891
  /*    top       :: The vertical distance from the pen position (on the   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   892
  /*                 baseline) to the upper bitmap border (a.k.a. `top     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   893
  /*                 side bearing').  The distance is positive for upwards */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   894
  /*                 y~coordinates.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   895
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   896
  /*    format    :: The format of the glyph bitmap (monochrome or gray).  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   897
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   898
  /*    max_grays :: Maximum gray level value (in the range 1 to~255).     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   899
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   900
  /*    pitch     :: The number of bytes per bitmap line.  May be positive */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   901
  /*                 or negative.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   902
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   903
  /*    xadvance  :: The horizontal advance width in pixels.               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   904
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   905
  /*    yadvance  :: The vertical advance height in pixels.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   906
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   907
  /*    buffer    :: A pointer to the bitmap pixels.                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   908
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   909
  typedef struct  FTC_SBitRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   910
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   911
    FT_Byte   width;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   912
    FT_Byte   height;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   913
    FT_Char   left;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   914
    FT_Char   top;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   915
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   916
    FT_Byte   format;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   917
    FT_Byte   max_grays;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   918
    FT_Short  pitch;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   919
    FT_Char   xadvance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   920
    FT_Char   yadvance;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   921
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   922
    FT_Byte*  buffer;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   923
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   924
  } FTC_SBitRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   925
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   926
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   927
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   928
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   929
  /* <Type>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   930
  /*    FTC_SBitCache                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   931
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   932
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   933
  /*    A handle to a small bitmap cache.  These are special cache objects */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   934
  /*    used to store small glyph bitmaps (and anti-aliased pixmaps) in a  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   935
  /*    much more efficient way than the traditional glyph image cache     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   936
  /*    implemented by @FTC_ImageCache.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   937
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   938
  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   939
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   940
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   941
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   942
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   943
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   944
  /*    FTC_SBitCache_New                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   945
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   946
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   947
  /*    Create a new cache to store small glyph bitmaps.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   948
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   949
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   950
  /*    manager :: A handle to the source cache manager.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   951
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   952
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   953
  /*    acache  :: A handle to the new sbit cache.  NULL in case of error. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   954
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   955
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   956
  /*    FreeType error code.  0~means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   957
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   958
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   959
  FTC_SBitCache_New( FTC_Manager     manager,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   960
                     FTC_SBitCache  *acache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   961
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   962
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   963
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   964
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   965
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   966
  /*    FTC_SBitCache_Lookup                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   967
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   968
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   969
  /*    Look up a given small glyph bitmap in a given sbit cache and       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   970
  /*    `lock' it to prevent its flushing from the cache until needed.     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   971
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   972
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   973
  /*    cache  :: A handle to the source sbit cache.                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   974
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   975
  /*    type   :: A pointer to the glyph image type descriptor.            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   976
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   977
  /*    gindex :: The glyph index.                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   978
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   979
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   980
  /*    sbit   :: A handle to a small bitmap descriptor.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   981
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   982
  /*    anode  :: Used to return the address of of the corresponding cache */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   983
  /*              node after incrementing its reference count (see note    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   984
  /*              below).                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   985
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   986
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   987
  /*    FreeType error code.  0~means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   988
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   989
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   990
  /*    The small bitmap descriptor and its bit buffer are owned by the    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   991
  /*    cache and should never be freed by the application.  They might    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   992
  /*    as well disappear from memory on the next cache lookup, so don't   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   993
  /*    treat them as persistent data.                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   994
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   995
  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   996
  /*    glyph bitmap.                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   997
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   998
  /*    If `anode' is _not_ NULL, it receives the address of the cache     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   999
  /*    node containing the bitmap, after increasing its reference count.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1000
  /*    This ensures that the node (as well as the image) will always be   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1001
  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1002
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1003
  /*    If `anode' is NULL, the cache node is left unchanged, which means  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1004
  /*    that the bitmap could be flushed out of the cache on the next      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1005
  /*    call to one of the caching sub-system APIs.  Don't assume that it  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1006
  /*    is persistent!                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1007
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1008
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1009
  FTC_SBitCache_Lookup( FTC_SBitCache    cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1010
                        FTC_ImageType    type,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1011
                        FT_UInt          gindex,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1012
                        FTC_SBit        *sbit,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1013
                        FTC_Node        *anode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1014
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1015
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1016
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1017
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1018
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1019
  /*    FTC_SBitCache_LookupScaler                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1020
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1021
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1022
  /*    A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1023
  /*    to specify the face ID and its size.                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1024
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1025
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1026
  /*    cache      :: A handle to the source sbit cache.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1027
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1028
  /*    scaler     :: A pointer to the scaler descriptor.                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1029
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1030
  /*    load_flags :: The corresponding load flags.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1031
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1032
  /*    gindex     :: The glyph index.                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1033
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1034
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1035
  /*    sbit       :: A handle to a small bitmap descriptor.               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1036
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1037
  /*    anode      :: Used to return the address of of the corresponding   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1038
  /*                  cache node after incrementing its reference count    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1039
  /*                  (see note below).                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1040
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1041
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1042
  /*    FreeType error code.  0~means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1043
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1044
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1045
  /*    The small bitmap descriptor and its bit buffer are owned by the    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1046
  /*    cache and should never be freed by the application.  They might    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1047
  /*    as well disappear from memory on the next cache lookup, so don't   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1048
  /*    treat them as persistent data.                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1049
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1050
  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1051
  /*    glyph bitmap.                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1052
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1053
  /*    If `anode' is _not_ NULL, it receives the address of the cache     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1054
  /*    node containing the bitmap, after increasing its reference count.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1055
  /*    This ensures that the node (as well as the image) will always be   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1056
  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1057
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1058
  /*    If `anode' is NULL, the cache node is left unchanged, which means  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1059
  /*    that the bitmap could be flushed out of the cache on the next      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1060
  /*    call to one of the caching sub-system APIs.  Don't assume that it  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1061
  /*    is persistent!                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1062
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1063
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1064
  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1065
                              FTC_Scaler     scaler,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1066
                              FT_ULong       load_flags,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1067
                              FT_UInt        gindex,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1068
                              FTC_SBit      *sbit,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1069
                              FTC_Node      *anode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1070
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1071
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1072
 /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1073
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1074
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1075
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1076
  /*@***********************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1077
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1078
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1079
  /*    FTC_FontRec                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1080
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1081
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1082
  /*    A simple structure used to describe a given `font' to the cache    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1083
  /*    manager.  Note that a `font' is the combination of a given face    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1084
  /*    with a given character size.                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1085
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1086
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1087
  /*    face_id    :: The ID of the face to use.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1088
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1089
  /*    pix_width  :: The character width in integer pixels.               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1090
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1091
  /*    pix_height :: The character height in integer pixels.              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1092
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1093
  typedef struct  FTC_FontRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1094
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1095
    FTC_FaceID  face_id;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1096
    FT_UShort   pix_width;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1097
    FT_UShort   pix_height;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1098
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1099
  } FTC_FontRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1100
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1101
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1102
  /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1103
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1104
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1105
#define FTC_FONT_COMPARE( f1, f2 )                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1106
          ( (f1)->face_id    == (f2)->face_id    && \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1107
            (f1)->pix_width  == (f2)->pix_width  && \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1108
            (f1)->pix_height == (f2)->pix_height )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1109
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1110
  /* this macro is incompatible with LLP64, should not be used */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1111
#define FTC_FONT_HASH( f )                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1112
          (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1113
                       ((f)->pix_width << 8)          ^ \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1114
                       ((f)->pix_height)              )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1115
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1116
  typedef FTC_FontRec*  FTC_Font;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1117
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1118
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1119
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1120
  FTC_Manager_Lookup_Face( FTC_Manager  manager,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1121
                           FTC_FaceID   face_id,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1122
                           FT_Face     *aface );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1123
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1124
  FT_EXPORT( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1125
  FTC_Manager_Lookup_Size( FTC_Manager  manager,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1126
                           FTC_Font     font,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1127
                           FT_Face     *aface,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1128
                           FT_Size     *asize );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1129
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1130
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1131
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1132
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1133
 /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1134
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1135
FT_END_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1136
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1137
#endif /* __FTCACHE_H__ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1138
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1139
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1140
/* END */