41#include <mcp/syscalls.h>
49#define FONT_RECORD_SIZE 26
51#define FONT_CHAR_FOENIX_OUTLINE 0x11
52#define FONT_CHAR_CHECKMARK 0x12
53#define FONT_CHAR_DIAMOND 0x13
54#define FONT_CHAR_FOENIX_REG 0x14
55#define FONT_CHAR_MENU_RIGHT 0x15
56#define FONT_CHAR_MENU_RIGHT_WIDTH 7
153bool Font_DrawString(
Bitmap* the_bitmap,
char* the_string, int16_t max_chars);
166char*
Font_DrawStringInBox(
Bitmap* the_bitmap, int16_t width, int16_t height,
char* the_string, int16_t num_chars,
char** wrap_buffer,
bool (* continue_function)(
void));
177int16_t
Font_MeasureStringWidth(
Font* the_font,
char* the_string, int16_t num_chars, int16_t available_width, int16_t fixed_char_width, int16_t* measured_width);
198void Font_Print(
Font* the_font);
Font * Font_New(uint8_t *the_data, uint16_t data_size)
Create a Font object, and populate it from the passed buffer.
Definition: font.c:148
char * Font_DrawStringInBox(Bitmap *the_bitmap, int16_t width, int16_t height, char *the_string, int16_t num_chars, char **wrap_buffer, bool(*continue_function)(void))
Draw a string in a rectangular block on the screen, with wrap.
Definition: font.c:459
bool Font_Destroy(Font **the_font)
Definition: font.c:317
int16_t Font_MeasureStringWidth(Font *the_font, char *the_string, int16_t num_chars, int16_t available_width, int16_t fixed_char_width, int16_t *measured_width)
Calculates how many characters of the passed string will fit into the passed pixel width.
Definition: font.c:642
int16_t Font_DrawChar(Bitmap *the_bitmap, uint8_t the_char, Font *the_font)
Draw one character on the bitmap, at the current bitmap pen coordinates NOTE: if the draw action is s...
Definition: font.c:707
This Font object is essentially the Mac "fontRecord" struct, with added pointers for the data tables.
Definition: font.h:71
int16_t kernMax
negative of maximum character kern
Definition: font.h:76
int16_t descent
descent
Definition: font.h:82
int16_t leading
leading
Definition: font.h:83
int16_t nDescent
negative of descent
Definition: font.h:77
int16_t ascent
ascent
Definition: font.h:81
uint16_t * loc_table_
The location table.
Definition: font.h:86
int16_t widMax
maximum character width – Could be used if font is fixed-width
Definition: font.h:75
int16_t rowWords
row width of bit image / 2
Definition: font.h:84
int16_t fontType
Only bit we care about is the first. See https://developer.apple.com/library/archive/documentation/ma...
Definition: font.h:72
uint16_t * image_table_
The font image data.
Definition: font.h:85
int16_t firstChar
ASCII code of first character.
Definition: font.h:73
int16_t fRectWidth
width of font rectangle
Definition: font.h:78
uint16_t owTLoc
offset to offset/width table
Definition: font.h:80
int16_t lastChar
ASCII code of last character.
Definition: font.h:74
uint16_t * width_table_
Table containing h offset and widths for each glyph.
Definition: font.h:87
int16_t fRectHeight
height of font rectangle
Definition: font.h:79
uint16_t * height_table_
Table containing starting v offset and active v pixel count for each glyph.
Definition: font.h:88