|
KallistiOS
##version##
|
BIOS font drawing functions. More...
Go to the source code of this file.
Macros | |
| #define | BFONT_CODE_ISO8859_1 0 |
| ISO-8859-1 (western) charset. More... | |
| #define | BFONT_CODE_EUC 1 |
| EUC-JP charset. More... | |
| #define | BFONT_CODE_SJIS 2 |
| Shift-JIS charset. More... | |
Functions | |
| uint32 | bfont_set_foreground_color (uint32 c) |
| Set the font foreground color. More... | |
| uint32 | bfont_set_background_color (uint32 c) |
| Set the font background color. More... | |
| int | bfont_set_32bit_mode (int on) |
| Set the font to draw 32-bit color. More... | |
| void | bfont_set_encoding (int enc) |
| Set the font encoding. More... | |
| uint8 * | bfont_find_char (int ch) |
| Find an ISO-8859-1 character in the font. More... | |
| uint8 * | bfont_find_char_jp (int ch) |
| Find an full-width Japanese character in the font. More... | |
| uint8 * | bfont_find_char_jp_half (int ch) |
| Find an half-width Japanese character in the font. More... | |
| void | bfont_draw (void *buffer, int bufwidth, int opaque, int c) |
| Draw a single character to a buffer. More... | |
| void | bfont_draw_thin (void *buffer, int bufwidth, int opaque, int c, int iskana) |
| Draw a single thin character to a buffer. More... | |
| void | bfont_draw_wide (void *buffer, int bufwidth, int opaque, int c) |
| Draw a single wide character to a buffer. More... | |
| void | bfont_draw_str (void *buffer, int width, int opaque, char *str) |
| Draw a full string to a buffer. More... | |
BIOS font drawing functions.
This file provides support for utilizing the font built into the Dreamcast's BIOS. These functions allow access to both the western character set and Japanese characters.
| #define BFONT_CODE_EUC 1 |
EUC-JP charset.
| #define BFONT_CODE_ISO8859_1 0 |
ISO-8859-1 (western) charset.
| #define BFONT_CODE_SJIS 2 |
Shift-JIS charset.
| void bfont_draw | ( | void * | buffer, |
| int | bufwidth, | ||
| int | opaque, | ||
| int | c | ||
| ) |
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 |
| void bfont_draw_str | ( | void * | buffer, |
| int | width, | ||
| int | opaque, | ||
| char * | str | ||
| ) |
Draw a full string to a buffer.
This function draws a NUL-terminated string in the set encoding to the given buffer. This will automatially handle mixed half and full-width characters if the encoding is set to one of the Japanese encodings.
| buffer | The buffer to draw to |
| width | 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 |
| str | The string to draw |
| void bfont_draw_thin | ( | void * | buffer, |
| int | bufwidth, | ||
| int | opaque, | ||
| int | c, | ||
| int | 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 |
| void bfont_draw_wide | ( | void * | buffer, |
| int | bufwidth, | ||
| int | opaque, | ||
| int | c | ||
| ) |
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 |
| uint8* bfont_find_char | ( | int | ch | ) |
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 |
| uint8* bfont_find_char_jp | ( | int | ch | ) |
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 |
| uint8* bfont_find_char_jp_half | ( | int | ch | ) |
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 |
| 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 | ( | int | 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. |
1.8.7