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:
Sasha Szpakowski
2023-10-20 20:19:30 -03:00
parent 8c13943f64
commit 5a0a6a1a27
12 changed files with 84 additions and 74 deletions
+3 -3
View File
@@ -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();