CFX_ByteString CPDF_InterForm::GetNativeFont(void* pLogFont) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ return GetNativeFont(GetNativeCharSet(), pLogFont); #else return CFX_ByteString(); #endif }
CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, uint8_t iCharSet) { if (pDocument == NULL || csFontName.IsEmpty()) { return NULL; } #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ if (iCharSet == 1) { iCharSet = GetNativeCharSet(); } HFONT hFont = ::CreateFontW( 0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, csFontName.c_str()); if (hFont != NULL) { LOGFONTA lf; memset(&lf, 0, sizeof(LOGFONTA)); ::GetObject(hFont, sizeof(LOGFONTA), &lf); ::DeleteObject(hFont); if (strlen(lf.lfFaceName) > 0) { return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE); } } #endif return NULL; }
CPDF_Font* CPDF_InterForm::AddNativeFont(const CPDF_Document* pDocument) { if (pDocument == NULL) { return NULL; } CPDF_Font* pFont = NULL; uint8_t charSet = GetNativeCharSet(); pFont = AddNativeFont(charSet, pDocument); return pFont; }
CPDF_Font* CPDF_InterForm::AddNativeFont(CPDF_Document* pDocument) { return pDocument ? AddNativeFont(GetNativeCharSet(), pDocument) : nullptr; }