sftdlib
Simple and Fast Text Drawing library for the Nintendo 3DS
 All Files Functions Typedefs
sftd.h
Go to the documentation of this file.
1 
8 #ifndef SFTD_H
9 #define SFTD_H
10 
11 #include <3ds.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 // Structs
18 
22 typedef struct sftd_font sftd_font;
23 
24 // Basic functions
25 
30 int sftd_init();
31 
36 int sftd_fini();
37 
43 sftd_font *sftd_load_font_file(const char *pathname);
44 
51 sftd_font *sftd_load_font_mem(const void *buffer, unsigned int size);
52 
57 void sftd_free_font(sftd_font *font);
58 
59 // Draw functions
60 
70 void sftd_draw_text(sftd_font *font, int x, int y, unsigned int color, unsigned int size, const char *text);
71 
81 void sftd_draw_wtext(sftd_font *font, int x, int y, unsigned int color, unsigned int size, const wchar_t *text);
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif
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.
sftd_font * sftd_load_font_file(const char *pathname)
Loads a font from a file.
sftd_font * sftd_load_font_mem(const void *buffer, unsigned int size)
Loads a font from memory.
struct sftd_font sftd_font
Represents a font.
Definition: sftd.h:22
void sftd_free_font(sftd_font *font)
Frees a font.
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.
int sftd_fini()
Finishes the library.
int sftd_init()
Initializates the library.