diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-17 13:17:49 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-17 13:17:49 -0700 |
commit | 7a8387e670a2f879b9b2f1fc7bb67064f73fb249 (patch) | |
tree | 237ccb53166295bd5aebc4c1d3964ff3caa9bc06 /core/include/fpdfapi | |
parent | a07aa98240c747912b16e474389a7808cc50a10c (diff) | |
download | pdfium-7a8387e670a2f879b9b2f1fc7bb67064f73fb249.tar.xz |
Merge to XFA: Set m_FontType in CPDF_Font() constructor.
Original Review URL: https://codereview.chromium.org/1060813003
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1060843005
Diffstat (limited to 'core/include/fpdfapi')
-rw-r--r-- | core/include/fpdfapi/fpdf_resource.h | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h index 86084d0b72..4a85096900 100644 --- a/core/include/fpdfapi/fpdf_resource.h +++ b/core/include/fpdfapi/fpdf_resource.h @@ -76,23 +76,16 @@ typedef CFX_MapPtrTemplate<CPDF_Stream*, CPDF_CountedStreamAcc*> CPDF_FontFil #define PDFFONT_USEEXTERNATTR 0x80000 FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name); CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode); -class CPDF_Font +class CPDF_Font { public: - static CPDF_Font* CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDict); - static CPDF_Font* GetStockFont(CPDF_Document* pDoc, FX_BSTR fontname); virtual ~CPDF_Font(); - - - - int GetFontType() const - { - return m_FontType; - } + bool IsFontType(int fonttype) const { return fonttype == m_FontType; } + int GetFontType() const { return m_FontType; } CFX_ByteString GetFontTypeName() const; @@ -256,9 +249,9 @@ public: class CFX_PathData* LoadGlyphPath(FX_DWORD charcode, int dest_width = 0); CFX_Font m_Font; -protected: - CPDF_Font(); +protected: + explicit CPDF_Font(int fonttype); FX_BOOL Initialize(); @@ -285,8 +278,6 @@ protected: - int m_FontType; - CFX_ByteString m_BaseFont; CPDF_StreamAcc* m_pFontFile; @@ -312,6 +303,8 @@ protected: int m_ItalicAngle; +private: + const int m_FontType; }; #define PDFFONT_ENCODING_BUILTIN 0 #define PDFFONT_ENCODING_WINANSI 1 @@ -355,10 +348,8 @@ public: class CPDF_SimpleFont : public CPDF_Font { public: - - CPDF_SimpleFont(); - - virtual ~CPDF_SimpleFont(); + explicit CPDF_SimpleFont(int fonttype); + ~CPDF_SimpleFont() override; CPDF_FontEncoding* GetEncoding() { @@ -469,7 +460,7 @@ class CPDF_Type3Font : public CPDF_SimpleFont { public: CPDF_Type3Font(); - virtual ~CPDF_Type3Font(); + ~CPDF_Type3Font() override; void SetPageResources(CPDF_Dictionary* pResources) { m_pPageResources = pResources; |