Skip to content

Latest commit

 

History

History
41 lines (35 loc) · 1.96 KB

README.md

File metadata and controls

41 lines (35 loc) · 1.96 KB

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