diff options
Diffstat (limited to 'src/FreeType/ftfuncs.h')
-rw-r--r-- | src/FreeType/ftfuncs.h | 94 |
1 files changed, 78 insertions, 16 deletions
diff --git a/src/FreeType/ftfuncs.h b/src/FreeType/ftfuncs.h index 6d57abe..a08d521 100644 --- a/src/FreeType/ftfuncs.h +++ b/src/FreeType/ftfuncs.h @@ -1,5 +1,6 @@ /* Copyright (c) 1998-2002 by Juliusz Chroboczek +Copyright (c) 2003 After X-TT Project, All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,7 +20,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/lib/font/FreeType/ftfuncs.h,v 1.12 2002/10/01 00:02:10 alanh Exp $ */ +/* $XFree86: xc/lib/font/FreeType/ftfuncs.h,v 1.16 2003/11/02 04:30:56 dawes Exp $ */ /* Number of buckets in the hashtable holding faces */ #define NUMFACEBUCKETS 32 @@ -45,6 +46,7 @@ struct FTSize_s; typedef struct _FTFace { char *filename; FT_Face face; + int bitmap; struct _FTInstance *instances; struct _FTInstance *active_instance; struct _FTFace *next; /* link to next face in bucket */ @@ -58,14 +60,58 @@ typedef struct _FTNormalisedTransformation { int xres, yres; } FTNormalisedTransformationRec, *FTNormalisedTransformationPtr; +#define FT_PROPORTIONAL 0 #define FT_MONOSPACED 1 #define FT_CHARCELL 2 #define FT_AVAILABLE_UNKNOWN 0 #define FT_AVAILABLE_NO 1 -#define FT_AVAILABLE_YES 2 +#define FT_AVAILABLE_METRICS 2 #define FT_AVAILABLE_RASTERISED 3 +#define FT_GET_GLYPH_BOTH 0x01 +#define FT_GET_GLYPH_METRICS_ONLY 0x02 +#define FT_GET_DUMMY 0x04 +#define FT_FORCE_CONSTANT_SPACING 0x08 + +#define TTCAP_DOUBLE_STRIKE 0x0001 +#define TTCAP_DOUBLE_STRIKE_MKBOLD_EDGE_LEFT 0x0002 +#define TTCAP_DOUBLE_STRIKE_CORRECT_B_BOX_WIDTH 0x0008 +#define TTCAP_IS_VERY_LAZY 0x0010 +#define TTCAP_DISABLE_DEFAULT_VERY_LAZY 0x0020 +#define TTCAP_FORCE_C_LSB_FLAG 0x0100 +#define TTCAP_FORCE_C_RSB_FLAG 0x0200 +#define TTCAP_FORCE_C_OUTSIDE 0x0400 +#define TTCAP_MONO_CENTER 0x0800 + +/* TTCap */ +struct TTCapInfo { + long flags; + double autoItalic; + double scaleWidth; + double scaleBBoxWidth; + double scaleBBoxHeight; + int doubleStrikeShift; + int adjustBBoxWidthByPixel; + int adjustLeftSideBearingByPixel; + int adjustRightSideBearingByPixel; + double scaleBitmap; + int forceConstantSpacingBegin; + int forceConstantSpacingEnd; + /* We don't compare */ + int force_c_adjust_width_by_pixel; + int force_c_adjust_lsb_by_pixel; + int force_c_adjust_rsb_by_pixel; + int force_c_representative_metrics_char_code; + double force_c_scale_b_box_width; + double force_c_scale_b_box_height; + double force_c_scale_lsb; + double force_c_scale_rsb; + double vl_slant; + int lsbShiftOfBitmapAutoItalic; + int rsbShiftOfBitmapAutoItalic; +}; + /* An instance builds on a face by specifying the transformation matrix. Multiple fonts may share the same instance. */ @@ -74,13 +120,21 @@ typedef struct _FTInstance { FTFacePtr face; /* the associated face */ FT_Size size; FTNormalisedTransformationRec transformation; - int monospaced; - int width; /* the width of all glyphs if monospaced */ - xCharInfo *charcellMetrics; /* the metrics if charcell is 1 */ + FT_Int32 load_flags; + int spacing; /* actual spacing */ + double pixel_size; /* to calc attributes (actual height) */ + double pixel_width_unit_x; /* to calc horiz. width (cosine) */ + double pixel_width_unit_y; /* to calc vert. width (cosine) */ + xCharInfo *charcellMetrics; /* the header's metrics */ + int averageWidth; /* the header's metrics */ + long rawAverageWidth; /* the header's metrics */ + double advance; /* the header's metrics */ + xCharInfo *forceConstantMetrics; FontBitmapFormatRec bmfmt; unsigned nglyphs; CharInfoPtr *glyphs; /* glyphs and available are used in parallel */ int **available; + struct TTCapInfo ttcap; int refcount; struct _FTInstance *next; /* link to next instance */ } FTInstanceRec, *FTInstancePtr; @@ -90,23 +144,30 @@ typedef struct _FTInstance { typedef struct _FTFont{ FTInstancePtr instance; FTMappingRec mapping; + unsigned zero_idx; + FontInfoPtr info; int nranges; fsRange *ranges; } FTFontRec, *FTFontPtr; /* Prototypes for some local functions */ -static int FreeTypeOpenFace(FTFacePtr *facep, char *fileName); +static int FreeTypeOpenFace(FTFacePtr *facep, char *FTFileName, char *realFileName, int faceNumber); static void FreeTypeFreeFace(FTFacePtr face); static int - FreeTypeOpenInstance(FTInstancePtr *instancep, - char *fileName, FTNormalisedTransformationPtr trans, - int charcell, FontBitmapFormatPtr bmfmt); +FreeTypeOpenInstance(FTInstancePtr *instancep, FTFacePtr face, + char *FTFileName, FTNormalisedTransformationPtr trans, + int spacing, FontBitmapFormatPtr bmfmt, + struct TTCapInfo *tmp_ttcap, FT_Int32 load_flags); static void FreeTypeFreeInstance(FTInstancePtr instance); static int - FreeTypeInstanceGetGlyph(unsigned idx, CharInfoPtr *g, FTInstancePtr instance); +FreeTypeInstanceGetGlyph(unsigned idx, int flags, CharInfoPtr *g, FTInstancePtr instance); +static int +FreeTypeInstanceGetGlyphMetrics(unsigned idx, int flags, + xCharInfo **metrics, FTInstancePtr instance ); static int -FreeTypeRasteriseGlyph(CharInfoPtr tgp, FTInstancePtr instance, int hasMetrics); +FreeTypeRasteriseGlyph(unsigned idx, int flags, CharInfoPtr tgp, + FTInstancePtr instance, int hasMetrics ); static void FreeTypeFreeFont(FTFontPtr font); static void FreeTypeFreeXFont(FontPtr pFont, int freeProps); static void FreeTypeUnloadXFont(FontPtr pFont); @@ -114,9 +175,10 @@ static int FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info, char *fontname, int rawAverageWidth); -static int FreeTypeFontGetGlyph(unsigned code, CharInfoPtr *g, FTFontPtr font); -static int FreeTypeFontGetDefaultGlyph(CharInfoPtr *g, FTFontPtr font); +static int FreeTypeFontGetGlyph(unsigned code, int flags, CharInfoPtr *g, FTFontPtr font); static int -FreeTypeLoadFont(FTFontPtr *fontp, char *fileName, - FontScalablePtr vals, FontEntryPtr entry, - FontBitmapFormatPtr bmfmt); +FreeTypeLoadFont(FTFontPtr font, FontInfoPtr info, FTFacePtr face, + char *FTFileName, FontScalablePtr vals, FontEntryPtr entry, + FontBitmapFormatPtr bmfmt, FT_Int32 load_flags, + struct TTCapInfo *tmp_ttcap, char *dynStrTTCapCodeRange, + int ttcap_spacing ); |