Additional small pixel fonts from uGUI for use in pntr.
pntr_font* pntr_load_pixelfont(pntr_pixelfont font);
pntr_vector pntr_pixelfont_size(pntr_pixelfont font);
The following pixel font sizes are available: 4x6, 5x8, 5x12, 6x8, 6x10, 7x12, 8x8, 8x12.
#define PNTR_PIXELFONT_FONT_IMPLEMENTATION
#define PNTR_PIXELFONT_ENABLE_ALL
// #define PNTR_PIXELFONT_ENABLE_4X6
// #define PNTR_PIXELFONT_ENABLE_5X8
// #define PNTR_PIXELFONT_ENABLE_5X12
// #define PNTR_PIXELFONT_ENABLE_6X8
// #define PNTR_PIXELFONT_ENABLE_6X10
// #define PNTR_PIXELFONT_ENABLE_7X12
// #define PNTR_PIXELFONT_ENABLE_8X8
// #define PNTR_PIXELFONT_ENABLE_8X12
// #define PNTR_PIXELFONT_ENABLE_8X14
#include "pntr_pixelfont.h"
int main() {
// Load one of the pixel fonts.
pntr_font* font = pntr_load_pixelfont(PNTR_PIXELFONT_8X12);
// Generate an image with the text in it.
pntr_image* image = pntr_gen_image_text(font, "Hello, World!", PNTR_BLACK, PNTR_RAYWHITE);
// Save the image locally.
pntr_save_image(image, "pntr_pixelfont_8x12.png");
// Unload the font and image.
pntr_unload_image(image);
pntr_unload_font(font);
return 0;
}
Unless stated otherwise, all works are:
- Copyright (c) 2023 Rob Loach
... and licensed under: