sftdlib
Simple and Fast Text Drawing library for the Nintendo 3DS
 All Files Functions Typedefs
Typedefs | Functions
sftd.h File Reference

sftdlib header More...

#include <3ds.h>

Go to the source code of this file.

Typedefs

typedef struct sftd_font sftd_font
 Represents a font.
 

Functions

int sftd_init ()
 Initializates the library. More...
 
int sftd_fini ()
 Finishes the library. More...
 
sftd_fontsftd_load_font_file (const char *pathname)
 Loads a font from a file. More...
 
sftd_fontsftd_load_font_mem (const void *buffer, unsigned int size)
 Loads a font from memory. More...
 
void sftd_free_font (sftd_font *font)
 Frees a font. More...
 
void sftd_draw_text (sftd_font *font, int x, int y, unsigned int color, unsigned int size, const char *text)
 Draws text using a font. More...
 
void sftd_draw_wtext (sftd_font *font, int x, int y, unsigned int color, unsigned int size, const wchar_t *text)
 Draws wide text using a font. More...
 

Detailed Description

sftdlib header

Author
Sergi Granell (xerpi)
Date
2 April 2015

Function Documentation

void sftd_draw_text ( sftd_font font,
int  x,
int  y,
unsigned int  color,
unsigned int  size,
const char *  text 
)

Draws text using a font.

Parameters
fontthe font to use
xthe x coordinate to draw the text to
ythe y coordinate to draw the text to
colorthe color to draw the font
sizethe font size
texta pointer to the text to draw
void sftd_draw_wtext ( sftd_font font,
int  x,
int  y,
unsigned int  color,
unsigned int  size,
const wchar_t *  text 
)

Draws wide text using a font.

Parameters
fontthe font to use
xthe x coordinate to draw the text to
ythe y coordinate to draw the text to
colorthe color to draw the font
sizethe font size
texta pointer to the wide text to draw
int sftd_fini ( )

Finishes the library.

Returns
Whether the finalization has been successful or not
void sftd_free_font ( sftd_font font)

Frees a font.

Parameters
fontpointer to the font to freeze
int sftd_init ( )

Initializates the library.

Returns
Whether the initialization has been successful or not
sftd_font* sftd_load_font_file ( const char *  pathname)

Loads a font from a file.

Parameters
pathnamethe path to the font
Returns
a pointer to the loaded font (NULL on error)
sftd_font* sftd_load_font_mem ( const void *  buffer,
unsigned int  size 
)

Loads a font from memory.

Parameters
bufferthe address of the font
sizethe size of the font buffer
Returns
a pointer to the loaded font (NULL on error)