Giter VIP home page Giter VIP logo

glyph-loading-comparison's Introduction

glyph-loading

brief comparision with stb_truetype and freetype.
THIS IS NOT A PRODUCTION LEVEL CODE.

debian distro

for using freetype, install it.

sudo apt-get install libfreetype6-dev

vagrant

vagrant test pass

simple code

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');
}

outputs

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

stb_truetype

  • freetype output

freetype

TODO

  • 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

glyph-loading-comparison's People

Contributors

bodguy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.