summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi/fpdf_resource.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/fpdfapi/fpdf_resource.h')
-rw-r--r--core/include/fpdfapi/fpdf_resource.h72
1 files changed, 42 insertions, 30 deletions
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index 6bae2ac469..450e878fa1 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -102,37 +102,39 @@ class CPDF_Font {
virtual ~CPDF_Font();
- 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 bool IsType1Font() const { return false; }
+ virtual bool IsTrueTypeFont() const { return false; }
+ virtual bool IsType3Font() const { return false; }
+ virtual bool IsCIDFont() const { return false; }
+ virtual const CPDF_Type1Font* AsType1Font() const { return nullptr; }
+ virtual CPDF_Type1Font* AsType1Font() { return nullptr; }
+ virtual const CPDF_TrueTypeFont* AsTrueTypeFont() const { return nullptr; }
+ virtual CPDF_TrueTypeFont* AsTrueTypeFont() { return nullptr; }
+ virtual const CPDF_Type3Font* AsType3Font() const { return nullptr; }
+ virtual CPDF_Type3Font* AsType3Font() { return nullptr; }
+ virtual const CPDF_CIDFont* AsCIDFont() const { return nullptr; }
+ virtual CPDF_CIDFont* AsCIDFont() { return nullptr; }
virtual FX_BOOL IsVertWriting() const;
- virtual FX_BOOL IsUnicodeCompatible() const;
+ virtual FX_BOOL IsUnicodeCompatible() const { return FALSE; }
virtual FX_DWORD GetNextChar(const FX_CHAR* pString,
int nStrLen,
int& offset) const;
- virtual int CountChar(const FX_CHAR* pString, int size) const;
+ virtual int CountChar(const FX_CHAR* pString, int size) const { return size; }
virtual int AppendChar(FX_CHAR* buf, FX_DWORD charcode) const;
- virtual int GetCharSize(FX_DWORD charcode) const;
+ virtual int GetCharSize(FX_DWORD charcode) const { return 1; }
virtual int GlyphFromCharCode(FX_DWORD charcode,
- FX_BOOL* pVertGlyph = nullptr);
- virtual int GlyphFromCharCodeExt(FX_DWORD charcode);
+ FX_BOOL* pVertGlyph = NULL) = 0;
+ virtual int GlyphFromCharCodeExt(FX_DWORD charcode) {
+ return GlyphFromCharCode(charcode);
+ }
virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const;
virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const;
const CFX_ByteString& GetBaseFont() const { return m_BaseFont; }
const CFX_SubstFont* GetSubstFont() const { return m_Font.GetSubstFont(); }
FX_DWORD GetFlags() const { return m_Flags; }
- FX_BOOL IsEmbedded() const { return IsType3Font() || m_pFontFile != nullptr; }
+ FX_BOOL IsEmbedded() const { return IsType3Font() || m_pFontFile != NULL; }
CPDF_StreamAcc* GetFontFile() const { return m_pFontFile; }
CPDF_Dictionary* GetFontDict() const { return m_pFontDict; }
FX_BOOL IsStandardFont() const;
@@ -255,9 +257,9 @@ class CPDF_Type1Font : public CPDF_SimpleFont {
CPDF_Type1Font();
// CPDF_Font:
- bool IsType1Font() const override;
- const CPDF_Type1Font* AsType1Font() const override;
- CPDF_Type1Font* AsType1Font() override;
+ bool IsType1Font() const override { return true; }
+ const CPDF_Type1Font* AsType1Font() const override { return this; }
+ CPDF_Type1Font* AsType1Font() override { return this; }
int GlyphFromCharCodeExt(FX_DWORD charcode) override;
int GetBase14Font() const { return m_Base14Font; }
@@ -277,9 +279,9 @@ class CPDF_TrueTypeFont : public CPDF_SimpleFont {
CPDF_TrueTypeFont();
// CPDF_Font:
- bool IsTrueTypeFont() const override;
- const CPDF_TrueTypeFont* AsTrueTypeFont() const override;
- CPDF_TrueTypeFont* AsTrueTypeFont() override;
+ bool IsTrueTypeFont() const override { return true; }
+ const CPDF_TrueTypeFont* AsTrueTypeFont() const override { return this; }
+ CPDF_TrueTypeFont* AsTrueTypeFont() override { return this; }
protected:
// CPDF_Font:
@@ -311,9 +313,9 @@ class CPDF_Type3Font : public CPDF_SimpleFont {
~CPDF_Type3Font() override;
// CPDF_Font:
- bool IsType3Font() const override;
- const CPDF_Type3Font* AsType3Font() const override;
- CPDF_Type3Font* AsType3Font() override;
+ bool IsType3Font() const override { return true; }
+ const CPDF_Type3Font* AsType3Font() const override { return this; }
+ CPDF_Type3Font* AsType3Font() override { return this; }
int GetCharWidthF(FX_DWORD charcode, int level = 0) override;
FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override;
@@ -360,9 +362,9 @@ class CPDF_CIDFont : public CPDF_Font {
static FX_FLOAT CIDTransformToFloat(uint8_t ch);
// CPDF_Font:
- bool IsCIDFont() const override;
- const CPDF_CIDFont* AsCIDFont() const override;
- CPDF_CIDFont* AsCIDFont() override;
+ bool IsCIDFont() const override { return true; }
+ const CPDF_CIDFont* AsCIDFont() const override { return this; }
+ CPDF_CIDFont* AsCIDFont() override { return this; }
int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override;
int GetCharWidthF(FX_DWORD charcode, int level = 0) override;
FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override;
@@ -432,10 +434,15 @@ class CPDF_ColorSpace {
void ReleaseCS();
int GetBufSize() const;
+
FX_FLOAT* CreateBuf();
+
void GetDefaultColor(FX_FLOAT* buf) const;
+
int CountComponents() const { return m_nComponents; }
+
int GetFamily() const { return m_Family; }
+
virtual void GetDefaultValue(int iComponent,
FX_FLOAT& value,
FX_FLOAT& min,
@@ -446,10 +453,12 @@ class CPDF_ColorSpace {
}
FX_BOOL sRGB() const;
+
virtual FX_BOOL GetRGB(FX_FLOAT* pBuf,
FX_FLOAT& R,
FX_FLOAT& G,
FX_FLOAT& B) const = 0;
+
virtual FX_BOOL SetRGB(FX_FLOAT* pBuf,
FX_FLOAT R,
FX_FLOAT G,
@@ -462,6 +471,7 @@ class CPDF_ColorSpace {
FX_FLOAT& m,
FX_FLOAT& y,
FX_FLOAT& k) const;
+
FX_BOOL SetCMYK(FX_FLOAT* pBuf,
FX_FLOAT c,
FX_FLOAT m,
@@ -476,7 +486,9 @@ class CPDF_ColorSpace {
FX_BOOL bTransMask = FALSE) const;
CPDF_Array*& GetArray() { return m_pArray; }
+
int GetMaxIndex() const;
+
virtual CPDF_ColorSpace* GetBaseCS() const { return NULL; }
virtual void EnableStdConversion(FX_BOOL bEnabled);