7#ifndef CORE_FPDFAPI_FONT_CPDF_TOUNICODEMAP_H_
8#define CORE_FPDFAPI_FONT_CPDF_TOUNICODEMAP_H_
14#include "core/fxcrt/fx_string.h"
15#include "core/fxcrt/retain_ptr.h"
16#include "core/fxcrt/unowned_ptr.h"
17#include "third_party/abseil-cpp/absl/types/optional.h"
28 WideString
Lookup(uint32_t charcode)
const;
34 friend class cpdf_tounicodemap_StringToCode_Test;
35 friend class cpdf_tounicodemap_StringToWideString_Test;
37 static absl::optional<uint32_t> StringToCode(ByteStringView input);
38 static WideString StringToWideString(ByteStringView str);
40 void Load(
RetainPtr<
const CPDF_Stream> pStream);
43 uint32_t GetMultiCharIndexIndicator()
const;
44 void SetCode(uint32_t srccode, WideString destcode);
48 void InsertIntoMultimap(uint32_t code, uint32_t destcode);
50 std::map<uint32_t, std::set<uint32_t>> m_Multimap;
52 std::vector<WideString> m_MultiCharVec;
bool KeyExist(const ByteString &key) const
int GetIntegerFor(const ByteString &key) const
RetainPtr< const CPDF_Stream > GetStreamFor(const ByteString &key) const
int GetIntegerFor(const ByteString &key, int default_int) const
static CPDF_FontGlobals * GetInstance()
virtual FX_RECT GetCharBBox(uint32_t charcode)=0
virtual bool IsTrueTypeFont() const
virtual const CPDF_CIDFont * AsCIDFont() const
virtual void WillBeDestroyed()
int FallbackGlyphFromCharcode(int fallbackFont, uint32_t charcode)
void LoadFontDescriptor(const CPDF_Dictionary *pFontDesc)
virtual CPDF_CIDFont * AsCIDFont()
absl::optional< FX_Charset > GetSubstFontCharset() const
virtual bool IsType1Font() const
virtual bool IsVertWriting() const
CPDF_Font(CPDF_Document *pDocument, RetainPtr< CPDF_Dictionary > pFontDict)
void LoadUnicodeMap() const
static RetainPtr< CPDF_Font > Create(CPDF_Document *pDoc, RetainPtr< CPDF_Dictionary > pFontDict, FormFactoryIface *pFactory)
virtual uint32_t CharCodeFromUnicode(wchar_t Unicode) const
virtual const CPDF_TrueTypeFont * AsTrueTypeFont() const
virtual const CPDF_Type1Font * AsType1Font() const
virtual bool IsCIDFont() const
virtual WideString UnicodeFromCharCode(uint32_t charcode) const
virtual const CPDF_Type3Font * AsType3Font() const
static RetainPtr< CPDF_Font > GetStockFont(CPDF_Document *pDoc, ByteStringView fontname)
static bool UseTTCharmap(const RetainPtr< CFX_Face > &face, int platform_id, int encoding_id)
virtual size_t CountChar(ByteStringView pString) const
void AppendChar(ByteString *str, uint32_t charcode) const
int GetStringWidth(ByteStringView pString)
virtual CPDF_Type1Font * AsType1Font()
virtual bool HasFontWidths() const
virtual bool IsType3Font() const
virtual CPDF_Type3Font * AsType3Font()
virtual CPDF_TrueTypeFont * AsTrueTypeFont()
int GetFontWeight() const
virtual int AppendChar(char *buf, uint32_t charcode) const
virtual uint32_t GetNextChar(ByteStringView pString, size_t *pOffset) const
uint32_t FallbackFontFromCharcode(uint32_t charcode)
bool IsStandardFont() const
static FX_RECT GetCharBBoxForFace(const RetainPtr< CFX_Face > &face)
CFX_Font * GetFontFallback(int position)
size_t GetUnicodeCountByCharcodeForTesting(uint32_t charcode) const
uint32_t ReverseLookup(wchar_t unicode) const
CPDF_ToUnicodeMap(RetainPtr< const CPDF_Stream > pStream)
WideString Lookup(uint32_t charcode) const
bool IsBase14Font() const
bool operator==(const ByteString &other) const
bool operator==(const char *ptr) const
CharType operator[](const size_t index) const
const char * CharNameFromPredefinedCharSet(FontEncoding encoding, uint8_t charcode)
#define FXFONT_USEEXTERNATTR
#define FXFONT_NONSYMBOLIC
#define FXFT_Get_Glyph_Width(face)
#define FXFT_Get_Glyph_Height(face)
#define FXFT_Get_Glyph_HoriBearingX(face)
#define FXFT_Get_Glyph_HoriBearingY(face)
const char kWinAnsiEncoding[]
FX_RECT & operator=(const FX_RECT &that)=default