OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const; | 144 void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const; |
145 | 145 |
146 void GetFontBBox(FX_RECT& rect) const { rect = m_FontBBox; } | 146 void GetFontBBox(FX_RECT& rect) const { rect = m_FontBBox; } |
147 int GetTypeAscent() const { return m_Ascent; } | 147 int GetTypeAscent() const { return m_Ascent; } |
148 int GetTypeDescent() const { return m_Descent; } | 148 int GetTypeDescent() const { return m_Descent; } |
149 int GetItalicAngle() const { return m_ItalicAngle; } | 149 int GetItalicAngle() const { return m_ItalicAngle; } |
150 int GetStemV() const { return m_StemV; } | 150 int GetStemV() const { return m_StemV; } |
151 int GetStringWidth(const FX_CHAR* pString, int size); | 151 int GetStringWidth(const FX_CHAR* pString, int size); |
152 | 152 |
153 virtual int GetCharWidthF(FX_DWORD charcode, int level = 0) = 0; | 153 virtual int GetCharWidthF(FX_DWORD charcode, int level = 0) = 0; |
154 virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) = 0; | 154 virtual FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) = 0; |
155 | 155 |
156 CPDF_Document* m_pDocument; | 156 CPDF_Document* m_pDocument; |
157 CFX_Font m_Font; | 157 CFX_Font m_Font; |
158 | 158 |
159 protected: | 159 protected: |
160 CPDF_Font(); | 160 CPDF_Font(); |
161 | 161 |
162 virtual FX_BOOL Load() = 0; | 162 virtual FX_BOOL Load() = 0; |
163 | 163 |
164 FX_BOOL Initialize(); | 164 FX_BOOL Initialize(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 FX_WCHAR m_Unicodes[256]; | 221 FX_WCHAR m_Unicodes[256]; |
222 }; | 222 }; |
223 | 223 |
224 class CPDF_SimpleFont : public CPDF_Font { | 224 class CPDF_SimpleFont : public CPDF_Font { |
225 public: | 225 public: |
226 CPDF_SimpleFont(); | 226 CPDF_SimpleFont(); |
227 ~CPDF_SimpleFont() override; | 227 ~CPDF_SimpleFont() override; |
228 | 228 |
229 // CPDF_Font: | 229 // CPDF_Font: |
230 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; | 230 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; |
231 void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; | 231 FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override; |
232 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; | 232 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; |
233 FX_BOOL IsUnicodeCompatible() const override; | 233 FX_BOOL IsUnicodeCompatible() const override; |
234 CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override; | 234 CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override; |
235 FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const override; | 235 FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const override; |
236 | 236 |
237 CPDF_FontEncoding* GetEncoding() { return &m_Encoding; } | 237 CPDF_FontEncoding* GetEncoding() { return &m_Encoding; } |
238 | 238 |
239 protected: | 239 protected: |
240 virtual void LoadGlyphMap() = 0; | 240 virtual void LoadGlyphMap() = 0; |
241 | 241 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 class CPDF_Type3Font : public CPDF_SimpleFont { | 312 class CPDF_Type3Font : public CPDF_SimpleFont { |
313 public: | 313 public: |
314 CPDF_Type3Font(); | 314 CPDF_Type3Font(); |
315 ~CPDF_Type3Font() override; | 315 ~CPDF_Type3Font() override; |
316 | 316 |
317 // CPDF_Font: | 317 // CPDF_Font: |
318 bool IsType3Font() const override { return true; } | 318 bool IsType3Font() const override { return true; } |
319 const CPDF_Type3Font* AsType3Font() const override { return this; } | 319 const CPDF_Type3Font* AsType3Font() const override { return this; } |
320 CPDF_Type3Font* AsType3Font() override { return this; } | 320 CPDF_Type3Font* AsType3Font() override { return this; } |
321 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; | 321 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; |
322 void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; | 322 FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override; |
323 | 323 |
324 void SetPageResources(CPDF_Dictionary* pResources) { | 324 void SetPageResources(CPDF_Dictionary* pResources) { |
325 m_pPageResources = pResources; | 325 m_pPageResources = pResources; |
326 } | 326 } |
327 CPDF_Type3Char* LoadChar(FX_DWORD charcode, int level = 0); | 327 CPDF_Type3Char* LoadChar(FX_DWORD charcode, int level = 0); |
328 void CheckType3FontMetrics(); | 328 void CheckType3FontMetrics(); |
329 | 329 |
330 CFX_Matrix& GetFontMatrix() { return m_FontMatrix; } | 330 CFX_Matrix& GetFontMatrix() { return m_FontMatrix; } |
331 | 331 |
332 protected: | 332 protected: |
(...skipping 29 matching lines...) Expand all Loading... |
362 ~CPDF_CIDFont() override; | 362 ~CPDF_CIDFont() override; |
363 | 363 |
364 static FX_FLOAT CIDTransformToFloat(uint8_t ch); | 364 static FX_FLOAT CIDTransformToFloat(uint8_t ch); |
365 | 365 |
366 // CPDF_Font: | 366 // CPDF_Font: |
367 bool IsCIDFont() const override { return true; } | 367 bool IsCIDFont() const override { return true; } |
368 const CPDF_CIDFont* AsCIDFont() const override { return this; } | 368 const CPDF_CIDFont* AsCIDFont() const override { return this; } |
369 CPDF_CIDFont* AsCIDFont() override { return this; } | 369 CPDF_CIDFont* AsCIDFont() override { return this; } |
370 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; | 370 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; |
371 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; | 371 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; |
372 void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; | 372 FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override; |
373 FX_DWORD GetNextChar(const FX_CHAR* pString, | 373 FX_DWORD GetNextChar(const FX_CHAR* pString, |
374 int nStrLen, | 374 int nStrLen, |
375 int& offset) const override; | 375 int& offset) const override; |
376 int CountChar(const FX_CHAR* pString, int size) const override; | 376 int CountChar(const FX_CHAR* pString, int size) const override; |
377 int AppendChar(FX_CHAR* str, FX_DWORD charcode) const override; | 377 int AppendChar(FX_CHAR* str, FX_DWORD charcode) const override; |
378 int GetCharSize(FX_DWORD charcode) const override; | 378 int GetCharSize(FX_DWORD charcode) const override; |
379 FX_BOOL IsVertWriting() const override; | 379 FX_BOOL IsVertWriting() const override; |
380 FX_BOOL IsUnicodeCompatible() const override; | 380 FX_BOOL IsUnicodeCompatible() const override; |
381 FX_BOOL Load() override; | 381 FX_BOOL Load() override; |
382 CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override; | 382 CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 | 780 |
781 FX_BOOL m_bInterpolate; | 781 FX_BOOL m_bInterpolate; |
782 | 782 |
783 CPDF_Document* m_pDocument; | 783 CPDF_Document* m_pDocument; |
784 | 784 |
785 CPDF_Dictionary* m_pOC; | 785 CPDF_Dictionary* m_pOC; |
786 CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size); | 786 CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size); |
787 }; | 787 }; |
788 | 788 |
789 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ | 789 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ |
OLD | NEW |