Font system refactor, use pre-rendered fonts

This commit is contained in:
elasota
2021-03-27 02:08:03 -04:00
parent c87f238563
commit 50f420d2b1
63 changed files with 976 additions and 1294 deletions

View File

@@ -103,7 +103,7 @@ namespace PortabilityLayer
Rect textRect = innerRect;
textRect.right -= 11;
PortabilityLayer::RenderedFont *sysFont = GetSystemFont(12, PortabilityLayer::FontFamilyFlag_Bold, true);
PortabilityLayer::RenderedFont *sysFont = GetFont(FontPresets::kSystem12Bold);
Point basePoint = Point::Create(textRect.left + 2, (textRect.top + textRect.bottom + sysFont->GetMetrics().m_ascent + 1) / 2 - 1);
surface->DrawStringConstrained(basePoint, GetString(), textRect, blackColor, sysFont);