2000-10-29 01:34:45 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
2000-12-09 01:45:38 +01:00
|
|
|
/* ftcimage.h */
|
2000-10-29 01:34:45 +02:00
|
|
|
/* */
|
|
|
|
/* FreeType Image cache (body). */
|
|
|
|
/* */
|
|
|
|
/* 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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2000-10-31 18:49:07 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Each image cache really manages FT_Glyph objects. */
|
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
#ifndef __FTCIMAGE_H__
|
|
|
|
#define __FTCIMAGE_H__
|
2000-10-29 01:34:45 +02:00
|
|
|
|
2000-12-09 01:45:38 +01:00
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_CACHE_H
|
|
|
|
#include FT_CACHE_INTERNAL_GLYPH_H
|
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
2000-10-29 01:34:45 +02:00
|
|
|
|
|
|
|
|
2001-01-11 10:27:49 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Section> */
|
|
|
|
/* cache_subsystem */
|
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2001-01-10 12:15:48 +01:00
|
|
|
|
2000-10-29 01:34:45 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** IMAGE CACHE OBJECT *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
2000-12-14 00:44:37 +01:00
|
|
|
#define FTC_IMAGE_FORMAT( x ) ( (x) & 7 )
|
2000-10-29 01:34:45 +02:00
|
|
|
|
|
|
|
|
2000-12-14 00:44:37 +01:00
|
|
|
#define ftc_image_format_bitmap 0
|
|
|
|
#define ftc_image_format_outline 1
|
2000-10-29 01:34:45 +02:00
|
|
|
|
2000-12-14 00:44:37 +01:00
|
|
|
#define ftc_image_flag_monochrome 16
|
|
|
|
#define ftc_image_flag_unhinted 32
|
|
|
|
#define ftc_image_flag_autohinted 64
|
|
|
|
#define ftc_image_flag_unscaled 128
|
|
|
|
#define ftc_image_flag_no_sbits 256
|
2000-10-29 01:34:45 +02:00
|
|
|
|
2000-10-31 18:49:07 +01:00
|
|
|
/* monochrome bitmap */
|
2000-12-14 00:44:37 +01:00
|
|
|
#define ftc_image_mono ftc_image_format_bitmap | \
|
2001-01-10 12:15:48 +01:00
|
|
|
ftc_image_flag_monochrome
|
2000-10-31 18:49:07 +01:00
|
|
|
/* anti-aliased bitmap */
|
2000-12-14 00:44:37 +01:00
|
|
|
#define ftc_image_grays ftc_image_format_bitmap
|
2000-10-31 18:49:07 +01:00
|
|
|
/* scaled outline */
|
2000-12-14 00:44:37 +01:00
|
|
|
#define ftc_image_outline ftc_image_format_outline
|
2000-10-29 01:34:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <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> */
|
2000-10-31 18:49:07 +01:00
|
|
|
/* manager :: The parent manager for the image cache. */
|
2000-10-29 01:34:45 +02:00
|
|
|
/* */
|
|
|
|
/* <Output> */
|
2000-10-31 18:49:07 +01:00
|
|
|
/* acache :: A handle to the new glyph image cache object. */
|
2000-10-29 01:34:45 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_EXPORT( FT_Error ) FTC_Image_Cache_New( FTC_Manager manager,
|
2000-11-06 05:33:56 +01:00
|
|
|
FTC_Image_Cache *acache );
|
2000-10-29 01:34:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <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> */
|
2000-10-31 18:49:07 +01:00
|
|
|
/* FreeType error code. 0 means success. */
|
2000-10-29 01:34:45 +02:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-10-31 18:49:07 +01:00
|
|
|
/* The returned glyph is owned and managed by the glyph image cache. */
|
2000-10-29 01:34:45 +02:00
|
|
|
/* 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... */
|
|
|
|
/* */
|
2000-11-04 02:55:49 +01:00
|
|
|
FT_EXPORT( FT_Error ) FTC_Image_Cache_Lookup( FTC_Image_Cache cache,
|
|
|
|
FTC_Image_Desc* desc,
|
|
|
|
FT_UInt gindex,
|
2000-11-06 05:33:56 +01:00
|
|
|
FT_Glyph *aglyph );
|
2000-10-29 01:34:45 +02:00
|
|
|
|
2001-01-11 10:27:49 +01:00
|
|
|
|
2001-01-10 12:15:48 +01:00
|
|
|
/* */
|
2000-10-29 01:34:45 +02:00
|
|
|
|
2001-01-11 10:27:49 +01:00
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
FT_END_HEADER
|
2000-10-29 01:34:45 +02:00
|
|
|
|
2000-12-01 00:12:33 +01:00
|
|
|
#endif /* __FTCIMAGE_H__ */
|
2000-10-29 01:34:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|