diff --git a/Source/UI/Text/CreateLineInfo.h b/Source/UI/Text/CreateLineInfo.h index 1f1ce2dfd..8b468c6cf 100644 --- a/Source/UI/Text/CreateLineInfo.h +++ b/Source/UI/Text/CreateLineInfo.h @@ -63,7 +63,7 @@ public: static std::string NextCharacter(std::string text); static std::tuple SplitLinkInfo(std::string text, int type); static std::vector SplitString(std::string text, const std::string& delimiter); - static tagSIZE MeasureText(FontCache& fonts, const TextLocale& locale, UIWindow* window, std::string text, const LineTextStyle& style); + static tagSIZE MeasureText(UIWindow* window, std::string text, const LineTextStyle& style); static std::string FitText( FontCache& fonts, const TextLocale& locale, UIWindow* window, std::string text, const LineTextStyle& style, int width ); diff --git a/Source/UI/Text/NavigationLink.cpp b/Source/UI/Text/NavigationLink.cpp index 3630c35a0..1721777e6 100644 --- a/Source/UI/Text/NavigationLink.cpp +++ b/Source/UI/Text/NavigationLink.cpp @@ -716,6 +716,15 @@ std::pair CCreateLineInfo::GetLinkTags(int type) { } // OFFSET: 0x00839FA0 +// FUNCTION: fn_10461 +tagSIZE CCreateLineInfo::MeasureText(UIWindow* window, std::string text, const LineTextStyle& style) { + if (!window) { + return tagSIZE{0, 0}; + } + + const TextLocale locale = {}; + return window->TextSize(g_fontCache, locale, text.c_str(), text.size(), 0, style.fontHeight, style.bold, style.italic); +} // OFFSET: 0x0083A180 // FUNCTION: fn_10462