CPDF_Font* CPWL_FontMap::AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, uint8_t nCharset) { if (IsStandardFont(sFontName)) return AddStandardFont(pDoc, sFontName); else return AddSystemFont(pDoc, sFontName, nCharset); }
CPDF_Font* CPDF_InterForm::AddNativeFont(uint8_t charSet, CPDF_Document* pDocument) { if (!pDocument) return nullptr; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ LOGFONTA lf; CFX_ByteString csFontName = GetNativeFont(charSet, &lf); if (!csFontName.IsEmpty()) { if (csFontName == "Helvetica") return AddStandardFont(pDocument, csFontName); return pDocument->AddWindowsFont(&lf, false, true); } #endif return nullptr; }
CPDF_Font* CPDF_InterForm::AddNativeFont(uint8_t charSet, const CPDF_Document* pDocument) { if (pDocument == NULL) { return NULL; } CPDF_Font* pFont = NULL; #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ LOGFONTA lf; CFX_ByteString csFontName = GetNativeFont(charSet, &lf); if (!csFontName.IsEmpty()) { if (csFontName == "Helvetica") { pFont = AddStandardFont(pDocument, csFontName); } else { pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE); } } #endif return pFont; }