brief comparision with stb_truetype and freetype.
THIS IS NOT A PRODUCTION LEVEL CODE.
for using freetype, install it.
sudo apt-get install libfreetype6-dev
vagrant test pass
int main() {
int pixel_height = 1024;
stb_font ff;
ff.init_font("../res/arial.ttf", 0, pixel_height);
ff.load_glyph('A');
ff.print_info('A');
freetype_font ftf;
ftf.init_font("../res/arial.ttf", 0, pixel_height);
ftf.load_glyph('A');
ftf.print_info('A');
}
glyph bitmap images are dropped on executable directory.
========= stb_tt :
w: 615
h: 657
bearing-x: -3
bearing-y: -657
advance: 612
scaled_asc: 830
scaled_desc: -194
scaled_line_gap: 30
asc: 1854
desc: -434
line_gap: 67
pixel_height: 1024
========= FreeType :
w: 615
h: 657
bearing-x: -2
bearing-y: -657
advance: 612
scaled_asc: 830
scaled_desc: -195
scaled_line_gap: 29
asc: 1854
desc: -434
line_gap: 67
pixel_height: 1024
- stb_truetype output
- freetype output
- kerning
- rect packing (skyline)
- containing opengl texture info (uv coordinates)
- multi face support (just one font object can hold multiple face index info)
- dynamic font (load only used glyph info), not using rect packing.
- SDF (signed distance field) font loader