L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
font.h File Reference

Bitmap font renderer header file. More...

+ Include dependency graph for font.h:

Go to the source code of this file.

Macros

#define GFXBITMAP_DEFAULT_FONT   (void *)0
 Constant to use for the default font.
 

Typedefs

typedef void * gfxbitmap_font_t
 Font.
 

Enumerations

enum  
 Constant for length field. More...
 

Functions

int gfxbitmap_font_init (void)
 Initialize the library.
 
gfxbitmap_font_t gfxbitmap_font_get (const char *name)
 Get a font descriptor.
 
unsigned gfxbitmap_font_width (gfxbitmap_font_t font)
 Get the font width.
 
unsigned gfxbitmap_font_height (gfxbitmap_font_t font)
 Get the font height.
 
void * gfxbitmap_font_data (gfxbitmap_font_t font, unsigned c)
 Get bitmap font data for a specific character.
 
void gfxbitmap_font_text (void *fb, l4re_video_view_info_t *vi, gfxbitmap_font_t font, const char *text, unsigned len, unsigned x, unsigned y, gfxbitmap_color_pix_t fg, gfxbitmap_color_pix_t bg)
 Render a string to a framebuffer.
 
void gfxbitmap_font_text_scale (void *fb, l4re_video_view_info_t *vi, gfxbitmap_font_t font, const char *text, unsigned len, unsigned x, unsigned y, gfxbitmap_color_pix_t fg, gfxbitmap_color_pix_t bg, int scale_x, int scale_y)
 Render a string to a framebuffer, including scaling.
 

Detailed Description

Bitmap font renderer header file.

Definition in file font.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Constant for length field.

Use this if the function should call strlen on the text argument itself.

Definition at line 38 of file font.h.

Function Documentation

◆ gfxbitmap_font_data()

void * gfxbitmap_font_data ( gfxbitmap_font_t  font,
unsigned  c 
)

Get bitmap font data for a specific character.

Parameters
fontFont.
cCharacter.
Returns
Pointer to bmap data, NULL on error.

◆ gfxbitmap_font_get()

gfxbitmap_font_t gfxbitmap_font_get ( const char *  name)

Get a font descriptor.

Parameters
nameName of the font.
Returns
A (opaque) font descriptor, or NULL if font could not be found.

◆ gfxbitmap_font_height()

unsigned gfxbitmap_font_height ( gfxbitmap_font_t  font)

Get the font height.

Parameters
fontFont.
Returns
Font height, 0 if font height could not be retrieved.

◆ gfxbitmap_font_init()

int gfxbitmap_font_init ( void  )

Initialize the library.

This function must be called before any other font function of this library.

Returns
0 on success, other on error

◆ gfxbitmap_font_text()

void gfxbitmap_font_text ( void *  fb,
l4re_video_view_info_t vi,
gfxbitmap_font_t  font,
const char *  text,
unsigned  len,
unsigned  x,
unsigned  y,
gfxbitmap_color_pix_t  fg,
gfxbitmap_color_pix_t  bg 
)

Render a string to a framebuffer.

Parameters
fbPointer to frame buffer.
viFrame buffer info structure.
fontFont.
textText string.
lenLength of the text string.
xHorizontal position in the frame buffer.
yVertical position in the frame buffer.
fgForeground color.
bgBackground color.

◆ gfxbitmap_font_text_scale()

void gfxbitmap_font_text_scale ( void *  fb,
l4re_video_view_info_t vi,
gfxbitmap_font_t  font,
const char *  text,
unsigned  len,
unsigned  x,
unsigned  y,
gfxbitmap_color_pix_t  fg,
gfxbitmap_color_pix_t  bg,
int  scale_x,
int  scale_y 
)

Render a string to a framebuffer, including scaling.

Parameters
fbPointer to frame buffer.
viFrame buffer info structure.
fontFont.
textText string.
lenLength of the text string.
xHorizontal position in the frame buffer.
yVertical position in the frame buffer.
fgForeground color.
bgBackground color.
scale_xHorizonal scale factor.
scale_yVertical scale factor.

◆ gfxbitmap_font_width()

unsigned gfxbitmap_font_width ( gfxbitmap_font_t  font)

Get the font width.

Parameters
fontFont.
Returns
Font width, 0 if font width could not be retrieved.