GBAlatro
A Demake of Balatro for the GBA
Loading...
Searching...
No Matches
font.h File Reference

Utility file to interact with custom font. More...

Go to the source code of this file.

Macros

Decimal Point Fonts

A set of macros to map the fonts decimal-point values (e.g. ".1") to their replaced characters.

"FP#" -> Font "Point" "number"

For example:

tte_printf("Testing " FP0_STR " Something!");

prints "Testing .0 Something!"

The map is the following:

'&' == '.0'
'^' == '.1'
'}' == '.2'
'{' == '.3'
'|' == '.4'
'`' == '.5'
'<' == '.6'
'>' == '.7'
'_' == '.8'
';' == '.9'
#define FP0_STR   "&"
 
#define FP1_STR   "^"
 
#define FP2_STR   "}"
 
#define FP3_STR   "{"
 
#define FP4_STR   "|"
 
#define FP5_STR   "`"
 
#define FP6_STR   "<"
 
#define FP7_STR   ">"
 
#define FP8_STR   "_"
 
#define FP9_STR   ";"
 

Functions

const char * get_font_point_str (int val)
 Get the decimal point string equivalent of 0-9 from integer param.
 
char digit_char_to_font_point (char digit_char)
 Get the decimal point char equivalent of 0-9 from char param.
 

Detailed Description

Utility file to interact with custom font.

Definition in file font.h.

Macro Definition Documentation

◆ FP0_STR

#define FP0_STR   "&"

Definition at line 39 of file font.h.

◆ FP1_STR

#define FP1_STR   "^"

Definition at line 40 of file font.h.

◆ FP2_STR

#define FP2_STR   "}"

Definition at line 41 of file font.h.

◆ FP3_STR

#define FP3_STR   "{"

Definition at line 42 of file font.h.

◆ FP4_STR

#define FP4_STR   "|"

Definition at line 43 of file font.h.

◆ FP5_STR

#define FP5_STR   "`"

Definition at line 44 of file font.h.

◆ FP6_STR

#define FP6_STR   "<"

Definition at line 45 of file font.h.

◆ FP7_STR

#define FP7_STR   ">"

Definition at line 46 of file font.h.

◆ FP8_STR

#define FP8_STR   "_"

Definition at line 47 of file font.h.

◆ FP9_STR

#define FP9_STR   ";"

Definition at line 48 of file font.h.

Function Documentation

◆ digit_char_to_font_point()

char digit_char_to_font_point ( char  digit_char)

Get the decimal point char equivalent of 0-9 from char param.

Parameters
digit_charA char of a digit between '0'-'9' to get '.0' to '.9' equivalents. Note that if a char outside of range is passed it the return value will be within limits but is not defined with any relationship to the input.
Returns
A char representing a value in the font within the range of '.0' to '.9'

Definition at line 26 of file font.c.

◆ get_font_point_str()

const char * get_font_point_str ( int  val)

Get the decimal point string equivalent of 0-9 from integer param.

Parameters
valValue between 0-9 to get ".0" to ".9" equivalents. Note that if a value outside of range is passed it will perform '% 10' on that value and the last decimal digit will be used.
Returns
A char* to the string values of '.0' to '.9'

Definition at line 20 of file font.c.