FreeType: Kerning API and font adjustments

This commit is contained in:
rtw1x1
2026-02-04 11:59:36 +00:00
parent 4280220819
commit ba514d2e9a
7 changed files with 134 additions and 55 deletions

View File

@@ -110,10 +110,17 @@ std::string CFontManager::ResolveFontPath(const char* faceName)
// 3. Fall back to C:\Windows\Fonts
#ifdef _WIN32
char winDir[MAX_PATH];
if (GetWindowsDirectoryA(winDir, MAX_PATH))
static std::string s_fontsDir;
if (s_fontsDir.empty())
{
std::string systemPath = std::string(winDir) + "\\Fonts\\" + fileName;
char winDir[MAX_PATH];
if (GetWindowsDirectoryA(winDir, MAX_PATH))
s_fontsDir = std::string(winDir) + "\\Fonts\\";
}
if (!s_fontsDir.empty())
{
std::string systemPath = s_fontsDir + fileName;
if (FileExists(systemPath))
return systemPath;
}
@@ -127,9 +134,9 @@ std::string CFontManager::ResolveFontPath(const char* faceName)
if (FileExists(localPath))
return localPath;
if (GetWindowsDirectoryA(winDir, MAX_PATH))
if (!s_fontsDir.empty())
{
std::string systemPath = std::string(winDir) + "\\Fonts\\" + ttcName;
std::string systemPath = s_fontsDir + ttcName;
if (FileExists(systemPath))
return systemPath;
}