4
static inline unsigned short get_USHORT(const char *buf) // {{{
6
return ((unsigned char)buf[0]<<8)|((unsigned char)buf[1]);
9
static inline short get_SHORT(const char *buf) // {{{
11
return (buf[0]<<8)|((unsigned char)buf[1]);
14
static inline unsigned int get_UINT24(const char *buf) // {{{
16
return ((unsigned char)buf[0]<<16)|
17
((unsigned char)buf[1]<<8)|
18
((unsigned char)buf[2]);
21
static inline unsigned int get_ULONG(const char *buf) // {{{
23
return ((unsigned char)buf[0]<<24)|
24
((unsigned char)buf[1]<<16)|
25
((unsigned char)buf[2]<<8)|
26
((unsigned char)buf[3]);
29
static inline int get_LONG(const char *buf) // {{{
32
((unsigned char)buf[1]<<16)|
33
((unsigned char)buf[2]<<8)|
34
((unsigned char)buf[3]);
38
static inline void set_USHORT(char *buf,unsigned short val) // {{{
44
static inline void set_ULONG(char *buf,unsigned int val) // {{{
47
buf[1]=(val>>16)&0xff;
53
static inline int get_width_fast(OTF_FILE *otf,int gid) // {{{
55
if (gid>=otf->numberOfHMetrics) {
56
return get_USHORT(otf->hmtx+(otf->numberOfHMetrics-1)*4);
58
return get_USHORT(otf->hmtx+gid*4);
63
int otf_load_glyf(OTF_FILE *otf); // - 0 on success
64
int otf_load_more(OTF_FILE *otf); // - 0 on success
66
int otf_action_copy(void *param,int csum,OUTPUT_FN output,void *context);
67
int otf_action_copy_head(void *param,int csum,OUTPUT_FN output,void *context);
68
int otf_action_replace(void *param,int csum,OUTPUT_FN output,void *context);
72
int (*action)(void *param,int length,OUTPUT_FN output,void *context); // -1 on error, num_bytes_written on success; if >output==NULL return checksum in (unsigned int *)context instead.
77
int otf_write_sfnt(struct _OTF_WRITE *otw,unsigned int version,int numTables,OUTPUT_FN output,void *context);