summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_folderfontinfo.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-27 13:33:57 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-27 20:20:07 +0000
commit60830ae5a056601dec5eb3c9a9589e29cfc9e041 (patch)
treefb6f6832efda0d7500c5470e94c2a869cb540635 /core/fxge/cfx_folderfontinfo.cpp
parentc9de55bbfb8e55022476d972d183501cbf0216ad (diff)
downloadpdfium-60830ae5a056601dec5eb3c9a9589e29cfc9e041.tar.xz
Hide FaceFontInfo inside CFX_FolderFontInfo
This CL moves CFX_FaceFontInfo to be a protected inner class of CFX_FolderFontInfo. Change-Id: I3674c36d5295307be253e04337c22d6d0608fefe Reviewed-on: https://pdfium-review.googlesource.com/14952 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxge/cfx_folderfontinfo.cpp')
-rw-r--r--core/fxge/cfx_folderfontinfo.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/core/fxge/cfx_folderfontinfo.cpp b/core/fxge/cfx_folderfontinfo.cpp
index f2a19a4c4f..3087552fb8 100644
--- a/core/fxge/cfx_folderfontinfo.cpp
+++ b/core/fxge/cfx_folderfontinfo.cpp
@@ -220,8 +220,8 @@ void CFX_FolderFontInfo::ReportFace(const ByteString& path,
if (pdfium::ContainsKey(m_FontList, facename))
return;
- auto pInfo = pdfium::MakeUnique<CFX_FontFaceInfo>(path, facename, tables,
- offset, filesize);
+ auto pInfo = pdfium::MakeUnique<FontFaceInfo>(path, facename, tables, offset,
+ filesize);
ByteString os2 =
FPDF_LoadTableFromTT(pFile, tables.raw_str(), nTables, 0x4f532f32);
if (os2.GetLength() >= 86) {
@@ -276,7 +276,7 @@ void* CFX_FolderFontInfo::FindFont(int weight,
int pitch_family,
const char* family,
bool bMatchName) {
- CFX_FontFaceInfo* pFind = nullptr;
+ FontFaceInfo* pFind = nullptr;
if (charset == FX_CHARSET_ANSI && (pitch_family & FXFONT_FF_FIXEDPITCH))
return GetFont("Courier New");
@@ -284,7 +284,7 @@ void* CFX_FolderFontInfo::FindFont(int weight,
int32_t iBestSimilar = 0;
for (const auto& it : m_FontList) {
const ByteString& bsName = it.first;
- CFX_FontFaceInfo* pFont = it.second.get();
+ FontFaceInfo* pFont = it.second.get();
if (!(pFont->m_Charsets & charset_flag) && charset != FX_CHARSET_Default)
continue;
@@ -331,7 +331,7 @@ uint32_t CFX_FolderFontInfo::GetFontData(void* hFont,
if (!hFont)
return 0;
- const CFX_FontFaceInfo* pFont = static_cast<CFX_FontFaceInfo*>(hFont);
+ const FontFaceInfo* pFont = static_cast<FontFaceInfo*>(hFont);
uint32_t datasize = 0;
uint32_t offset = 0;
if (table == 0) {
@@ -369,10 +369,23 @@ void CFX_FolderFontInfo::DeleteFont(void* hFont) {}
bool CFX_FolderFontInfo::GetFaceName(void* hFont, ByteString* name) {
if (!hFont)
return false;
- *name = static_cast<CFX_FontFaceInfo*>(hFont)->m_FaceName;
+ *name = static_cast<FontFaceInfo*>(hFont)->m_FaceName;
return true;
}
bool CFX_FolderFontInfo::GetFontCharset(void* hFont, int* charset) {
return false;
}
+
+CFX_FolderFontInfo::FontFaceInfo::FontFaceInfo(ByteString filePath,
+ ByteString faceName,
+ ByteString fontTables,
+ uint32_t fontOffset,
+ uint32_t fileSize)
+ : m_FilePath(filePath),
+ m_FaceName(faceName),
+ m_FontTables(fontTables),
+ m_FontOffset(fontOffset),
+ m_FileSize(fileSize),
+ m_Styles(0),
+ m_Charsets(0) {}