GlyType 0.0.7
a ultra lightweight font renderer and font
Loading...
Searching...
No Matches
gly_type_render.h File Reference

GlyType Renderer. More...

Functions

void gly_type_render (unsigned char x, unsigned char y, unsigned char s, const char *t, const void *const f)
 

Detailed Description

a ultra lightweight font renderer and font

Date
2024
Version
0.0.7
Author
RodrigoDornelles
Style
The font style is inspired by digital displays, but not outdated, with its straight lines and some diagonals, a modernized look, and also a nice differentiation between numbers and characters.
7 Segments
The renderer stores the glyphs as if it were a 7-segment display, thus spending only 1 bit for each line, which is the trick of being so compact.

The 8 bit/segment it is a special line, its size varies, from bottom to top it stops when it hits the first fixed segment G or A There are special characters, which would be x , v and z to differentiate them from all other characters, they have their own internal rendering function, are flagged as segment H without segment G or A

FAAAAAAAAAAAAB
FFAAAAAAAAABBB
FFF........BBB
FFF........BBB
FFGGGGGGGGGGBB
EEGGGGGGGGGGCC
EEE........CCC
EEE........CCC
EEDDDDDDDDDDCC
EDDDDDDDDDDDDC

Function Documentation

◆ gly_type_render()

void gly_type_render ( unsigned char x,
unsigned char y,
unsigned char s,
const char * t,
const void *const f )
Parameters
[in]xin pixels
[in]yin pixels
[in]sizein pixels
[in]textwith null char terminator
[in]fptrclojure to drawn line with interface:
function(x1, y1, x2, y2)
Total Size
  • width length(text) * (size+1)
  • height min(count(text, 0x0A), 1) * (size+1)
Example
gly_type_render(x, y, size, "hello world", draw_line_func);
void gly_type_render(unsigned char x, unsigned char y, unsigned char s, const char *t, const void *const f)
Definition gly_type_render.h:69