Skip to content

Embeddable console 1bpp font that supports many european/eastern unicode codepoints. Aimed to gamedev (C++11).

License

Notifications You must be signed in to change notification settings

r-lyeh-archived/unifont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unifont

  • Unifont is a compact and embeddable terminal 1-bpp font library (C++11).
  • Unifont is handy. It supports most european/greek/cyrillic unicode codepoints.
  • Unifont is tiny (~400 LOC), header-only, portable and cross-platform.
  • Unifont is aimed to gamedev and debugging sessions.
  • Unifont is zlib/libpng licensed.

api

  • Instance an unifont(color *framebuffer, unsigned width, color (*make_rgba)(r,g,b,a)) class.
  • While using an unifont class, the external framebuffer must point to a valid memory address.
  • Then use following methods as desired:
render_string(x,y,style,const char* utf8);
render_string(x,y,style,const char* utf8, const color &c);
render_string(x,y,style,const char* utf8, const color* gradient8x8);
render_string(x,y,style,const vector<int> &codepoints);
render_string(x,y,style,const vector<int> &codepoints, const color &c);
render_string(x,y,style,const vector<int> &codepoints, const color* gradient8x8);
  • Style is an enum { NORMAL, INVERT, SHADOW, RETRO } flag mask.
  • All methods return an struct { unsigned w, h; } dimensions rectangle.
  • For a more detailed sample check sample.cc file.

preview

image

notes

licenses

changelog

  • v1.0.0 (2015/05/05)
    • initial revision

About

Embeddable console 1bpp font that supports many european/eastern unicode codepoints. Aimed to gamedev (C++11).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published