ref: 2296ee3d37775d6cfd87ed27dfee46cb9b85b12b
dir: /otf.h.in/
/* this file is generated. do not modify. */ typedef struct Otf Otf; #ifdef __unix__ #include <stdint.h> typedef int8_t s8int; typedef int16_t s16int; typedef int32_t s32int; typedef int64_t s64int; typedef uint8_t u8int; typedef uint16_t u16int; typedef uint32_t u32int; typedef uint64_t u64int; typedef uint32_t Rune; char *otferrstr(void); #else #pragma incomplete Otf #endif typedef struct Otfile Otfile; struct Otfile { void *aux; int (*seek)(void *aux, int off, int whence); int (*read)(void *aux, void *dst, int sz); int (*write)(void *aux, const void *src, int sz); int (*print)(void *aux, const char *fmt, ...); }; typedef struct RuneMapper RuneMapper; struct RuneMapper { int (*rune2glyph)(void *aux,Rune r); Rune (*glyph2rune)(void *aux, int g); void *aux; }; #define NoRune (~(Rune)0) enum { GLYPH_EMPTY, GLYPH_SIMPLE, GLYPH_COMPONENT, GLYPH_BITMAP, }; typedef struct BitmapGlyph BitmapGlyph; typedef struct EbdtComponent EbdtComponent; struct BitmapGlyph { int bitDepth; int format; int offset; int size; int pitchBits; int ppemX; int ppemY; int numComponents; EbdtComponent *components; u8int image[]; }; typedef struct ComponentGlyph ComponentGlyph; enum { CGLYPH_FL_SIGNED_XY = 1<<1, CGLYPH_FL_ROUND_TO_GRID_XY = 1<<2, CGLYPH_FL_MORE_COMPONENTS = 1<<5, CGLYPH_FL_SCALE_XY = 1<<6, CGLYPH_FL_2X2_TRANSFORM = 1<<7, CGLYPH_FL_INSTRUCTIONS = 1<<8, CGLYPH_FL_METRICS = 1<<9, CGLYPH_FL_SCALED_COMPONENT_OFFSET = 1<<11, }; struct ComponentGlyph { u16int flags; u16int glyphIndex; union { int arg1; int dx; }; union { int arg2; int dy; }; float scaleX, scale01, scale10, scaleY; u16int numInstr; u8int *instr; ComponentGlyph *next; }; typedef struct Point Point; struct Point { int x; int y; int onCurve; }; typedef struct SimpleGlyph SimpleGlyph; struct SimpleGlyph { int numEndPtsOfContours; u16int *endPtsOfContours; u16int instructionLength; u8int *instructions; int numPoints; Point *points; }; extern int indentΔ; Otf *otfopen(Otfile *in); void otfprint(Otf *o, Otfile *out, int indent); void otfclose(Otf *o); /* * FIXME this API *will* change, maybe not even once. * atm it's just to get things going, for a start. */ typedef struct Glyf Glyf; typedef struct GlyfImage GlyfImage; typedef struct RasterOpts RasterOpts; typedef struct SubPx SubPx; enum { GLYF_FMT_GREY_8, GLYF_FMT_RGB_24, }; enum { LCD_ORDER_RGB, LCD_ORDER_BGR, }; struct GlyfImage { int w; int h; int baseline; int fmt; u8int b[]; }; struct SubPx { struct { u8int *c; int nc; }fir; int lcdorder; int lcdvert; u8int *buf; int bufsz; }; struct RasterOpts { double ppemX; double ppemY; SubPx *subpx; }; int otfglyfnum(Otf *o); int otfrune2glyph(Otf *o, Rune r); Rune otfglyph2rune(Otf *o, int g); Glyf *otfglyf(Otf *o, int index, RasterOpts *opts); GlyfImage *otfdrawglyf(Otf *o, Glyf *g, RasterOpts *opts);