https://github.com/quard/u8g2_font_render
platform and display agnostic library for render fonts from u8g2 project
https://github.com/quard/u8g2_font_render
display font mcu microcontroller stm32 u8g2
Last synced: 2 months ago
JSON representation
platform and display agnostic library for render fonts from u8g2 project
- Host: GitHub
- URL: https://github.com/quard/u8g2_font_render
- Owner: Quard
- License: mit
- Created: 2020-11-27T21:42:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-11T19:54:40.000Z (12 months ago)
- Last Synced: 2024-12-16T03:13:01.546Z (4 months ago)
- Topics: display, font, mcu, microcontroller, stm32, u8g2
- Language: C
- Homepage:
- Size: 881 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# U8G2FontRender
Platform and display agnostic library for render fonts from [u8g2](https://github.com/olikraus/u8g2/) project.
> Basically, for now, it's a one-day build project. That's why it very simple and probably doesn't have all features. Don't hesitate to create PRs with changes that you need or issues.
U8g2 is a great project that has many fonts out of the box. As well as a set of scripts to generate new fonts from fonts for your system.

## How to use
As library platform and display agnostic, you should create two functions with `void fn(uint8_t x, uint8_t y)` signature, one for render foreground pixel and another for render background pixel. It gives you the opportunity to control colors, inversion, and other different parameters on text rendering.
And get font(s) from [u8g2](https://github.com/olikraus/u8g2/) library (`csrc/u8g2_fonts.c` file).
```c
#include "u8g2_font_render.h"
...
U8G2FontRender_t font = U8G2FontRender(u8g2_font_arr, &fnDrawFgPixel, &fnDrawBgPixel);
U8G2FontRender_Print(&font, 0, 0, "Hello, World!");
```## Tested using
Dev boards / MCUs:
* STM32F103C8 (BluePill)
Displays:
* SSD1306
* Nokia 1202