Geeks3D Forums

GeeXLab => GeeXLab - english forum => Topic started by: JeGX on November 03, 2014, 04:17:00 PM

Title: FreeType-GL plugin (TTF and OTF)
Post by: JeGX on November 03, 2014, 04:17:00 PM
One of the coolest features of GLSL Hacker 0.8.0 is the support of FreeType GL via a dedicated plugin. Thanks to this new plugin, GLSL Hacker can now load any TTF (True Type Font) or OTF (Open Type Font) file. I also added a small Lua lib (gx_font.lua in the libs/lua/ folder of glsl hacker) to make things easier.


INIT script:
Code: [Select]
-- Load an otf file:
font = ftgl_load_font(demo_dir .. "data/BebasNeue.otf", 30)

FRAME script:
Code: [Select]
ftgl_begin(font)
ftgl_print(font, 10, 60, 1.0, 1.0, 0, 1.0, "GLSL Hacker rocks!")
ftgl_end(font)


Demos are available in the host_api/freetype-gl/ folder of the code sample pack (http://www.geeks3d.com/glslhacker/cs/) v2.25.0.

The plugin is available for all platforms (Windows, OSX and Linux).


(http://www.ozone3d.net/public/jegx/201411/glslhacker_freetype_gl_demo_01.jpg)

(http://www.ozone3d.net/public/jegx/201411/glslhacker_freetype_gl_demo_02.jpg)