7#ifndef XFA_FGAS_FONT_CFGAS_FONTMGR_H_
8#define XFA_FGAS_FONT_CFGAS_FONTMGR_H_
16#include "build/build_config.h"
17#include "core/fxcrt/fx_codepage_forward.h"
18#include "core/fxcrt/retain_ptr.h"
19#include "core/fxcrt/widestring.h"
20#include "core/fxge/cfx_face.h"
26struct FX_FONTSIGNATURE {
31inline bool operator==(
const FX_FONTSIGNATURE& left,
32 const FX_FONTSIGNATURE& right) {
33 return left.fsUsb[0] == right.fsUsb[0] && left.fsUsb[1] == right.fsUsb[1] &&
34 left.fsUsb[2] == right.fsUsb[2] && left.fsUsb[3] == right.fsUsb[3] &&
35 left.fsCsb[0] == right.fsCsb[0] && left.fsCsb[1] == right.fsCsb[1];
38struct FX_FONTDESCRIPTOR {
39 wchar_t wsFontFace[32];
40 uint32_t dwFontStyles;
42 FX_FONTSIGNATURE FontSignature;
45inline bool operator==(
const FX_FONTDESCRIPTOR& left,
46 const FX_FONTDESCRIPTOR& right) {
47 return left.uCharSet == right.uCharSet &&
48 left.dwFontStyles == right.dwFontStyles &&
49 left.FontSignature == right.FontSignature &&
50 wcscmp(left.wsFontFace, right.wsFontFace) == 0;
93 uint32_t dwFontStyles,
94 const wchar_t* pszFontFamily);
96 uint32_t dwFontStyles,
97 const wchar_t* pszFontFamily);
99 uint32_t dwFontStyles,
103 RetainPtr<CFGAS_GEFont> GetFontByUnicodeImpl(
wchar_t wUnicode,
104 uint32_t dwFontStyles,
105 const wchar_t* pszFontFamily,
119 bool EnumFontsFromFontMapper();
120 void RegisterFace(
RetainPtr<CFX_Face> pFace,
const WideString& wsFaceName);
122 const WideString& wsFaceName);
123 std::vector<CFGAS_FontDescriptorInfo> MatchFonts(
FX_CodePage wCodePage,
124 uint32_t dwFontStyles,
125 const WideString& FontName,
127 RetainPtr<CFGAS_GEFont> LoadFontInternal(
const WideString& wsFaceName,
131 std::map<uint32_t, std::vector<RetainPtr<CFGAS_GEFont>>> m_Hash2Fonts;
132 std::set<
wchar_t> m_FailedUnicodesSet;
137 std::vector<std::unique_ptr<CFGAS_FontDescriptor>> m_InstalledFonts;
138 std::map<uint32_t, std::vector<CFGAS_FontDescriptorInfo>>
139 m_Hash2CandidateList;
TEST_F(CFDETextOutTest, DrawLogicTextBasic)
ByteString GetBitmapChecksum()
CFDE_TextOut & text_out()
virtual RetainPtr< CFGAS_GEFont > LoadFont()
CFDETextOutTest()=default
virtual CFX_Size GetBitmapSize()
~CFDETextOutTest() override=default
virtual const char * GetEmptyBitmapChecksum()
CFX_DefaultRenderDevice * device()
std::vector< WideString > m_wsFamilyNames
RetainPtr< CFGAS_GEFont > GetFontByCodePage(FX_CodePage wCodePage, uint32_t dwFontStyles, const wchar_t *pszFontFamily)
RetainPtr< CFGAS_GEFont > GetFontByUnicode(wchar_t wUnicode, uint32_t dwFontStyles, const wchar_t *pszFontFamily)
RetainPtr< CFGAS_GEFont > LoadFont(const wchar_t *pszFontFamily, uint32_t dwFontStyles, FX_CodePage wCodePage)
constexpr CFX_RectF()=default
constexpr CFX_RectF(float dst_left, float dst_top, float dst_width, float dst_height)
const char * c_str() const
void CRYPT_MD5Finish(CRYPT_md5_context *context, uint8_t digest[16])
CRYPT_md5_context CRYPT_MD5Start()
std::string CryptToBase16(const uint8_t *digest)
bool operator<(const CFGAS_FontDescriptorInfo &other) const
bool operator==(const CFGAS_FontDescriptorInfo &other) const
bool operator>(const CFGAS_FontDescriptorInfo &other) const
UNOWNED_PTR_EXCLUSION CFGAS_FontDescriptor * pFont
#define UNOWNED_PTR_EXCLUSION