7#ifndef CORE_FXGE_CFX_FONTMGR_H_
8#define CORE_FXGE_CFX_FONTMGR_H_
17#include "core/fxcrt/bytestring.h"
18#include "core/fxcrt/fixed_size_data_vector.h"
19#include "core/fxcrt/observed_ptr.h"
20#include "core/fxcrt/retain_ptr.h"
21#include "core/fxge/cfx_face.h"
22#include "core/fxge/freetype/fx_freetype.h"
23#include "third_party/base/containers/span.h"
33 pdfium::span<
const uint8_t>
FontData()
const {
return m_pFontData; }
34 void SetFace(size_t index, CFX_Face* face);
35 CFX_Face*
GetFace(size_t index)
const;
42 ObservedPtr<CFX_Face> m_TTCFaces[16];
67 pdfium::span<
const uint8_t> span,
73 FXFT_LibraryRec*
GetFTLibrary()
const {
return m_FTLibrary.get(); }
77 bool FreeTypeVersionSupportsHinting()
const;
78 bool SetLcdFilterMode()
const;
81 ScopedFXFTLibraryRec
const m_FTLibrary;
82 std::unique_ptr<CFX_FontMapper> m_pBuiltinMapper;
83 std::map<std::tuple<ByteString,
int,
bool>, ObservedPtr<FontDesc>> m_FaceMap;
85 const bool m_FTLibrarySupportsHinting;
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)
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)
#define CONSTRUCT_VIA_MAKE_RETAIN