Simple library to render BMFont fonts on the Nintendo DS.
Go to file
2025-03-05 01:34:08 +00:00
documentation Initial commit 2024-02-28 18:28:51 +00:00
doxygen Initial commit 2024-02-28 18:28:51 +00:00
examples examples: Add sample of printing firmware user name and message 2025-03-05 01:34:08 +00:00
include library: Increase version number to 0.1.5 2025-01-15 18:17:21 +00:00
source library: Fix potential crash when calloc() fails 2024-08-13 18:09:48 +01:00
.gitignore Initial commit 2024-02-28 18:28:51 +00:00
COPYING Initial commit 2024-02-28 18:28:51 +00:00
Doxyfile docs: Update Doxyfile 2024-08-01 18:35:14 +01:00
Makefile build: Copy license when installing the library 2024-12-01 13:44:58 +00:00
readme.md docs: Mention the pacman package in setup instructions 2025-01-14 01:34:19 +00:00

LibDSF

1. Introduction

This is a library written in C to render text from fonts generated by BMFont. The name of the library (LibDSF) comes from "DS Font library".

In order to use this library, download the Bitmap Font Generator tool (or any other compatible tool), export the font image to PNG, and export the font data in binary format.

This library can load font data from RAM or from the filesystem. It won't load textures for you, you're in charge of converting the PNG files to a DS-compatible format and loading them to RAM (and VRAM).

Currently, only fonts with one single PNG file are supported.

It supports drawing text as a bunch of quads, or generating a texture with the text rendered by software so that it can be loaded as a texture and drawn as one quad.

The software rendering routines support all NDS texture formats except for Tex4x4 compressed textures.

Important: Your source code files (or text data files) need to be encoded as UTF-8.

Note: If the replacement character <20> (U+FFFD) codepoint is included in the font, it will be used to print missing characters in the font, or when the UTF-8 string has encoding errors.

2. Install

You can install this library with wf-pacman directly:

wf-pacman -Sy blocksds-libdsf

If you want to build the library from source, simply run this to build and install the library in your BlocksDS environment:

make install

3. Example

Once you have installed the library, go to the folder of the example and run:

make

This will generate a NDS file that you can test with flashcards or emulators.

Screenshot

License

This library is released under the Zlib license.