Font functions
This module contains functions related to font drawing . (../include/degfx/font.h)
!Builtin 8x8 font (../include/degfx/font.h)
!Builtin 8x14 font (../include/degfx/font.h)
!Builtin 8x16 font (../include/degfx/font.h)
Part of the degfx library.
MX_FONT
A font
void mx_font_default(MX_FONT* font)
Set the default font
void mx_font_bitmap_draw(const MX_FONT* font, struct MX_BITMAP* bitmap, const char* text, int len, int x, const int y, const MX_PIXEL fore)
Draw text onto a bitmap
void mx_font_bitmap_drawblock(const MX_FONT* font, struct MX_BITMAP* bitmap, const char* text, int len, int x, int y, const MX_PIXEL fore)
Draw a block of text onto a bitmap
#define mx_font_draw(f,t,l,x,y,fore)
Draw text onto the screen
#define mx_font_drawblock(f,t,l,x,y,fore)
Draw a block of text onto the screen
unsigned int mx_font_height(const MX_FONT* font)
Return the height of a font
(../include/degfx/font.h)
!The height in pixels of a font
This function return the height of a font in pixels.
(../include/degfx/font/fontsize.c)
If the font argument is 0 then the default font be used. (../include/degfx/font/fontsize.c)
unsigned int mx_font_width(const MX_FONT* font, const char* text, int len)
Return the width of a portion of text
void mx_font_blocksize(const MX_FONT* font, const char* text, int len, int* tw, int* th, int* last)
Return the size of a block for a portion of text
(../include/degfx/font.h)
The size in pixels of multi-line text
This function determines the area in pixels required to draw text on
a bitamp using mx_font_bitmap_drawblock().
(../include/degfx/font/block.c)
If the font argument is 0 then the default font be used. (../include/degfx/font/block.c)
void mx_font_bitmap_drawblock(const MX_FONT* font, MX_BITMAP* bitmap, const char* text, int len, int x, int y, const MX_PIXEL fore)
Draw multi-line text onto a bitmap
This function draws text on a bitamp. Newline characters (\r or \r\n) cause the following text to be placed on the following line. (../include/degfx/font/block.c)
If the font argument is 0 then the default font be used. (../include/degfx/font/block.c)
The function mx_font_bitmap_draw() function is used internally to draw the individual text lines. (../include/degfx/font/block.c)
void mx_font_bitmap_draw(const MX_FONT* font, MX_BITMAP* bitmap, const char* text, int len, int x, const int y, const MX_PIXEL fore)
Draw text onto a bitmap
This function draws text on a bitmap at a specific position using a specified font and color. Only the foreground color is drawn, the pixels 'behind' the text are not drawn. (../include/degfx/font/fontdraw.c)
If the font argument is 0 then the default font is used. (../include/degfx/font/fontdraw.c)
If the length argument is less than zero then the string is assumed to be zero terminated (../include/degfx/font/fontdraw.c)
The text drawing is made efficient by skipping text, or portions of text that will be clipped. (../include/degfx/font/fontdraw.c)
unsigned int mx_font_width(const MX_FONT* font, const char* text, int num)
The width in pixels of some text
This function return the width of a portion of text in pixels. (../include/degfx/font/fontsize.c)
If the font argument is 0 then the default font be used. (../include/degfx/font/fontsize.c)
If the length of characters is less than 0 then the text is assumed to be zero terminated. (../include/degfx/font/fontsize.c)
MX_FONT* mx_font_bitmap(const MX_BITMAP* bitmap, int start)
Load a font from a bitmap.
MX_FONT* mx_font_pcx(const char* filename, int start)
Load a font from a PCX file.
Generated by MXDOC 2.2 on Sun Feb 4 15:16:26 2007