Al-Qurtas-Islamic-bank-The-.../include/freetype/cache/ftcsbits.h

276 lines
16 KiB
C
Raw Normal View History

/***************************************************************************/
/* */
/* ftcsbits.h */
/* */
2000-10-31 20:42:53 +01:00
/* A small-bitmap cache (specification). */
/* */
2002-09-18 13:32:12 +02:00
/* Copyright 2000-2001, 2002 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 20:42:53 +01:00
#ifndef __FTCSBITS_H__
#define __FTCSBITS_H__
#include <ft2build.h>
#include FT_CACHE_H
#include FT_CACHE_IMAGE_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* cache_subsystem */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Type> */
/* FTC_SBit */
/* */
/* <Description> */
/* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
/* structure for details. */
/* */
2000-10-31 20:42:53 +01:00
typedef struct FTC_SBitRec_* FTC_SBit;
/*************************************************************************/
/* */
/* <Struct> */
/* FTC_SBitRec */
/* */
/* <Description> */
/* A very compact structure used to describe a small glyph bitmap. */
/* */
/* <Fields> */
* src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/. (parse_font_matrix): Remove unnecessary code. (parse_sfnts): Initialize some variables. (t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use ft_module_driver_has_hinter conditionally. Moved some type 42 specific structure definitions to... * include/freetype/internal/t42types.h: New file. * include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H): New macro. * include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field `num_grays' for specifying the number of used gray levels. * src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it. Adding a driver for BDF fonts written by Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>. Heavily modified by me to better adapt it to FreeType, removing unneeded stuff. Additionally, it now supports Mark Leisher's BDF extension for anti-aliased bitmap glyphs with 2 and 4 bpp. * src/bdf/*: New driver. * include/freetype/internal/bdftypes.h: New file. * include/freetype/internal/fttrace.h: Added BDF driver components. * include/freetype/fterrdef.h: Added error codes for BDF driver. * include/freetype/config/ftmodule.h, src/Jamfile: Updated. * include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H): New macro. * include/freetype/config/ftstdlib.h (ft_sprintf): New alias for sprintf. * include/freetype/internal/fttrace.h: Added Type 42 driver component. * src/type42/t42drivr.c: Use it. * include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H): New macro.
2002-05-21 16:13:01 +02:00
/* width :: The bitmap width in pixels. */
/* */
* src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/. (parse_font_matrix): Remove unnecessary code. (parse_sfnts): Initialize some variables. (t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use ft_module_driver_has_hinter conditionally. Moved some type 42 specific structure definitions to... * include/freetype/internal/t42types.h: New file. * include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H): New macro. * include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field `num_grays' for specifying the number of used gray levels. * src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it. Adding a driver for BDF fonts written by Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>. Heavily modified by me to better adapt it to FreeType, removing unneeded stuff. Additionally, it now supports Mark Leisher's BDF extension for anti-aliased bitmap glyphs with 2 and 4 bpp. * src/bdf/*: New driver. * include/freetype/internal/bdftypes.h: New file. * include/freetype/internal/fttrace.h: Added BDF driver components. * include/freetype/fterrdef.h: Added error codes for BDF driver. * include/freetype/config/ftmodule.h, src/Jamfile: Updated. * include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H): New macro. * include/freetype/config/ftstdlib.h (ft_sprintf): New alias for sprintf. * include/freetype/internal/fttrace.h: Added Type 42 driver component. * src/type42/t42drivr.c: Use it. * include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H): New macro.
2002-05-21 16:13:01 +02:00
/* height :: The bitmap height in pixels. */
/* */
* src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/. (parse_font_matrix): Remove unnecessary code. (parse_sfnts): Initialize some variables. (t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use ft_module_driver_has_hinter conditionally. Moved some type 42 specific structure definitions to... * include/freetype/internal/t42types.h: New file. * include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H): New macro. * include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field `num_grays' for specifying the number of used gray levels. * src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it. Adding a driver for BDF fonts written by Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>. Heavily modified by me to better adapt it to FreeType, removing unneeded stuff. Additionally, it now supports Mark Leisher's BDF extension for anti-aliased bitmap glyphs with 2 and 4 bpp. * src/bdf/*: New driver. * include/freetype/internal/bdftypes.h: New file. * include/freetype/internal/fttrace.h: Added BDF driver components. * include/freetype/fterrdef.h: Added error codes for BDF driver. * include/freetype/config/ftmodule.h, src/Jamfile: Updated. * include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H): New macro. * include/freetype/config/ftstdlib.h (ft_sprintf): New alias for sprintf. * include/freetype/internal/fttrace.h: Added Type 42 driver component. * src/type42/t42drivr.c: Use it. * include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H): New macro.
2002-05-21 16:13:01 +02:00
/* left :: The horizontal distance from the pen position to the */
/* left bitmap border (a.k.a. `left side bearing', or */
/* `lsb'). */
/* */
* src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/. (parse_font_matrix): Remove unnecessary code. (parse_sfnts): Initialize some variables. (t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use ft_module_driver_has_hinter conditionally. Moved some type 42 specific structure definitions to... * include/freetype/internal/t42types.h: New file. * include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H): New macro. * include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field `num_grays' for specifying the number of used gray levels. * src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it. Adding a driver for BDF fonts written by Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>. Heavily modified by me to better adapt it to FreeType, removing unneeded stuff. Additionally, it now supports Mark Leisher's BDF extension for anti-aliased bitmap glyphs with 2 and 4 bpp. * src/bdf/*: New driver. * include/freetype/internal/bdftypes.h: New file. * include/freetype/internal/fttrace.h: Added BDF driver components. * include/freetype/fterrdef.h: Added error codes for BDF driver. * include/freetype/config/ftmodule.h, src/Jamfile: Updated. * include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H): New macro. * include/freetype/config/ftstdlib.h (ft_sprintf): New alias for sprintf. * include/freetype/internal/fttrace.h: Added Type 42 driver component. * src/type42/t42drivr.c: Use it. * include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H): New macro.
2002-05-21 16:13:01 +02:00
/* top :: The vertical distance from the pen position (on the */
/* baseline) to the upper bitmap border (a.k.a. `top */
/* side bearing'). The distance is positive for upwards */
/* Y coordinates. */
/* */
* src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/. (parse_font_matrix): Remove unnecessary code. (parse_sfnts): Initialize some variables. (t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use ft_module_driver_has_hinter conditionally. Moved some type 42 specific structure definitions to... * include/freetype/internal/t42types.h: New file. * include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H): New macro. * include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field `num_grays' for specifying the number of used gray levels. * src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it. Adding a driver for BDF fonts written by Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>. Heavily modified by me to better adapt it to FreeType, removing unneeded stuff. Additionally, it now supports Mark Leisher's BDF extension for anti-aliased bitmap glyphs with 2 and 4 bpp. * src/bdf/*: New driver. * include/freetype/internal/bdftypes.h: New file. * include/freetype/internal/fttrace.h: Added BDF driver components. * include/freetype/fterrdef.h: Added error codes for BDF driver. * include/freetype/config/ftmodule.h, src/Jamfile: Updated. * include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H): New macro. * include/freetype/config/ftstdlib.h (ft_sprintf): New alias for sprintf. * include/freetype/internal/fttrace.h: Added Type 42 driver component. * src/type42/t42drivr.c: Use it. * include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H): New macro.
2002-05-21 16:13:01 +02:00
/* format :: The format of the glyph bitmap (monochrome or gray). */
/* */
2002-09-18 13:32:12 +02:00
/* max_grays :: Maximum gray level value (in the range 1 to 255). */
/* */
* src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/. (parse_font_matrix): Remove unnecessary code. (parse_sfnts): Initialize some variables. (t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use ft_module_driver_has_hinter conditionally. Moved some type 42 specific structure definitions to... * include/freetype/internal/t42types.h: New file. * include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H): New macro. * include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field `num_grays' for specifying the number of used gray levels. * src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it. Adding a driver for BDF fonts written by Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>. Heavily modified by me to better adapt it to FreeType, removing unneeded stuff. Additionally, it now supports Mark Leisher's BDF extension for anti-aliased bitmap glyphs with 2 and 4 bpp. * src/bdf/*: New driver. * include/freetype/internal/bdftypes.h: New file. * include/freetype/internal/fttrace.h: Added BDF driver components. * include/freetype/fterrdef.h: Added error codes for BDF driver. * include/freetype/config/ftmodule.h, src/Jamfile: Updated. * include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H): New macro. * include/freetype/config/ftstdlib.h (ft_sprintf): New alias for sprintf. * include/freetype/internal/fttrace.h: Added Type 42 driver component. * src/type42/t42drivr.c: Use it. * include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H): New macro.
2002-05-21 16:13:01 +02:00
/* pitch :: The number of bytes per bitmap line. May be positive */
/* or negative. */
/* */
* src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/. (parse_font_matrix): Remove unnecessary code. (parse_sfnts): Initialize some variables. (t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use ft_module_driver_has_hinter conditionally. Moved some type 42 specific structure definitions to... * include/freetype/internal/t42types.h: New file. * include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H): New macro. * include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field `num_grays' for specifying the number of used gray levels. * src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it. Adding a driver for BDF fonts written by Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>. Heavily modified by me to better adapt it to FreeType, removing unneeded stuff. Additionally, it now supports Mark Leisher's BDF extension for anti-aliased bitmap glyphs with 2 and 4 bpp. * src/bdf/*: New driver. * include/freetype/internal/bdftypes.h: New file. * include/freetype/internal/fttrace.h: Added BDF driver components. * include/freetype/fterrdef.h: Added error codes for BDF driver. * include/freetype/config/ftmodule.h, src/Jamfile: Updated. * include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H): New macro. * include/freetype/config/ftstdlib.h (ft_sprintf): New alias for sprintf. * include/freetype/internal/fttrace.h: Added Type 42 driver component. * src/type42/t42drivr.c: Use it. * include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H): New macro.
2002-05-21 16:13:01 +02:00
/* xadvance :: The horizontal advance width in pixels. */
/* */
/* yadvance :: The vertical advance height in pixels. */
/* */
/* buffer :: A pointer to the bitmap pixels. */
/* */
2000-10-31 20:42:53 +01:00
typedef struct FTC_SBitRec_
{
FT_Byte width;
FT_Byte height;
FT_Char left;
FT_Char top;
FT_Byte format;
FT_Byte max_grays;
FT_Short pitch;
FT_Char xadvance;
FT_Char yadvance;
FT_Byte* buffer;
2000-10-31 21:42:18 +01:00
} FTC_SBitRec;
/*************************************************************************/
/* */
/* <Type> */
/* FTC_SBitCache */
/* */
/* <Description> */
/* A handle to a small bitmap cache. These are special cache objects */
/* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
/* much more efficient way than the traditional glyph image cache */
/* implemented by @FTC_ImageCache. */
/* */
typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
/*************************************************************************/
/* */
/* <Type> */
/* FTC_SBit_Cache */
/* */
/* <Description> */
/* DEPRECATED. Use @FTC_SBitCache instead. */
/* */
typedef FTC_SBitCache FTC_SBit_Cache;
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBitCache_New */
/* */
/* <Description> */
/* Creates a new cache to store small glyph bitmaps. */
/* */
/* <Input> */
/* manager :: A handle to the source cache manager. */
/* */
/* <Output> */
/* acache :: A handle to the new sbit cache. NULL in case of error. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FTC_SBitCache_New( FTC_Manager manager,
FTC_SBitCache *acache );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBitCache_Lookup */
/* */
/* <Description> */
/* Looks up a given small glyph bitmap in a given sbit cache and */
/* "lock" it to prevent its flushing from the cache until needed */
/* */
/* <Input> */
/* cache :: A handle to the source sbit cache. */
/* */
/* type :: A pointer to the glyph image type descriptor. */
/* */
/* gindex :: The glyph index. */
/* */
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The small bitmap descriptor and its bit buffer are owned by the */
/* cache and should never be freed by the application. They might */
/* as well disappear from memory on the next cache lookup, so don't */
/* treat them as persistent data. */
/* */
/* The descriptor's `buffer' field is set to 0 to indicate a missing */
/* glyph bitmap. */
/* */
/* If "anode" is _not_ NULL, it receives the address of the cache */
/* node containing the bitmap, after increasing its reference count. */
/* This ensures that the node (as well as the image) will always be */
/* kept in the cache until you call @FTC_Node_Unref to "release" it. */
/* */
/* If "anode" is NULL, the cache node is left unchanged, which means */
/* that the bitmap could be flushed out of the cache on the next */
/* call to one of the caching sub-system APIs. Don't assume that it */
/* is persistent! */
/* */
FT_EXPORT( FT_Error )
FTC_SBitCache_Lookup( FTC_SBitCache cache,
FTC_ImageType type,
FT_UInt gindex,
FTC_SBit *sbit,
FTC_Node *anode );
/* */
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBit_Cache_New */
/* */
/* <Description> */
/* DEPRECATED. Use @FTC_SBitCache_New instead. */
/* */
/* Creates a new cache to store small glyph bitmaps. */
/* */
/* <Input> */
/* manager :: A handle to the source cache manager. */
/* */
/* <Output> */
/* acache :: A handle to the new sbit cache. NULL in case of error. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FTC_SBit_Cache_New( FTC_Manager manager,
FTC_SBit_Cache *acache );
/*************************************************************************/
/* */
/* <Function> */
/* FTC_SBit_Cache_Lookup */
/* */
/* <Description> */
/* DEPRECATED. Use @FTC_SBitCache_Lookup instead. */
/* */
/* Looks up a given small glyph bitmap in a given sbit cache. */
/* */
/* <Input> */
/* cache :: A handle to the source sbit cache. */
/* */
/* desc :: A pointer to the glyph image descriptor. */
/* */
/* gindex :: The glyph index. */
/* */
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The small bitmap descriptor and its bit buffer are owned by the */
/* cache and should never be freed by the application. They might */
/* as well disappear from memory on the next cache lookup, so don't */
/* treat them as persistent data. */
/* */
/* The descriptor's `buffer' field is set to 0 to indicate a missing */
/* glyph bitmap. */
/* */
FT_EXPORT( FT_Error )
FTC_SBit_Cache_Lookup( FTC_SBit_Cache cache,
FTC_Image_Desc* desc,
FT_UInt gindex,
FTC_SBit *sbit );
FT_END_HEADER
#endif /* __FTCSBITS_H__ */
2000-10-31 20:42:53 +01:00
/* END */