7#ifndef XFA_FGAS_FONT_CFGAS_FONTMGR_H_
8#define XFA_FGAS_FONT_CFGAS_FONTMGR_H_
17#include "build/build_config.h"
18#include "core/fxcrt/compiler_specific.h"
19#include "core/fxcrt/fx_codepage_forward.h"
20#include "core/fxcrt/retain_ptr.h"
21#include "core/fxcrt/widestring.h"
22#include "core/fxge/cfx_face.h"
28struct FX_FONTSIGNATURE {
29 std::array<uint32_t, 4> fsUsb;
30 std::array<uint32_t, 2> fsCsb;
33inline bool operator==(
const FX_FONTSIGNATURE& left,
34 const FX_FONTSIGNATURE& right) {
35 return left.fsUsb[0] == right.fsUsb[0] && left.fsUsb[1] == right.fsUsb[1] &&
36 left.fsUsb[2] == right.fsUsb[2] && left.fsUsb[3] == right.fsUsb[3] &&
37 left.fsCsb[0] == right.fsCsb[0] && left.fsCsb[1] == right.fsCsb[1];
40struct FX_FONTDESCRIPTOR {
41 wchar_t wsFontFace[32];
42 uint32_t dwFontStyles;
44 FX_FONTSIGNATURE FontSignature;
47inline bool operator==(
const FX_FONTDESCRIPTOR& left,
48 const FX_FONTDESCRIPTOR& right) {
49 return left.uCharSet == right.uCharSet &&
50 left.dwFontStyles == right.dwFontStyles &&
51 left.FontSignature == right.FontSignature &&
52 wcscmp(left.wsFontFace, right.wsFontFace) == 0;
95 uint32_t dwFontStyles,
96 const wchar_t* pszFontFamily);
98 uint32_t dwFontStyles,
99 const wchar_t* pszFontFamily);
101 uint32_t dwFontStyles,
105 RetainPtr<CFGAS_GEFont> GetFontByUnicodeImpl(
wchar_t wUnicode,
106 uint32_t dwFontStyles,
107 const wchar_t* pszFontFamily,
121 bool EnumFontsFromFontMapper();
125 std::vector<CFGAS_FontDescriptorInfo> MatchFonts(
FX_CodePage wCodePage,
126 uint32_t dwFontStyles,
133 std::map<uint32_t, std::vector<RetainPtr<CFGAS_GEFont>>> m_Hash2Fonts;
134 std::set<
wchar_t> m_FailedUnicodesSet;
139 std::vector<std::unique_ptr<CFGAS_FontDescriptor>> m_InstalledFonts;
140 std::map<uint32_t, std::vector<CFGAS_FontDescriptorInfo>>
141 m_Hash2CandidateList;
fxcrt::ByteString ByteString
std::array< uint32_t, 4 > m_dwUsb
std::vector< WideString > m_wsFamilyNames
std::array< uint32_t, 2 > m_dwCsb
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)
virtual RetainPtr< CFGAS_GEFont > LoadFont()
ByteString GetBitmapChecksum()
~CFDETextOutTest() override=default
CFDE_TextOut & text_out()
CFX_DefaultRenderDevice * device()
virtual CFX_Size GetBitmapSize()
CFDETextOutTest()=default
virtual const char * GetEmptyBitmapChecksum()
CFX_STemplate< int32_t > CFX_Size
CRYPT_md5_context CRYPT_MD5Start()
std::string CryptToBase16(const uint8_t *digest)
TEST_F(CFDETextOutTest, DrawLogicTextBasic)
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
fxcrt::WideString WideString