mirror of
https://github.com/love2d/love.git
synced 2026-08-18 03:34:23 +02:00
All constructors for making a TrueType font take an optional settings table.
This supersedes the existing optional hinting and dpi scale parameters. The table's fields are:
{
hinting = "normal",
dpiscale = 1, -- nil will default to the current window DPI scale.
}
This commit is contained in:
@@ -74,12 +74,12 @@ void Deprecations::draw(Graphics *gfx)
|
||||
|
||||
if (font.get() == nullptr)
|
||||
{
|
||||
auto hinting = font::TrueTypeRasterizer::HINTING_NORMAL;
|
||||
font::TrueTypeRasterizer::Settings settings;
|
||||
|
||||
if (!isGammaCorrect() && gfx->getScreenDPIScale() <= 1.0)
|
||||
hinting = font::TrueTypeRasterizer::HINTING_LIGHT;
|
||||
settings.hinting = font::TrueTypeRasterizer::HINTING_LIGHT;
|
||||
|
||||
font.set(gfx->newDefaultFont(9, hinting), Acquire::NORETAIN);
|
||||
font.set(gfx->newDefaultFont(9, settings), Acquire::NORETAIN);
|
||||
}
|
||||
|
||||
gfx->flushBatchedDraws();
|
||||
|
||||
Reference in New Issue
Block a user