Hash :
ece63798
Author :
Date :
2000-10-28T23:34:45
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
/***************************************************************************/
/* */
/* ftcimage.c */
/* */
/* FreeType Image cache (body). */
/* */
/* Each image cache really manages FT_Glyph objects :-) */
/* */
/* */
/* Copyright 2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTCIMAGE_H
#define FTCIMAGE_H
#include <freetype/cache/ftcglyph.h>
#include <freetype/ftglyph.h>
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** IMAGE CACHE OBJECT *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
#define FTC_IMAGE_FORMAT( x ) ( (x) & 7 )
/*************************************************************************/
/* */
/* <Enum> */
/* FTC_Image_Type */
/* */
/* <Description> */
/* An enumeration used to list the types of glyph images found in a */
/* glyph image cache. */
/* */
/* <Fields> */
/* ftc_image_mono :: Monochrome bitmap glyphs. */
/* */
/* ftc_image_grays :: Anti-aliased bitmap glyphs. */
/* */
/* ftc_image_outline :: Scaled (and hinted) outline glyphs. */
/* */
/* ftc_master_outline :: Unscaled original outline glyphs. */
/* */
/* <Note> */
/* Other types may be defined in the future. */
/* */
typedef enum FTC_Image_Type_
{
ftc_image_format_bitmap = 0,
ftc_image_format_outline = 1,
ftc_image_flag_monochrome = 16,
ftc_image_flag_unhinted = 32,
ftc_image_flag_autohinted = 64,
ftc_image_flag_unscaled = 128,
ftc_image_flag_no_sbits = 256,
ftc_image_mono = ftc_image_format_bitmap |
ftc_image_flag_monochrome, /* monochrome bitmap */
ftc_image_grays = ftc_image_format_bitmap, /* anti-aliased bitmap */
ftc_image_outline = ftc_image_format_outline /* scaled outline */
} FTC_Image_Type;
/*************************************************************************/
/* */
/* <Struct> */
/* FTC_Image_Desc */
/* */
/* <Description> */
/* A simple structure used to describe a given glyph image category. */
/* */
/* <Fields> */
/* size :: An FTC_SizeRec used to describe the glyph's face & */
/* size. */
/* */
/* image_type :: The glyph image's type. */
/* */
typedef struct FTC_Image_Desc_
{
FTC_FontRec font;
FT_UInt image_type;
} FTC_Image_Desc;
/*************************************************************************/
/* */
/* <Type> */
/* FTC_Image_Cache */
/* */
/* <Description> */
/* A handle to an glyph image cache object. They are designed to */
/* hold many distinct glyph images, while not exceeding a certain */
/* memory threshold. */
/* */
typedef struct FTC_Image_CacheRec_* FTC_Image_Cache;
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Image_Cache_New */
/* */
/* <Description> */
/* Creates a new glyph image cache. */
/* */
/* <Input> */
/* manager :: The parent manager for the image cache. */
/* */
/* <Output> */
/* acache :: A handle to the new glyph image cache object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_DEF( FT_Error ) FTC_Image_Cache_New( FTC_Manager manager,
FTC_Image_Cache* acache );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_Image_Cache_Lookup */
/* */
/* <Description> */
/* Retrieves a given glyph image from a glyph image cache. */
/* */
/* <Input> */
/* cache :: A handle to the source glyph image cache. */
/* */
/* desc :: A pointer to a glyph image descriptor. */
/* */
/* gindex :: The glyph index to retrieve. */
/* */
/* <Output> */
/* aglyph :: The corresponding FT_Glyph object. 0 in case of */
/* failure. */
/* */
/* <Return> */
/* error code, 0 means success */
/* */
/* <Note> */
/* the returned glyph is owned and manager by the glyph image cache. */
/* Never try to transform or discard it manually! You can however */
/* create a copy with FT_Glyph_Copy() and modify the new one. */
/* */
/* Because the glyph image cache limits the total amount of memory */
/* taken by the glyphs it holds, the returned glyph might disappear */
/* on a later invocation of this function! It's a cache after all... */
/* */
FT_EXPORT_DEF( FT_Error )
FTC_Image_Cache_Lookup( FTC_Image_Cache cache,
FTC_Image_Desc* desc,
FT_UInt gindex,
FT_Glyph* aglyph );
#ifdef __cplusplus
}
#endif
#endif /* FTCIMAGE_H */
/* END */