7#ifndef CORE_FXGE_CFX_FONTMGR_H_
8#define CORE_FXGE_CFX_FONTMGR_H_
18#include "core/fxcrt/bytestring.h"
19#include "core/fxcrt/fixed_size_data_vector.h"
20#include "core/fxcrt/observed_ptr.h"
21#include "core/fxcrt/retain_ptr.h"
22#include "core/fxcrt/span.h"
23#include "core/fxge/cfx_face.h"
24#include "core/fxge/freetype/fx_freetype.h"
35 void SetFace(size_t index, CFX_Face* face);
36 CFX_Face*
GetFace(size_t index)
const;
39 explicit FontDesc(FixedSizeDataVector<uint8_t> data);
42 const FixedSizeDataVector<uint8_t> m_pFontData;
43 std::array<ObservedPtr<CFX_Face>, 16> m_TTCFaces;
60 FixedSizeDataVector<uint8_t> data);
65 FixedSizeDataVector<uint8_t> data);
68 pdfium::span<
const uint8_t> span,
78 bool FreeTypeVersionSupportsHinting()
const;
79 bool SetLcdFilterMode()
const;
83 std::unique_ptr<CFX_FontMapper> m_pBuiltinMapper;
84 std::map<std::tuple<ByteString,
int,
bool>, ObservedPtr<FontDesc>> m_FaceMap;
86 const bool m_FTLibrarySupportsHinting;
fxcrt::ByteString ByteString
bool HasLocalizedFont(ByteStringView name) const
bool HasInstalledFont(ByteStringView name) const
void LoadInstalledFonts()
static bool IsStandardFontName(const ByteString &name)
CFX_Face * GetFace(size_t index) const
pdfium::span< const uint8_t > FontData() const
void SetFace(size_t index, CFX_Face *face)
FXFT_LibraryRec * GetFTLibrary() const
RetainPtr< FontDesc > AddCachedFontDesc(const ByteString &face_name, int weight, bool bItalic, FixedSizeDataVector< uint8_t > data)
RetainPtr< FontDesc > GetCachedFontDesc(const ByteString &face_name, int weight, bool bItalic)
RetainPtr< FontDesc > AddCachedTTCFontDesc(size_t ttc_size, uint32_t checksum, FixedSizeDataVector< uint8_t > data)
static pdfium::span< const uint8_t > GetGenericSerifFont()
static pdfium::span< const uint8_t > GetStandardFont(size_t index)
RetainPtr< CFX_Face > NewFixedFace(RetainPtr< FontDesc > pDesc, pdfium::span< const uint8_t > span, size_t face_index)
bool FTLibrarySupportsHinting() const
CFX_FontMapper * GetBuiltinMapper() const
RetainPtr< FontDesc > GetCachedTTCFontDesc(size_t ttc_size, uint32_t checksum)
static pdfium::span< const uint8_t > GetGenericSansFont()
static ByteString GetDefaultFontNameByCharset(FX_Charset nCharset)
static const char kDefaultAnsiFontName[]
static const char kUniversalDefaultFontName[]
static FX_Charset GetCharSetFromUnicode(uint16_t word)
static CFX_GEModule * Get()
CFX_FontMgr * GetFontMgr() const
int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) override
FX_Charset CharSetFromUnicode(uint16_t word, FX_Charset nOldCharset) override
RetainPtr< CPDF_Font > GetPDFFont(int32_t nFontIndex) override
~CPDF_BAFontMap() override
static FX_Charset GetNativeCharset()
CPDF_BAFontMap(CPDF_Document *pDocument, RetainPtr< CPDF_Dictionary > pAnnotDict, const ByteString &sAPType)
int32_t GetWordFontIndex(uint16_t word, FX_Charset nCharset, int32_t nFontIndex) override
ByteString GetPDFFontAlias(int32_t nFontIndex) override
CPDF_DefaultAppearance(const ByteString &csDA)
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
static CPDF_DocPageData * FromDocument(const CPDF_Document *pDoc)
CPDF_FontEncoding(FontEncoding predefined_encoding)
virtual int32_t GetWordFontIndex(uint16_t word, FX_Charset charset, int32_t nFontIndex)=0
virtual RetainPtr< CPDF_Font > GetPDFFont(int32_t nFontIndex)=0
virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word)=0
virtual ByteString GetPDFFontAlias(int32_t nFontIndex)=0
virtual ~IPVT_FontMap()=default
virtual FX_Charset CharSetFromUnicode(uint16_t word, FX_Charset nOldCharset)=0
static ByteString Format(const char *pFormat,...)
ByteString & operator+=(const ByteString &str)
bool operator==(const char *ptr) const
ByteString & operator=(ByteString &&that) noexcept
FX_CodePage FX_GetCodePageFromCharset(FX_Charset charset)
FX_Charset FX_GetCharsetFromCodePage(FX_CodePage codepage)
struct FT_LibraryRec_ FXFT_LibraryRec
std::unique_ptr< FXFT_LibraryRec, FXFTLibraryRecDeleter > ScopedFXFTLibraryRec
#define CONSTRUCT_VIA_MAKE_RETAIN
fxcrt::ByteStringView ByteStringView