Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Unified Diff: core/fxge/win32/fx_win32_device.cpp

Issue 2395883002: Use another vector for installed fonts in CFX_FontMapper (Closed)
Patch Set: Fix win 2 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« core/fxge/cfx_fontmapper.h ('K') | « core/fxge/ge/cfx_fontmapper.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/win32/fx_win32_device.cpp
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index bc6817da63cd6ad2bd5d7f69b49cb988da7d6451..733400a90cf05bd89dd81fe5dc16b9fba8a26327 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -471,13 +471,14 @@ CFX_ByteString CFX_Win32FontInfo::FindFont(const CFX_ByteString& name) {
for (size_t i = 0; i < m_pMapper->m_InstalledTTFonts.size(); ++i) {
CFX_ByteString thisname = m_pMapper->m_InstalledTTFonts[i];
- if (thisname[0] == ' ') {
- if (thisname.Mid(1, name.GetLength()) == name) {
- return m_pMapper->m_InstalledTTFonts[i + 1];
- }
- } else if (thisname.Left(name.GetLength()) == name) {
+ if (thisname.Left(name.GetLength()) == name)
return m_pMapper->m_InstalledTTFonts[i];
- }
+ }
+ for (size_t i = 0; i < m_pMapper->m_LocalizedTTFonts.size(); ++i) {
+ CFX_ByteString thisname = m_pMapper->m_LocalizedTTFonts[i];
+ if (thisname.Left(name.GetLength()) == name)
+ return m_pMapper
+ ->m_InstalledTTFonts[m_pMapper->m_IndexForLocalizedFonts[i]];
}
return CFX_ByteString();
}
« core/fxge/cfx_fontmapper.h ('K') | « core/fxge/ge/cfx_fontmapper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698