Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit cf440e5

Browse files
committed
#120 Add fallback for games that render text without setting a font
1 parent 6a4f1fe commit cf440e5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

VNTextProxy/GdiProportionalizer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ BOOL GdiProportionalizer::TextOutAHook(HDC dc, int x, int y, LPCSTR pString, int
170170
{
171171
wstring text = SjisTunnelEncoding::Decode(pString, count);
172172
Font* pFont = CurrentFonts[dc];
173+
if (pFont == nullptr)
174+
{
175+
pFont = FontManager.FetchFont(L"System", 12, false, false, false);
176+
SelectObjectHook(dc, pFont->GetGdiHandle());
177+
}
178+
173179
if (!AdaptRenderArgs(text.c_str(), text.size(), pFont->GetHeight(), x, y))
174180
return false;
175181

0 commit comments

Comments
 (0)