From 815a8995d0382e8a44b43d9707b191974d590370 Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 16 Jan 2004 09:07:59 +0000 Subject: [PATCH] * include/freetype/ftcache.h, include/freetype/cache/ftcmanag.h: adding FTC_Manager_LookupSize and FTC_Scaler to the public API (they were previously hidden) --- include/freetype/cache/ftcmanag.h | 18 ------ include/freetype/ftcache.h | 92 ++++++++++++++++++++++++++++++- 2 files changed, 90 insertions(+), 20 deletions(-) diff --git a/include/freetype/cache/ftcmanag.h b/include/freetype/cache/ftcmanag.h index ba8680046..68eebef65 100644 --- a/include/freetype/cache/ftcmanag.h +++ b/include/freetype/cache/ftcmanag.h @@ -151,18 +151,6 @@ FT_BEGIN_HEADER /* */ - typedef struct FTC_ScalerRec_ - { - FTC_FaceID face_id; - FT_UInt width; - FT_UInt height; - FT_Int pixel; - FT_UInt x_res; - FT_UInt y_res; - - } FTC_ScalerRec, *FTC_Scaler; - - #define FTC_SCALER_COMPARE( a, b ) \ ( (a)->face_id == (b)->face_id && \ (a)->width == (b)->width && \ @@ -177,12 +165,6 @@ FT_BEGIN_HEADER (q)->width + (q)->height*7 + \ ( (q)->pixel ? 0 : ( (q)->x_res*33 ^ (q)->y_res*61 ) ) ) - - FT_EXPORT( FT_Error ) - FTC_Manager_LookupSize( FTC_Manager manager, - FTC_Scaler scaler, - FT_Size *asize ); - /* */ FT_END_HEADER diff --git a/include/freetype/ftcache.h b/include/freetype/ftcache.h index 6312f06ca..d6a6abc6f 100644 --- a/include/freetype/ftcache.h +++ b/include/freetype/ftcache.h @@ -64,7 +64,7 @@ FT_BEGIN_HEADER /* */ /* FTC_Manager_New */ /* FTC_Manager_LookupFace */ - /* FTC_Manager_Lookup_Size */ + /* FTC_Manager_LookupSize */ /* */ /* FTC_Node */ /* FTC_Node_Ref */ @@ -342,7 +342,7 @@ FT_BEGIN_HEADER /* */ /* The @FT_Face object doesn't necessarily have a current size object */ /* (i.e., face->size can be 0). If you need a specific `font size', */ - /* use @FTC_Manager_Lookup_Size instead. */ + /* use @FTC_Manager_LookupSize instead. */ /* */ /* Never change the face's transformation matrix (i.e., never call */ /* the @FT_Set_Transform function) on a returned face! If you need */ @@ -354,6 +354,94 @@ FT_BEGIN_HEADER FT_Face *aface ); + /*************************************************************************/ + /* */ + /* */ + /* FTC_Scaler */ + /* */ + /* */ + /* Handle to a @FTC_ScalerRec structure. */ + /* */ + typedef struct FTC_FaceIDRec_* FTC_FaceID; + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_ScalerRec */ + /* */ + /* */ + /* A structure used to describe a given character size in either */ + /* pixels or points to the cache manager. See @FTC_Manager_LookupSize */ + /* */ + /* */ + /* face_id :: source face id */ + /* */ + /* width :: character width */ + /* */ + /* height :: character height */ + /* */ + /* pixel :: booelan. If TRUE, the "width" and "height" fields */ + /* are interpreted as integer pixel character sizes. */ + /* If false, they are expressed as 1/64th of points */ + /* */ + /* x_res :: only used when 'pixel' is FALSE. indicates the */ + /* horizontal resolution in dpis */ + /* */ + /* y_res :: only used when 'pixel' is FALSE. indicates the */ + /* vertical resolution in dpis */ + /* */ + /* */ + /* This type is mainly used to retrieve @FT_Size objects through the */ + /* cache manager. */ + /* */ + typedef struct FTC_ScalerRec_ + { + FTC_FaceID face_id; + FT_UInt width; + FT_UInt height; + FT_Int pixel; + FT_UInt x_res; + FT_UInt y_res; + + } FTC_ScalerRec, *FTC_Scaler; + + + + /*************************************************************************/ + /* */ + /* */ + /* FTC_Manager_LookupSize */ + /* */ + /* */ + /* Retrieves the @FT_Size object that corresponds to a given */ + /* @FTC_Scaler through a cache manager. */ + /* */ + /* */ + /* manager :: A handle to the cache manager. */ + /* */ + /* scaler :: scaler handle. */ + /* */ + /* */ + /* asize :: A handle to the size object. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + /* */ + /* The returned @FT_Size object is always owned by the manager. You */ + /* should never try to discard it yourself. */ + /* */ + /* You can access the parent @FT_Face object simply as "size->face" */ + /* if you need it. Note that this object is also owner by the */ + /* manager. */ + /* */ + FT_EXPORT( FT_Error ) + FTC_Manager_LookupSize( FTC_Manager manager, + FTC_Scaler scaler, + FT_Size *asize ); + + /*************************************************************************/ /* */ /* */