#define NUMFACEBUCKETS 32
#define FONTSEGMENTSIZE 16
typedef struct {
int bit;
int byte;
int glyph;
int scan;
} FontBitmapFormatRec, *FontBitmapFormatPtr;
struct FTSize_s;
typedef struct _FTFace {
char *filename;
FT_Face face;
int bitmap;
struct _FTInstance *instances;
struct _FTInstance *active_instance;
struct _FTFace *next;
} FTFaceRec, *FTFacePtr;
typedef struct _FTNormalisedTransformation {
double scale;
int nonIdentity;
FT_Matrix matrix;
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_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
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;
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;
};
typedef struct _FTInstance {
FTFacePtr face;
FT_Size size;
FTNormalisedTransformationRec transformation;
FT_Int32 load_flags;
int spacing;
double pixel_size;
double pixel_width_unit_x;
double pixel_width_unit_y;
xCharInfo *charcellMetrics;
int averageWidth;
long rawAverageWidth;
double advance;
xCharInfo *forceConstantMetrics;
FontBitmapFormatRec bmfmt;
unsigned nglyphs;
CharInfoPtr *glyphs;
int **available;
struct TTCapInfo ttcap;
int refcount;
struct _FTInstance *next;
} FTInstanceRec, *FTInstancePtr;
typedef struct _FTFont{
FTInstancePtr instance;
FTMappingRec mapping;
unsigned zero_idx;
FontInfoPtr info;
int nranges;
CharInfoRec dummy_char;
fsRange *ranges;
} FTFontRec, *FTFontPtr;
static int FreeTypeOpenFace(FTFacePtr *facep, char *FTFileName, char *realFileName, int faceNumber);
static void FreeTypeFreeFace(FTFacePtr face);
static int
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, int flags, CharInfoPtr *g, FTInstancePtr instance);
static int
FreeTypeInstanceGetGlyphMetrics(unsigned idx, int flags,
xCharInfo **metrics, FTInstancePtr instance );
static int
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);
static int
FreeTypeAddProperties(FTFontPtr font, FontScalablePtr vals, FontInfoPtr info,
char *fontname, int rawAverageWidth, Bool font_properties);
static int FreeTypeFontGetGlyph(unsigned code, int flags, CharInfoPtr *g, FTFontPtr font);
static int
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 );