KallistiOS git master
Independent SDK for the Sega Dreamcast
|
API for the Dreamcast's built-in BIOS font. More...
Modules | |
Dimensions of the Bios Font | |
Structure | |
Structure of the Bios Font. | |
Files | |
file | biosfont.h |
BIOS font drawing functions. | |
Functions | |
uint32 | bfont_set_foreground_color (uint32 c) |
Set the font foreground color. | |
uint32 | bfont_set_background_color (uint32 c) |
Set the font background color. | |
int | bfont_set_32bit_mode (int on) __depr("Please use the bpp function of the the bfont_draw_ex functions") |
Set the font to draw 32-bit color. | |
void | bfont_set_encoding (uint8 enc) |
Set the font encoding. | |
uint8 * | bfont_find_char (uint32 ch) |
Find an ISO-8859-1 character in the font. | |
uint8 * | bfont_find_char_jp (uint32 ch) |
Find an full-width Japanese character in the font. | |
uint8 * | bfont_find_char_jp_half (uint32 ch) |
Find an half-width Japanese character in the font. | |
unsigned char | bfont_draw_ex (uint8 *buffer, uint32 bufwidth, uint32 fg, uint32 bg, uint8 bpp, uint8 opaque, uint32 c, uint8 wide, uint8 iskana) |
Draw a single character of any sort to the buffer. | |
unsigned char | bfont_draw (void *buffer, uint32 bufwidth, uint8 opaque, uint32 c) |
Draw a single character to a buffer. | |
unsigned char | bfont_draw_thin (void *buffer, uint32 bufwidth, uint8 opaque, uint32 c, uint8 iskana) |
Draw a single thin character to a buffer. | |
unsigned char | bfont_draw_wide (void *buffer, uint32 bufwidth, uint8 opaque, uint32 c) |
Draw a single wide character to a buffer. | |
void | bfont_draw_str_ex (void *b, uint32 width, uint32 fg, uint32 bg, uint8 bpp, uint8 opaque, const char *str) |
Draw a full string to any sort of buffer. | |
void | bfont_draw_str (void *b, uint32 width, uint8 opaque, const char *str) |
Draw a full string to a buffer. | |
uint8 * | bfont_find_icon (uint8 icon) |
Find a VMU icon. | |
API for the Dreamcast's built-in BIOS font.
Draw a single character to a buffer.
This function draws a single character in the set encoding to the given buffer. Calling this is equivalent to calling bfont_draw_thin() with 0 for the final parameter.
buffer | The buffer to draw to (at least 12 x 24 pixels) |
bufwidth | The width of the buffer in pixels |
opaque | If non-zero, overwrite blank areas with black, otherwise do not change them from what they are |
c | The character to draw |
unsigned char bfont_draw_ex | ( | uint8 * | buffer, |
uint32 | bufwidth, | ||
uint32 | fg, | ||
uint32 | bg, | ||
uint8 | bpp, | ||
uint8 | opaque, | ||
uint32 | c, | ||
uint8 | wide, | ||
uint8 | iskana | ||
) |
Draw a single character of any sort to the buffer.
This function draws a single character in the set encoding to the given buffer. This function sits under draw, draw_thin, and draw_wide, while exposing the colors and bitdepths desired. This will allow the writing of bfont characters to paletted textures.
buffer | The buffer to draw to. |
bufwidth | The width of the buffer in pixels. |
fg | The foreground color to use. |
bg | The background color to use. |
bpp | The number of bits per pixel in the buffer. |
opaque | If non-zero, overwrite background areas with black, otherwise do not change them from what they are. |
c | The character to draw. |
wide | Draw a wide character. |
iskana | Draw a half-width kana character. |
Draw a full string to a buffer.
This function draws a NUL-terminated string in the set encoding to the given buffer. This will automatically handle mixed half and full-width characters if the encoding is set to one of the Japanese encodings. Draws pre-set 16-bit colors.
b | The buffer to draw to. |
width | The width of the buffer in pixels. |
opaque | If one, overwrite blank areas with bfont_bgcolor, otherwise do not change them from what they are. |
str | The string to draw. |
void bfont_draw_str_ex | ( | void * | b, |
uint32 | width, | ||
uint32 | fg, | ||
uint32 | bg, | ||
uint8 | bpp, | ||
uint8 | opaque, | ||
const char * | str | ||
) |
Draw a full string to any sort of buffer.
This function draws a NUL-terminated string in the set encoding to the given buffer. This will automatically handle mixed half and full-width characters if the encoding is set to one of the Japanese encodings. Colors and bitdepth can be set.
b | The buffer to draw to. |
width | The width of the buffer in pixels. |
fg | The foreground color to use. |
bg | The background color to use. |
bpp | The number of bits per pixel in the buffer. |
opaque | If non-zero, overwrite background areas with black, otherwise do not change them from what they are. |
str | The string to draw. |
unsigned char bfont_draw_thin | ( | void * | buffer, |
uint32 | bufwidth, | ||
uint8 | opaque, | ||
uint32 | c, | ||
uint8 | iskana | ||
) |
Draw a single thin character to a buffer.
This function draws a single character in the set encoding to the given buffer. This only works with ISO-8859-1 characters and half-width kana.
buffer | The buffer to draw to (at least 12 x 24 pixels) |
bufwidth | The width of the buffer in pixels |
opaque | If non-zero, overwrite blank areas with black, otherwise do not change them from what they are |
c | The character to draw |
iskana | Set to 1 if the character is a kana, 0 if ISO-8859-1 |
Draw a single wide character to a buffer.
This function draws a single character in the set encoding to the given buffer. This only works with full-width kana and kanji.
buffer | The buffer to draw to (at least 24 x 24 pixels) |
bufwidth | The width of the buffer in pixels |
opaque | If non-zero, overwrite blank areas with black, otherwise do not change them from what they are |
c | The character to draw |
Find an ISO-8859-1 character in the font.
This function retrieves a pointer to the font data for the specified character in the font, if its available. Generally, you will not have to use this function, use one of the bfont_draw_* functions instead.
ch | The character to look up |
Find an full-width Japanese character in the font.
This function retrieves a pointer to the font data for the specified character in the font, if its available. Generally, you will not have to use this function, use one of the bfont_draw_* functions instead.
This function deals with full-width kana and kanji.
ch | The character to look up |
Find an half-width Japanese character in the font.
This function retrieves a pointer to the font data for the specified character in the font, if its available. Generally, you will not have to use this function, use one of the bfont_draw_* functions instead.
This function deals with half-width kana only.
ch | The character to look up |
Find a VMU icon.
This function retrieves a pointer to the icon data for the specified VMU icon in the bios, if its available. The icon data is flipped both vertically and horizontally. Each vmu icon has dimensions 32x32 pixels and is 128 bytes long.
icon | The icon to look up. Use BFONT_ICON_* values starting with BFONT_ICON_INVALID_VMU. |
int bfont_set_32bit_mode | ( | int | on | ) |
Set the font to draw 32-bit color.
This function changes whether the font draws colors as 32-bit or 16-bit. The default is to use 16-bit.
on | Set to 0 to use 16-bit color, 32-bit otherwise. |
Set the font background color.
This function selects the background color to draw when a pixel is drawn in the font. This color is only used for pixels not covered by the font when you have selected to have the font be opaque.
c | The color to use. |
void bfont_set_encoding | ( | uint8 | enc | ) |
Set the font encoding.
This function selects the font encoding that is used for the font. This allows you to select between the various character sets available.
enc | The character encoding in use |
Set the font foreground color.
This function selects the foreground color to draw when a pixel is opaque in the font. The value passed in for the color should be in whatever pixel format that you intend to use for the image produced.
c | The color to use. |