misc/libfreetype/src/cache/ftcglyph.c
author sheepluva
Wed, 17 Apr 2013 14:57:56 +0200
branch0.9.19
changeset 8902 a94c074fd483
parent 5172 88f2e05288ba
permissions -rw-r--r--
fix for issue #599: "Change graphics size settings to use qspinbox"? somebody ask unC0Rr if that's what he wanted :p
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
/*  ftcglyph.c                                                             */
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 Glyph Image (FT_Glyph) cache (body).                        */
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 2000-2001, 2003, 2004, 2006, 2009, 2011 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
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#include FT_INTERNAL_OBJECTS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
#include FT_CACHE_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
#include "ftcglyph.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
#include FT_ERRORS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
#include "ftccback.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#include "ftcerror.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
  /* create a new chunk node, setting its cache index and ref count */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
  FT_LOCAL_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
  FTC_GNode_Init( FTC_GNode   gnode,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
                  FT_UInt     gindex,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
                  FTC_Family  family )
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
    gnode->family = family;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
    gnode->gindex = gindex;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
    family->num_nodes++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
  FT_LOCAL_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
  FTC_GNode_UnselectFamily( FTC_GNode  gnode,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
                            FTC_Cache  cache )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
    FTC_Family  family = gnode->family;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
    gnode->family = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
    if ( family && --family->num_nodes == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
      FTC_FAMILY_FREE( family, cache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
  }
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
  FT_LOCAL_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
  FTC_GNode_Done( FTC_GNode  gnode,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
                  FTC_Cache  cache )
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
    /* finalize the node */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
    gnode->gindex = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
    FTC_GNode_UnselectFamily( gnode, cache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
  FT_LOCAL_DEF( FT_Bool )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
  ftc_gnode_compare( FTC_Node    ftcgnode,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
                     FT_Pointer  ftcgquery,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
                     FTC_Cache   cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
                     FT_Bool*    list_changed )
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
    FTC_GNode   gnode  = (FTC_GNode)ftcgnode;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
    FT_UNUSED( cache );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
    if ( list_changed )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
      *list_changed = FALSE;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
    return FT_BOOL( gnode->family == gquery->family &&
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
                    gnode->gindex == gquery->gindex );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
#ifdef FTC_INLINE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
  FT_LOCAL_DEF( FT_Bool )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
  FTC_GNode_Compare( FTC_GNode   gnode,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
                     FTC_GQuery  gquery,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
                     FTC_Cache   cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
                     FT_Bool*    list_changed )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
    return ftc_gnode_compare( FTC_NODE( gnode ), gquery,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
                              cache, list_changed );
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
  /*****                                                               *****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
  /*****                      CHUNK SETS                               *****/
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
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
  FT_LOCAL_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
  FTC_Family_Init( FTC_Family  family,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
                   FTC_Cache   cache )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
    FTC_GCacheClass  clazz = FTC_CACHE__GCACHE_CLASS( cache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
    family->clazz     = clazz->family_class;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
    family->num_nodes = 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
    family->cache     = cache;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
  ftc_gcache_init( FTC_Cache  ftccache )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
    FTC_GCache  cache = (FTC_GCache)ftccache;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
    FT_Error    error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
    error = FTC_Cache_Init( FTC_CACHE( cache ) );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
    if ( !error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
      FTC_GCacheClass   clazz = (FTC_GCacheClass)FTC_CACHE( cache )->org_class;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
      FTC_MruList_Init( &cache->families,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
                        clazz->family_class,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
                        0,  /* no maximum here! */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
                        cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
                        FTC_CACHE( cache )->memory );
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
    return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
  }
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
#if 0
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
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
  FTC_GCache_Init( FTC_GCache  cache )
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
    return ftc_gcache_init( FTC_CACHE( cache ) );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
  }
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
#endif /* 0 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
  FT_LOCAL_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
  ftc_gcache_done( FTC_Cache  ftccache )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
    FTC_GCache  cache = (FTC_GCache)ftccache;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
    FTC_Cache_Done( (FTC_Cache)cache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
    FTC_MruList_Done( &cache->families );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
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 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
  FT_LOCAL_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
  FTC_GCache_Done( FTC_GCache  cache )
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
    ftc_gcache_done( FTC_CACHE( cache ) );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
  }
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
#endif /* 0 */
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
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
  FTC_GCache_New( FTC_Manager       manager,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
                  FTC_GCacheClass   clazz,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
                  FTC_GCache       *acache )
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
    return FTC_Manager_RegisterCache( manager, (FTC_CacheClass)clazz,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
                                      (FTC_Cache*)acache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
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
#ifndef FTC_INLINE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
  FT_LOCAL_DEF( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
  FTC_GCache_Lookup( FTC_GCache   cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
                     FT_PtrDist   hash,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
                     FT_UInt      gindex,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
                     FTC_GQuery   query,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
                     FTC_Node    *anode )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
    FT_Error  error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
    query->gindex = gindex;
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
    FTC_MRULIST_LOOKUP( &cache->families, query, query->family, error );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
    if ( !error )
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
      FTC_Family  family = query->family;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
      /* prevent the family from being destroyed too early when an        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
      /* out-of-memory condition occurs during glyph node initialization. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
      family->num_nodes++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
      error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, anode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
      if ( --family->num_nodes == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
        FTC_FAMILY_FREE( family, cache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
    return error;
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
#endif /* !FTC_INLINE */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
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
/* END */