🚧 This project is under active development. Do not used at the moment as it's not ready. Consult the
developbranch for progress.
A helper library to complement the graphics library of the BEAM ecosystem with loading font and rendering texts.
{deps, [
{beam_graphics, {git, "https://github.com/erlangsters/beam-graphics.git", {tag, "master"}}},
{beam_graphics_text, {git, "https://github.com/erlangsters/beam-graphics-text.git", {tag, "master"}}}
]}.{ok, Font} = graphics_font:from_file("font.ttf", 32.0),
{ok, Shape} = graphics_text:from_string(Font, {0.0, 0.0}, "Hello", ?COLOR_WHITE),
ok = graphics_surface:set_blend_mode(Surface, alpha),
ok = graphics_surface:draw_shape2(Surface, Shape),
ok = graphics_shape2:destroy(Shape),
ok = graphics_font:destroy(Font).from_string places the first baseline at Position (Y-up). Draw with blend
mode alpha. The font owns the atlas texture; the text shape does not.
Written by the Erlangsters community and released under the MIT license.