suikki / sdf_text_sample

A sample app for rendering SDF text on OpenGL using fontstash and stb_ttf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sdf_text_sample Travis build status Build status

A simple cross platform OpenGL application using signed distance field (SDF) font rendering to render text that can be scaled freely while still appearing sharp.

Tested on linux, windows, macOS, android and emscripten.

See the online demo.

Building

Requirements:

  • cmake 3.2 or newer (on path)
  • SDL2
    • on linux: SDL2 must be installed (e.g. libsdl2-dev on ubuntu)
    • on macOS: SDL2 must be installed (e.g. brew install sdl2)
    • on Windows: SDL2 binaries will be downloaded by the build script automatically.

Run the appropriate build script from platforms/ to build the app.

License

The project is licensed under the zlib license

Links

Using:

  • fontstash for font rendering (using a fork supporting SDF and OpenGL ES2).
  • SDL2 for cross platform windowing and input.
  • glew for OpenGL extension loading.

About

A sample app for rendering SDF text on OpenGL using fontstash and stb_ttf

License:zlib License


Languages

Language:C 83.0%Language:CMake 5.3%Language:HTML 4.9%Language:GLSL 4.0%Language:Batchfile 2.1%Language:Shell 0.6%