7#ifndef CORE_FXGE_FX_FONT_H_
8#define CORE_FXGE_FX_FONT_H_
14#include "core/fxcrt/bytestring.h"
15#include "core/fxcrt/fx_coordinates.h"
16#include "core/fxcrt/span.h"
19#define FXFONT_FF_FIXEDPITCH (1
<< 0
)
20#define FXFONT_FF_ROMAN (1
<< 4
)
21#define FXFONT_FF_SCRIPT (4
<< 4
)
24#define FXFONT_FW_NORMAL 400
25#define FXFONT_FW_BOLD 700
26#define FXFONT_FW_BOLD_BOLD 900
29#define FXFONT_NORMAL (0
)
30#define FXFONT_FIXED_PITCH (1
<< 0
)
31#define FXFONT_SERIF (1
<< 1
)
32#define FXFONT_SYMBOLIC (1
<< 2
)
33#define FXFONT_SCRIPT (1
<< 3
)
34#define FXFONT_NONSYMBOLIC (1
<< 5
)
35#define FXFONT_ITALIC (1
<< 6
)
36#define FXFONT_ALLCAP (1
<< 16
)
37#define FXFONT_SMALLCAP (1
<< 17
)
38#define FXFONT_FORCE_BOLD (1
<< 18
)
41#define FXFONT_USEEXTERNATTR 0x80000
48#if defined(PDF_USE_SKIA)
51using CFX_TypeFace = SkTypeface;
fxcrt::ByteString ByteString
CFX_FloatRect(const FX_RECT &rect)
FX_RECT GetOuterRect() const
static constexpr uint32_t MakeTag(char c1, char c2, char c3, char c4)
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
constexpr CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
std::vector< RetainPtr< CPDF_Object > >::const_iterator const_iterator
size_t CountChar(ByteStringView pString) const override
uint32_t GetNextChar(ByteStringView pString, size_t *pOffset) const override
bool IsCIDFont() const override
bool IsUnicodeCompatible() const override
CFX_Point16 GetVertOrigin(uint16_t cid) const
int GetCharWidthF(uint32_t charcode) override
const CPDF_CIDFont * AsCIDFont() const override
uint16_t CIDFromCharCode(uint32_t charcode) const
const CIDTransform * GetCIDTransform(uint16_t cid) const
int GlyphFromCharCode(uint32_t charcode, bool *pVertGlyph) override
int16_t GetVertWidth(uint16_t cid) const
FX_RECT GetCharBBox(uint32_t charcode) override
static float CIDTransformToFloat(uint8_t ch)
void AppendChar(ByteString *str, uint32_t charcode) const override
bool IsVertWriting() const override
uint32_t CharCodeFromUnicode(wchar_t Unicode) const override
int GetCharSize(uint32_t charcode) const
WideString UnicodeFromCharCode(uint32_t charcode) const override
CPDF_CIDFont * AsCIDFont() override
static CIDSet CharsetFromOrdering(ByteStringView ordering)
CPDF_CMapParser(CPDF_CMap *pCMap)
void ParseWord(ByteStringView word)
bool IsVertWriting() const
void SetVertical(bool vert)
static constexpr size_t kDirectMapTableSize
CIDCoding GetCoding() const
size_t CountChar(ByteStringView pString) const
uint32_t GetNextChar(ByteStringView pString, size_t *pOffset) const
void SetCharset(CIDSet set)
const fxcmap::CMap * GetEmbedMap() const
uint16_t CIDFromCharCode(uint32_t charcode) const
void SetAdditionalMappings(std::vector< CIDRange > mappings)
int GetCharSize(uint32_t charcode) const
bool IsDirectCharcodeToCIDTableIsEmpty() const
void AppendChar(ByteString *str, uint32_t charcode) const
void SetMixedFourByteLeadingRanges(std::vector< CodeRange > ranges)
CIDSet GetCharset() const
void SetDirectCharcodeToCIDTableRange(uint32_t start_code, uint32_t end_code, uint16_t start_cid)
void SetCodingScheme(CodingScheme scheme)
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
static CPDF_FontGlobals * GetInstance()
void LoadFontDescriptor(const CPDF_Dictionary *pFontDesc)
virtual uint32_t CharCodeFromUnicode(wchar_t Unicode) const
static bool UseTTCharmapMacRoman(const RetainPtr< CFX_Face > &face)
static bool UseTTCharmapMSUnicode(const RetainPtr< CFX_Face > &face)
virtual WideString UnicodeFromCharCode(uint32_t charcode) const
bool operator==(const char *ptr) const
uint32_t CharCodeFromUnicodeForEncoding(fxge::FontEncoding encoding, wchar_t unicode)
FX_CodePage FX_GetCodePageFromCharset(FX_Charset charset)
size_t FX_WideCharToMultiByte(FX_CodePage codepage, WideStringView wstr, pdfium::span< char > buf)
@ kMAC_ChineseTraditional
size_t FX_MultiByteToWideChar(FX_CodePage codepage, ByteStringView bstr, pdfium::span< wchar_t > buf)
const std::array< FX_CharsetUnicodes, 8 > kFX_CharsetUnicodes
FX_Charset FX_GetCharsetFromCodePage(FX_CodePage codepage)
FX_Charset FX_GetCharsetFromInt(int value)
@ kMAC_ChineseTraditional
bool FX_CharSetIsCJK(FX_Charset uCharset)
CFX_PTemplate< int16_t > CFX_Point16
bool FontFamilyIsFixedPitch(uint32_t family)
constexpr uint16_t kNamePlatformMac
int NormalizeFontMetric(int64_t value, uint16_t upem)
ByteString GetNameFromTT(pdfium::span< const uint8_t > name_table, uint32_t name)
bool FontStyleIsSerif(uint32_t style)
bool FontStyleIsFixedPitch(uint32_t style)
#define FXFONT_NONSYMBOLIC
wchar_t UnicodeFromAdobeName(const char *name)
FX_RECT GetGlyphsBBox(const std::vector< TextGlyphPos > &glyphs, int anti_alias)
bool FontFamilyIsScript(int32_t family)
bool FontStyleIsNonSymbolic(uint32_t style)
bool FontStyleIsSymbolic(uint32_t style)
bool FontFamilyIsRoman(uint32_t family)
bool FontStyleIsItalic(uint32_t style)
#define FXFONT_FORCE_BOLD
size_t GetTTCIndex(pdfium::span< const uint8_t > pFontData, size_t font_offset)
constexpr uint16_t kNamePlatformAppleUnicode
bool FontStyleIsAllCaps(uint32_t style)
ByteString AdobeNameFromUnicode(wchar_t unicode)
#define FXFONT_FF_FIXEDPITCH
constexpr uint16_t kNamePlatformWindows
bool FontStyleIsScript(uint32_t style)
bool FontStyleIsForceBold(uint32_t style)
#define FXFONT_FIXED_PITCH
pdfium::CheckedNumeric< int32_t > FX_SAFE_INT32
constexpr wchar_t kBoxDrawingsLightVerical
wchar_t GetMirrorChar(wchar_t wch)
constexpr wchar_t kZeroWidthNoBreakSpace
constexpr wchar_t kRightSingleQuotationMark
constexpr wchar_t kLineSeparator
FX_BIDICLASS GetBidiClass(wchar_t wch)
constexpr wchar_t kParagraphSeparator
#define CONSTRUCT_VIA_MAKE_RETAIN
fxcrt::ByteStringView ByteStringView
fxcrt::WideStringView WideStringView
std::array< uint8_t, 4 > m_Upper
std::array< uint8_t, 4 > m_Lower
pdfium::span< const uint16_t > m_pUnicodes
FX_RECT & operator=(const FX_RECT &that)=default
fxcrt::WideString WideString