Closed fkaa closed 6 years ago
Work in progress, opened for feedback.
Synopsis:
stb_truetype
USE_FREETYPE
stb_rect_pack
src/stb_rect_pack.h
src/stb_truetype.h
src/font.c
src/lua_font.h
CMakeLists.txt
include/common.h
src/lua_fetch.h
src/lua.c
pkg/iceball/lib/font.lua
font_ttf_new
draw(x, y, size, string, color)
x
y
line_height(size)
utf8
src/lutf8lib.c
luaopen_utf8
src/unidata.h
pkg/base/sandbox/main.lua
TODO:
After the fuzzing rakiru did, I'd be extremely reluctant to use stb_* libs in any kind of security critical context...
why close?
Work in progress, opened for feedback.
Synopsis:
stb_truetype
depending on ifUSE_FREETYPE
is definedstb_rect_pack
src/stb_rect_pack.h
– Packs rects into a bin (Public domain)src/stb_truetype.h
– Loading & rasterising font glyphs (Public domain)src/font.c
– Contains loading/drawing of fonts & glyphs, should be wrapped before usingsrc/lua_font.h
– Wraps the above functions for use in luaCMakeLists.txt
– Freetype & maintenanceinclude/common.h
– Adds font functions and structuressrc/lua_fetch.h
– Adds support for fetching fontssrc/lua.c
– Adds lua wrapper functionspkg/iceball/lib/font.lua
font_ttf_new
function which takes a font path as its argumentdraw(x, y, size, string, color)
– Draws a string atx
,y
with the given size and colorline_height(size)
– The line height of font face with a given sizeutf8
in global scopesrc/lutf8lib.c
– Contains library functions andluaopen_utf8
src/unidata.h
– Generated unicode datainclude/common.h
– Adds font functions and structuressrc/lua.c
– Registers the library in the Lua state(s)pkg/base/sandbox/main.lua
– Transfers theutf8
library to the sandboxTODO: