mirror of
https://github.com/love2d/love.git
synced 2026-08-14 10:13:46 +02:00
Initial (WIP) Harfbuzz text shaping integration.
This a significant refactor / rewrite of much of the love.graphics Font code. Text positioning is now split into TextShaper classes in the love.font module. This isn't exposed to users yet. BMFonts and ImageFonts use the same text shaping as before (in the new TextShaper API). Fonts loaded via FreeType now use Harfbuzz for text shaping. The new code isn't at feature-parity with the old code yet. Harfbuzz-based text shaping enables kerning support in more fonts, character combining into ligature glyphs, and directions other than left-to-right (this isn't supported in love yet).
This commit is contained in:
@@ -2112,7 +2112,7 @@ int w_newTextBatch(lua_State *L)
|
||||
luax_catchexcept(L, [&](){ t = instance()->newTextBatch(font); });
|
||||
else
|
||||
{
|
||||
std::vector<Font::ColoredString> text;
|
||||
std::vector<love::font::ColoredString> text;
|
||||
luax_checkcoloredstring(L, 2, text);
|
||||
|
||||
luax_catchexcept(L, [&](){ t = instance()->newTextBatch(font, text); });
|
||||
@@ -3132,7 +3132,7 @@ int w_drawShaderVertices(lua_State *L)
|
||||
|
||||
int w_print(lua_State *L)
|
||||
{
|
||||
std::vector<Font::ColoredString> str;
|
||||
std::vector<love::font::ColoredString> str;
|
||||
luax_checkcoloredstring(L, 1, str);
|
||||
|
||||
if (luax_istype(L, 2, Font::type))
|
||||
@@ -3157,7 +3157,7 @@ int w_print(lua_State *L)
|
||||
|
||||
int w_printf(lua_State *L)
|
||||
{
|
||||
std::vector<Font::ColoredString> str;
|
||||
std::vector<love::font::ColoredString> str;
|
||||
luax_checkcoloredstring(L, 1, str);
|
||||
|
||||
Font *font = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user