KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Character Drawing

Methods for rendering characters/icons. More...

Functions

size_t bfont_draw_ex (void *buffer, uint32_t bufwidth, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, uint32_t c, bool wide, bool iskana)
 Draw a single character of any sort to a buffer.
 
size_t bfont_draw (void *buffer, uint32_t bufwidth, bool opaque, uint32_t c)
 Draw a single character to a buffer.
 
size_t bfont_draw_thin (void *buffer, uint32_t bufwidth, bool opaque, uint32_t c, bool iskana)
 Draw a single thin character to a buffer.
 
size_t bfont_draw_wide (void *buffer, uint32_t bufwidth, bool opaque, uint32_t c)
 Draw a single wide character to a buffer.
 
size_t bfont_draw_vmu_icon_ex (void *buffer, uint32_t bufwidth, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, bfont_vmu_icon_t icon)
 Draw a VMU icon to the buffer.
 
size_t bfont_draw_vmu_icon (void *buffer, uint32_t bufwidth, bool opaque, bfont_vmu_icon_t icon)
 Draw a VMU icon to a buffer.
 
size_t bfont_draw_dc_icon_ex (void *buffer, uint32_t bufwidth, uint32_t fg, uint32_t bg, uint8_t bpp, bool opaque, bfont_dc_icon_t icon)
 Draw a DC icon to the buffer.
 
size_t bfont_draw_dc_icon (void *buffer, uint32_t bufwidth, bool opaque, bfont_dc_icon_t icon)
 Draw a DC icon to a buffer.
 

Detailed Description

Methods for rendering characters/icons.

Function Documentation

◆ bfont_draw()

size_t bfont_draw ( void * buffer,
uint32_t bufwidth,
bool opaque,
uint32_t 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.

Parameters
bufferThe buffer to draw to (at least 12 x 24 pixels)
bufwidthThe width of the buffer in pixels
opaqueIf true, overwrite blank areas with black, otherwise do not change them from what they are
cThe character to draw
Returns
Amount of width covered in bytes.

◆ bfont_draw_dc_icon()

size_t bfont_draw_dc_icon ( void * buffer,
uint32_t bufwidth,
bool opaque,
bfont_dc_icon_t icon )

Draw a DC icon to a buffer.

This function draws a 24x24 DC icon to the given buffer.

Parameters
bufferThe buffer to draw to (at least 24 x 24 pixels)
bufwidthThe width of the buffer in pixels
opaqueIf true, overwrite blank areas with black, otherwise do not change them from what they are
iconThe DC icon to draw
Returns
Amount of width covered in bytes.

◆ bfont_draw_dc_icon_ex()

size_t bfont_draw_dc_icon_ex ( void * buffer,
uint32_t bufwidth,
uint32_t fg,
uint32_t bg,
uint8_t bpp,
bool opaque,
bfont_dc_icon_t icon )

Draw a DC icon to the buffer.

This function draws a 24x24 DC icon to the given buffer, supporting multiple color depths (4, 8, 16, and 32 bits per pixel).

Parameters
bufferThe buffer to draw to (at least 24 x 24 pixels)
bufwidthThe width of the buffer in pixels
fgThe foreground color to use
bgThe background color to use
bppThe number of bits per pixel in the buffer
opaqueIf true, overwrite background areas with black, otherwise do not change them from what they are
iconThe DC icon to draw
Returns
Amount of width covered in bytes

◆ bfont_draw_ex()

size_t bfont_draw_ex ( void * buffer,
uint32_t bufwidth,
uint32_t fg,
uint32_t bg,
uint8_t bpp,
bool opaque,
uint32_t c,
bool wide,
bool iskana )

Draw a single character of any sort to a 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.

Parameters
bufferThe buffer to draw to
bufwidthThe width of the buffer in pixels
fgThe foreground color to use
bgThe background color to use
bppThe number of bits per pixel in the buffer
opaqueIf true, overwrite background areas with black, otherwise do not change them from what they are
cThe character to draw
wideDraw a wide character
iskanaDraw a half-width kana character
Returns
Amount of width covered in bytes

◆ bfont_draw_thin()

size_t bfont_draw_thin ( void * buffer,
uint32_t bufwidth,
bool opaque,
uint32_t c,
bool 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.

Parameters
bufferThe buffer to draw to (at least 12 x 24 pixels)
bufwidthThe width of the buffer in pixels
opaqueIf true, overwrite blank areas with black, otherwise do not change them from what they are
cThe character to draw
iskanaSet to 1 if the character is a kana, 0 if ISO-8859-1
Returns
Amount of width covered in bytes.

◆ bfont_draw_vmu_icon()

size_t bfont_draw_vmu_icon ( void * buffer,
uint32_t bufwidth,
bool opaque,
bfont_vmu_icon_t icon )

Draw a VMU icon to a buffer.

This function draws a 32x32 VMU icon to the given buffer.

Parameters
bufferThe buffer to draw to (at least 32 x 32 pixels)
bufwidthThe width of the buffer in pixels
opaqueIf true, overwrite blank areas with black, otherwise do not change them from what they are
iconThe VMU icon to draw
Returns
Amount of width covered in bytes.

◆ bfont_draw_vmu_icon_ex()

size_t bfont_draw_vmu_icon_ex ( void * buffer,
uint32_t bufwidth,
uint32_t fg,
uint32_t bg,
uint8_t bpp,
bool opaque,
bfont_vmu_icon_t icon )

Draw a VMU icon to the buffer.

This function draws a 32x32 VMU icon to the given buffer, supporting multiple color depths (4, 8, 16, and 32 bits per pixel).

Parameters
bufferThe buffer to draw to (at least 32 x 32 pixels)
bufwidthThe width of the buffer in pixels
fgThe foreground color to use
bgThe background color to use
bppThe number of bits per pixel in the buffer
opaqueIf true, overwrite background areas with black, otherwise do not change them from what they are
iconThe VMU icon to draw
Returns
Amount of width covered in bytes

◆ bfont_draw_wide()

size_t bfont_draw_wide ( void * buffer,
uint32_t bufwidth,
bool opaque,
uint32_t 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.

Parameters
bufferThe buffer to draw to (at least 24 x 24 pixels)
bufwidthThe width of the buffer in pixels
opaqueIf true, overwrite blank areas with black, otherwise do not change them from what they are
cThe character to draw
Returns
Amount of width covered in bytes.