Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <cpdf_font.h>
Classes | |
class | FormFactoryIface |
class | FormIface |
Public Member Functions | |
virtual bool | IsType1Font () const |
virtual bool | IsTrueTypeFont () const |
virtual bool | IsType3Font () const |
virtual bool | IsCIDFont () const |
virtual const CPDF_Type1Font * | AsType1Font () const |
virtual CPDF_Type1Font * | AsType1Font () |
virtual const CPDF_TrueTypeFont * | AsTrueTypeFont () const |
virtual CPDF_TrueTypeFont * | AsTrueTypeFont () |
virtual const CPDF_Type3Font * | AsType3Font () const |
virtual CPDF_Type3Font * | AsType3Font () |
virtual const CPDF_CIDFont * | AsCIDFont () const |
virtual CPDF_CIDFont * | AsCIDFont () |
virtual void | WillBeDestroyed () |
virtual bool | IsVertWriting () const |
virtual bool | IsUnicodeCompatible () const =0 |
virtual uint32_t | GetNextChar (ByteStringView pString, size_t *pOffset) const |
virtual size_t | CountChar (ByteStringView pString) const |
virtual int | AppendChar (char *buf, uint32_t charcode) const |
virtual int | GlyphFromCharCode (uint32_t charcode, bool *pVertGlyph)=0 |
virtual WideString | UnicodeFromCharCode (uint32_t charcode) const |
virtual uint32_t | CharCodeFromUnicode (wchar_t Unicode) const |
virtual bool | HasFontWidths () const |
ByteString | GetBaseFontName () const |
absl::optional< FX_Charset > | GetSubstFontCharset () const |
bool | IsEmbedded () const |
RetainPtr< CPDF_Dictionary > | GetMutableFontDict () |
RetainPtr< const CPDF_Dictionary > | GetFontDict () const |
uint32_t | GetFontDictObjNum () const |
bool | FontDictIs (const CPDF_Dictionary *pThat) const |
void | ClearFontDict () |
bool | IsStandardFont () const |
bool | HasFace () const |
void | AppendChar (ByteString *str, uint32_t charcode) const |
const FX_RECT & | GetFontBBox () const |
int | GetTypeAscent () const |
int | GetTypeDescent () const |
int | GetStringWidth (ByteStringView pString) |
uint32_t | FallbackFontFromCharcode (uint32_t charcode) |
int | FallbackGlyphFromCharcode (int fallbackFont, uint32_t charcode) |
int | GetFontFlags () const |
int | GetItalicAngle () const |
int | GetFontWeight () const |
virtual int | GetCharWidthF (uint32_t charcode)=0 |
virtual FX_RECT | GetCharBBox (uint32_t charcode)=0 |
CPDF_Document * | GetDocument () const |
CFX_Font * | GetFont () |
const CFX_Font * | GetFont () const |
CFX_Font * | GetFontFallback (int position) |
const ByteString & | GetResourceName () const |
void | SetResourceName (const ByteString &name) |
Public Member Functions inherited from fxcrt::Retainable | |
Retainable ()=default | |
bool | HasOneRef () const |
Public Member Functions inherited from fxcrt::Observable | |
Observable () | |
Observable (const Observable &that)=delete | |
Observable & | operator= (const Observable &that)=delete |
~Observable () | |
void | AddObserver (ObserverIface *pObserver) |
void | RemoveObserver (ObserverIface *pObserver) |
void | NotifyObservers () |
Static Public Member Functions | |
static RetainPtr< CPDF_Font > | Create (CPDF_Document *pDoc, RetainPtr< CPDF_Dictionary > pFontDict, FormFactoryIface *pFactory) |
static RetainPtr< CPDF_Font > | GetStockFont (CPDF_Document *pDoc, ByteStringView fontname) |
Static Public Attributes | |
static constexpr uint32_t | kInvalidCharCode = static_cast<uint32_t>(-1) |
Protected Member Functions | |
CPDF_Font (CPDF_Document *pDocument, RetainPtr< CPDF_Dictionary > pFontDict) | |
~CPDF_Font () override | |
virtual bool | Load ()=0 |
void | LoadUnicodeMap () const |
void | LoadFontDescriptor (const CPDF_Dictionary *pFontDesc) |
void | CheckFontMetrics () |
Protected Member Functions inherited from fxcrt::Retainable | |
virtual | ~Retainable ()=default |
Protected Member Functions inherited from fxcrt::Observable | |
size_t | ActiveObserversForTesting () const |
Static Protected Member Functions | |
static int | TT2PDF (FT_Pos m, const RetainPtr< CFX_Face > &face) |
static FX_RECT | GetCharBBoxForFace (const RetainPtr< CFX_Face > &face) |
static bool | UseTTCharmapMSUnicode (const RetainPtr< CFX_Face > &face) |
static bool | UseTTCharmapMSSymbol (const RetainPtr< CFX_Face > &face) |
static bool | UseTTCharmapMacRoman (const RetainPtr< CFX_Face > &face) |
static bool | UseTTCharmap (const RetainPtr< CFX_Face > &face, int platform_id, int encoding_id) |
static const char * | GetAdobeCharName (FontEncoding base_encoding, const std::vector< ByteString > &charnames, uint32_t charcode) |
Protected Attributes | |
UnownedPtr< CPDF_Document > const | m_pDocument |
ByteString | m_ResourceName |
CFX_Font | m_Font |
std::vector< std::unique_ptr< CFX_Font > > | m_FontFallbacks |
RetainPtr< CPDF_StreamAcc > | m_pFontFile |
RetainPtr< CPDF_Dictionary > | m_pFontDict |
ByteString | m_BaseFontName |
std::unique_ptr< CPDF_ToUnicodeMap > | m_pToUnicodeMap |
bool | m_bToUnicodeLoaded = false |
int | m_Flags = 0 |
int | m_StemV = 0 |
int | m_Ascent = 0 |
int | m_Descent = 0 |
int | m_ItalicAngle = 0 |
FX_RECT | m_FontBBox |
Definition at line 38 of file cpdf_font.h.
|
protected |
Definition at line 52 of file cpdf_font.cpp.
References CPDF_Font().
Referenced by CPDF_Font().
|
overrideprotected |
Definition at line 58 of file cpdf_font.cpp.
void CPDF_Font::AppendChar | ( | ByteString * | str, |
uint32_t | charcode ) const |
Definition at line 133 of file cpdf_font.cpp.
References AppendChar().
|
virtual |
Reimplemented in CPDF_CIDFont.
Definition at line 128 of file cpdf_font.cpp.
Referenced by AppendChar().
|
virtual |
Reimplemented in CPDF_CIDFont.
Definition at line 107 of file cpdf_font.cpp.
Referenced by FPDFFont_GetGlyphWidth(), and GetCharPosList().
|
virtual |
Reimplemented in CPDF_CIDFont.
Definition at line 103 of file cpdf_font.cpp.
Referenced by IsVertWriting().
|
virtual |
Reimplemented in CPDF_TrueTypeFont.
Definition at line 91 of file cpdf_font.cpp.
|
virtual |
Reimplemented in CPDF_TrueTypeFont.
Definition at line 87 of file cpdf_font.cpp.
|
virtual |
Reimplemented in CPDF_Type1Font.
Definition at line 83 of file cpdf_font.cpp.
|
virtual |
Reimplemented in CPDF_Type1Font.
Definition at line 79 of file cpdf_font.cpp.
Referenced by IsStandardFont().
|
virtual |
Reimplemented in CPDF_Type3Font.
Definition at line 99 of file cpdf_font.cpp.
|
virtual |
Reimplemented in CPDF_Type3Font.
Definition at line 95 of file cpdf_font.cpp.
|
virtual |
Reimplemented in CPDF_CIDFont, and CPDF_SimpleFont.
Definition at line 146 of file cpdf_font.cpp.
References LoadUnicodeMap(), and m_bToUnicodeLoaded.
Referenced by CPDF_CIDFont::CharCodeFromUnicode(), CPDF_SimpleFont::CharCodeFromUnicode(), FPDFFont_GetGlyphPath(), and FPDFFont_GetGlyphWidth().
|
protected |
Definition at line 218 of file cpdf_font.cpp.
References FX_RECT::bottom, GetCharBBox(), FX_RECT::left, m_Ascent, m_Descent, m_FontBBox, FX_RECT::operator=(), FX_RECT::right, and FX_RECT::top.
Referenced by CPDF_Type3Font::CheckType3FontMetrics(), CPDF_CIDFont::Load(), and CPDF_SimpleFont::LoadCommon().
|
inline |
Definition at line 108 of file cpdf_font.h.
|
virtual |
Reimplemented in CPDF_CIDFont.
Definition at line 111 of file cpdf_font.cpp.
|
static |
Definition at line 301 of file cpdf_font.cpp.
References fxcrt::ByteString::operator==(), and fxcrt::ByteString::operator==().
Referenced by GetStockFont().
uint32_t CPDF_Font::FallbackFontFromCharcode | ( | uint32_t | charcode | ) |
Definition at line 377 of file cpdf_font.cpp.
Referenced by GetCharPosList().
int CPDF_Font::FallbackGlyphFromCharcode | ( | int | fallbackFont, |
uint32_t | charcode ) |
Definition at line 390 of file cpdf_font.cpp.
References fxcrt::WideString::IsEmpty(), fxcrt::WideString::operator[](), and UnicodeFromCharCode().
Referenced by GetCharPosList().
|
inline |
Definition at line 105 of file cpdf_font.h.
|
staticprotected |
Definition at line 357 of file cpdf_font.cpp.
References CharNameFromPredefinedCharSet(), and kBuiltin.
|
inline |
Definition at line 99 of file cpdf_font.h.
|
pure virtual |
Implemented in CPDF_CIDFont, CPDF_SimpleFont, and CPDF_Type3Font.
Referenced by CheckFontMetrics().
Definition at line 420 of file cpdf_font.cpp.
Referenced by CPDF_CIDFont::GetCharBBox().
|
pure virtual |
Implemented in CPDF_CIDFont, CPDF_SimpleFont, and CPDF_Type3Font.
Referenced by FPDFEditEmbedderTest::CheckCompositeFontWidths(), CPDF_TextRenderer::DrawTextString(), FPDFFont_GetGlyphWidth(), and GetCharPosList().
|
inline |
Definition at line 128 of file cpdf_font.h.
|
inline |
Definition at line 130 of file cpdf_font.h.
Referenced by FPDFFont_GetFontName(), FPDFFont_GetGlyphPath(), and GetCharPosList().
|
inline |
Definition at line 131 of file cpdf_font.h.
|
inline |
Definition at line 113 of file cpdf_font.h.
References m_FontBBox.
Referenced by CPWL_Edit::GetCharArrayAutoFontSize().
|
inline |
Definition at line 103 of file cpdf_font.h.
|
inline |
Definition at line 104 of file cpdf_font.h.
CFX_Font * CPDF_Font::GetFontFallback | ( | int | position | ) |
Definition at line 403 of file cpdf_font.cpp.
Referenced by FPDFFont_GetGlyphPath(), and GetCharPosList().
|
inline |
Definition at line 119 of file cpdf_font.h.
References m_Flags.
Referenced by FPDFFont_GetFlags().
int CPDF_Font::GetFontWeight | ( | ) | const |
Definition at line 443 of file cpdf_font.cpp.
References m_StemV.
Referenced by FPDFFont_GetWeight().
|
inline |
Definition at line 120 of file cpdf_font.h.
References m_ItalicAngle.
Referenced by FPDFFont_GetItalicAngle().
|
inline |
Definition at line 102 of file cpdf_font.h.
|
virtual |
Reimplemented in CPDF_CIDFont.
Definition at line 333 of file cpdf_font.cpp.
|
inline |
Definition at line 135 of file cpdf_font.h.
|
static |
Definition at line 276 of file cpdf_font.cpp.
References Create(), CPDF_FontGlobals::GetInstance(), and pdfium::font_encodings::kWinAnsiEncoding.
Referenced by FPDFText_LoadStandardFont(), and TEST_F().
int CPDF_Font::GetStringWidth | ( | ByteStringView | pString | ) |
Definition at line 267 of file cpdf_font.cpp.
absl::optional< FX_Charset > CPDF_Font::GetSubstFontCharset | ( | ) | const |
Definition at line 349 of file cpdf_font.cpp.
References CFX_SubstFont::m_Charset.
|
inline |
Definition at line 114 of file cpdf_font.h.
References m_Ascent.
Referenced by FPDFFont_GetAscent().
|
inline |
Definition at line 115 of file cpdf_font.h.
References m_Descent.
Referenced by FPDFFont_GetDescent().
|
pure virtual |
Implemented in CPDF_CIDFont, and CPDF_SimpleFont.
Referenced by GetCharPosList().
|
inline |
Definition at line 110 of file cpdf_font.h.
Referenced by CPDF_SimpleFont::LoadCommon().
|
virtual |
Reimplemented in CPDF_SimpleFont.
Definition at line 153 of file cpdf_font.cpp.
|
virtual |
Reimplemented in CPDF_CIDFont.
Definition at line 75 of file cpdf_font.cpp.
Referenced by GetCharPosList(), TEST_F(), and TEST_F().
|
inline |
Definition at line 101 of file cpdf_font.h.
Referenced by FPDFFont_GetIsEmbedded(), GetCharPosList(), CPDF_CIDFont::Load(), and CPDF_SimpleFont::LoadCharMetrics().
bool CPDF_Font::IsStandardFont | ( | ) | const |
Definition at line 341 of file cpdf_font.cpp.
References AsType1Font(), CPDF_Type1Font::IsBase14Font(), and IsType1Font().
Referenced by CPWL_Edit::GetCharArrayAutoFontSize().
|
virtual |
Reimplemented in CPDF_TrueTypeFont.
Definition at line 67 of file cpdf_font.cpp.
Referenced by TEST_F().
|
virtual |
Reimplemented in CPDF_Type1Font.
Definition at line 63 of file cpdf_font.cpp.
Referenced by IsStandardFont(), and TEST_F().
|
virtual |
Reimplemented in CPDF_Type3Font.
Definition at line 71 of file cpdf_font.cpp.
Referenced by CPDF_TextRenderer::DrawTextString().
|
pure virtual |
Implemented in CPDF_CIDFont, and CPDF_SimpleFont.
|
virtual |
Reimplemented in CPDF_CIDFont.
Definition at line 123 of file cpdf_font.cpp.
References AsCIDFont().
|
protectedpure virtual |
Implemented in CPDF_CIDFont, CPDF_TrueTypeFont, CPDF_Type1Font, and CPDF_Type3Font.
|
protected |
Definition at line 157 of file cpdf_font.cpp.
References FX_RECT::bottom, CPDF_Dictionary::GetIntegerFor(), CPDF_Dictionary::GetIntegerFor(), CPDF_Dictionary::GetStreamFor(), CPDF_Dictionary::KeyExist(), FX_RECT::left, m_Ascent, m_Descent, m_Flags, m_FontBBox, m_ItalicAngle, m_StemV, FX_RECT::right, and FX_RECT::top.
Referenced by CPDF_CIDFont::Load(), and CPDF_SimpleFont::LoadCommon().
|
protected |
Definition at line 258 of file cpdf_font.cpp.
References m_bToUnicodeLoaded.
Referenced by CharCodeFromUnicode(), and UnicodeFromCharCode().
|
inline |
Definition at line 136 of file cpdf_font.h.
Definition at line 410 of file cpdf_font.cpp.
|
virtual |
Reimplemented in CPDF_CIDFont, and CPDF_SimpleFont.
Definition at line 139 of file cpdf_font.cpp.
References LoadUnicodeMap(), and m_bToUnicodeLoaded.
Referenced by FallbackGlyphFromCharcode(), GetCharPosList(), CPDF_CIDFont::UnicodeFromCharCode(), and CPDF_SimpleFont::UnicodeFromCharCode().
|
staticprotected |
Definition at line 430 of file cpdf_font.cpp.
Referenced by UseTTCharmapMacRoman(), UseTTCharmapMSSymbol(), and UseTTCharmapMSUnicode().
|
inlinestaticprotected |
Definition at line 152 of file cpdf_font.h.
References UseTTCharmap().
Referenced by CPDF_CIDFont::GlyphFromCharCode(), and CPDF_TrueTypeFont::LoadGlyphMap().
|
inlinestaticprotected |
Definition at line 149 of file cpdf_font.h.
References UseTTCharmap().
Referenced by CPDF_TrueTypeFont::LoadGlyphMap(), and CPDF_Type1Font::LoadGlyphMap().
|
inlinestaticprotected |
Definition at line 146 of file cpdf_font.h.
References UseTTCharmap().
Referenced by CPDF_CIDFont::GlyphFromCharCode().
|
virtual |
Reimplemented in CPDF_Type3Font.
Definition at line 121 of file cpdf_font.cpp.
|
staticconstexpr |
Definition at line 63 of file cpdf_font.h.
Referenced by CPDF_TextObject::GetCharCode(), CPDF_TextObject::GetCharInfo(), CPVT_VariableText::Provider::GetCharWidth(), CPWL_EditImpl::Provider::GetCharWidth(), CPDF_TextObject::GetItemInfo(), and CPVT_VariableText::Provider::GetWordFontIndex().
|
protected |
Definition at line 180 of file cpdf_font.h.
Referenced by CheckFontMetrics(), GetTypeAscent(), and LoadFontDescriptor().
|
protected |
Definition at line 175 of file cpdf_font.h.
|
mutableprotected |
Definition at line 177 of file cpdf_font.h.
Referenced by CharCodeFromUnicode(), LoadUnicodeMap(), and UnicodeFromCharCode().
|
protected |
Definition at line 181 of file cpdf_font.h.
Referenced by CheckFontMetrics(), GetTypeDescent(), and LoadFontDescriptor().
|
protected |
Definition at line 178 of file cpdf_font.h.
Referenced by GetFontFlags(), CPDF_Type1Font::Load(), CPDF_SimpleFont::LoadCommon(), LoadFontDescriptor(), CPDF_Type1Font::LoadGlyphMap(), and CPDF_SimpleFont::LoadSubstFont().
|
protected |
Definition at line 171 of file cpdf_font.h.
|
protected |
Definition at line 183 of file cpdf_font.h.
Referenced by CheckFontMetrics(), GetFontBBox(), CPDF_Type3Font::Load(), and LoadFontDescriptor().
|
protected |
Definition at line 172 of file cpdf_font.h.
|
protected |
Definition at line 182 of file cpdf_font.h.
Referenced by GetItalicAngle(), and LoadFontDescriptor().
|
protected |
Definition at line 169 of file cpdf_font.h.
|
protected |
Definition at line 174 of file cpdf_font.h.
|
protected |
Definition at line 173 of file cpdf_font.h.
|
mutableprotected |
Definition at line 176 of file cpdf_font.h.
|
protected |
Definition at line 170 of file cpdf_font.h.
|
protected |
Definition at line 179 of file cpdf_font.h.
Referenced by GetFontWeight(), and LoadFontDescriptor().