Use test_fonts for pdfium_embeddertests on all platforms
Bug: chromium:1250250
Change-Id: I63d07673d308ee9ede4689a44681accad1ab8aa8
R=thestig
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/87190
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/cfx_folderfontinfo.cpp b/core/fxge/cfx_folderfontinfo.cpp
index 7017ec9..7e69136 100644
--- a/core/fxge/cfx_folderfontinfo.cpp
+++ b/core/fxge/cfx_folderfontinfo.cpp
@@ -317,8 +317,11 @@
const ByteString& family,
bool bMatchName) {
FontFaceInfo* pFind = nullptr;
- if (charset == FX_Charset::kANSI && FontFamilyIsFixedPitch(pitch_family))
- return GetFont("Courier New");
+ if (charset == FX_Charset::kANSI && FontFamilyIsFixedPitch(pitch_family)) {
+ auto* courier_new = GetFont("Courier New");
+ if (courier_new)
+ return courier_new;
+ }
ByteStringView bsFamily = family.AsStringView();
uint32_t charset_flag = GetCharset(charset);
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp
index 3f0e59b..7c44223 100644
--- a/core/fxge/cfx_fontmapper.cpp
+++ b/core/fxge/cfx_fontmapper.cpp
@@ -292,6 +292,10 @@
m_pFontInfo = std::move(pFontInfo);
}
+std::unique_ptr<SystemFontInfoIface> CFX_FontMapper::TakeSystemFontInfo() {
+ return std::move(m_pFontInfo);
+}
+
uint32_t CFX_FontMapper::GetChecksumFromTT(void* hFont) {
uint32_t buffer[256];
m_pFontInfo->GetFontData(
diff --git a/core/fxge/cfx_fontmapper.h b/core/fxge/cfx_fontmapper.h
index b62372e..956232e 100644
--- a/core/fxge/cfx_fontmapper.h
+++ b/core/fxge/cfx_fontmapper.h
@@ -58,6 +58,7 @@
}
void SetSystemFontInfo(std::unique_ptr<SystemFontInfoIface> pFontInfo);
+ std::unique_ptr<SystemFontInfoIface> TakeSystemFontInfo();
void AddInstalledFont(const ByteString& name, FX_Charset charset);
void LoadInstalledFonts();