25 * glyphs[n] unicode character numbers (int)
26 * bitmaps[n] character bitmaps (char[rows * cols])
38 fd
= open(TINYFONT
, O_RDONLY
);
41 fcntl(fd
, F_SETFD
, fcntl(fd
, F_GETFD
) | FD_CLOEXEC
);
42 if (read(fd
, &head
, sizeof(head
)) != sizeof(head
))
47 glyphs
= malloc(n
* sizeof(int));
48 if (read(fd
, glyphs
, n
* sizeof(int)) != n
* sizeof(int))
53 static int find_glyph(int c
)
69 int font_bitmap(void *dst
, int c
)
71 int i
= find_glyph(c
);
74 lseek(fd
, sizeof(struct tinyfont
) + n
* sizeof(int) + i
* rows
* cols
, 0);
75 read(fd
, dst
, rows
* cols
);