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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 FX_WORD m_CharWidth[256]; | 339 FX_WORD m_CharWidth[256]; |
340 FX_SMALL_RECT m_CharBBox[256]; | 340 FX_SMALL_RECT m_CharBBox[256]; |
341 FX_BOOL m_bUseFontWidth; | 341 FX_BOOL m_bUseFontWidth; |
342 }; | 342 }; |
343 | 343 |
344 class CPDF_Type1Font : public CPDF_SimpleFont { | 344 class CPDF_Type1Font : public CPDF_SimpleFont { |
345 public: | 345 public: |
346 CPDF_Type1Font(); | 346 CPDF_Type1Font(); |
347 | 347 |
348 int GetBase14Font() { return m_Base14Font; } | 348 int GetBase14Font() { return m_Base14Font; } |
349 virtual int GlyphFromCharCodeExt(FX_DWORD charcode); | |
350 | 349 |
351 protected: | 350 protected: |
352 virtual FX_BOOL _Load(); | 351 // CPDF_SimpleFont: |
| 352 int GlyphFromCharCodeExt(FX_DWORD charcode) override; |
| 353 FX_BOOL _Load() override; |
| 354 void LoadGlyphMap() override; |
353 | 355 |
354 int m_Base14Font; | 356 int m_Base14Font; |
355 virtual void LoadGlyphMap(); | |
356 }; | 357 }; |
357 class CPDF_TrueTypeFont : public CPDF_SimpleFont { | 358 class CPDF_TrueTypeFont : public CPDF_SimpleFont { |
358 public: | 359 public: |
359 CPDF_TrueTypeFont(); | 360 CPDF_TrueTypeFont(); |
360 | 361 |
361 protected: | 362 protected: |
362 virtual FX_BOOL _Load(); | 363 // CPDF_SimpleFont: |
363 virtual void LoadGlyphMap(); | 364 FX_BOOL _Load() override; |
| 365 void LoadGlyphMap() override; |
364 }; | 366 }; |
365 | 367 |
366 class CPDF_Type3Char { | 368 class CPDF_Type3Char { |
367 public: | 369 public: |
368 // Takes ownership of |pForm|. | 370 // Takes ownership of |pForm|. |
369 explicit CPDF_Type3Char(CPDF_Form* pForm); | 371 explicit CPDF_Type3Char(CPDF_Form* pForm); |
370 ~CPDF_Type3Char(); | 372 ~CPDF_Type3Char(); |
371 | 373 |
372 FX_BOOL LoadBitmap(CPDF_RenderContext* pContext); | 374 FX_BOOL LoadBitmap(CPDF_RenderContext* pContext); |
373 | 375 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 }; | 423 }; |
422 | 424 |
423 class CPDF_CIDFont : public CPDF_Font { | 425 class CPDF_CIDFont : public CPDF_Font { |
424 public: | 426 public: |
425 CPDF_CIDFont(); | 427 CPDF_CIDFont(); |
426 | 428 |
427 ~CPDF_CIDFont() override; | 429 ~CPDF_CIDFont() override; |
428 | 430 |
429 static FX_FLOAT CIDTransformToFloat(uint8_t ch); | 431 static FX_FLOAT CIDTransformToFloat(uint8_t ch); |
430 | 432 |
431 FX_BOOL LoadGB2312(); | 433 // CPDF_Font: |
432 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; | 434 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; |
433 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; | 435 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; |
434 void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; | 436 void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; |
435 FX_WORD CIDFromCharCode(FX_DWORD charcode) const; | 437 FX_DWORD GetNextChar(const FX_CHAR* pString, |
436 | 438 int nStrLen, |
437 FX_BOOL IsTrueType() const { return !m_bType1; } | 439 int& offset) const override; |
438 | |
439 virtual FX_DWORD GetNextChar(const FX_CHAR* pString, | |
440 int nStrLen, | |
441 int& offset) const override; | |
442 int CountChar(const FX_CHAR* pString, int size) const override; | 440 int CountChar(const FX_CHAR* pString, int size) const override; |
443 int AppendChar(FX_CHAR* str, FX_DWORD charcode) const override; | 441 int AppendChar(FX_CHAR* str, FX_DWORD charcode) const override; |
444 int GetCharSize(FX_DWORD charcode) const override; | 442 int GetCharSize(FX_DWORD charcode) const override; |
| 443 FX_BOOL IsVertWriting() const override; |
| 444 FX_BOOL IsUnicodeCompatible() const override; |
| 445 FX_BOOL _Load() override; |
| 446 FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const override; |
| 447 FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const override; |
| 448 |
| 449 FX_BOOL LoadGB2312(); |
| 450 FX_WORD CIDFromCharCode(FX_DWORD charcode) const; |
| 451 FX_BOOL IsTrueType() const { return !m_bType1; } |
445 const uint8_t* GetCIDTransform(FX_WORD CID) const; | 452 const uint8_t* GetCIDTransform(FX_WORD CID) const; |
446 FX_BOOL IsVertWriting() const override; | |
447 short GetVertWidth(FX_WORD CID) const; | 453 short GetVertWidth(FX_WORD CID) const; |
448 void GetVertOrigin(FX_WORD CID, short& vx, short& vy) const; | 454 void GetVertOrigin(FX_WORD CID, short& vx, short& vy) const; |
449 FX_BOOL IsUnicodeCompatible() const override; | |
450 virtual FX_BOOL IsFontStyleFromCharCode(FX_DWORD charcode) const; | 455 virtual FX_BOOL IsFontStyleFromCharCode(FX_DWORD charcode) const; |
451 | 456 |
452 protected: | 457 protected: |
453 friend class CPDF_Font; | 458 friend class CPDF_Font; |
454 | 459 |
455 FX_BOOL _Load() override; | |
456 FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const override; | |
457 FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const override; | |
458 int GetGlyphIndex(FX_DWORD unicodeb, FX_BOOL* pVertGlyph); | 460 int GetGlyphIndex(FX_DWORD unicodeb, FX_BOOL* pVertGlyph); |
459 void LoadMetricsArray(CPDF_Array* pArray, | 461 void LoadMetricsArray(CPDF_Array* pArray, |
460 CFX_DWordArray& result, | 462 CFX_DWordArray& result, |
461 int nElements); | 463 int nElements); |
462 void LoadSubstFont(); | 464 void LoadSubstFont(); |
463 | 465 |
464 CPDF_CMap* m_pCMap; | 466 CPDF_CMap* m_pCMap; |
465 CPDF_CMap* m_pAllocatedCMap; | 467 CPDF_CMap* m_pAllocatedCMap; |
466 CPDF_CID2UnicodeMap* m_pCID2UnicodeMap; | 468 CPDF_CID2UnicodeMap* m_pCID2UnicodeMap; |
467 CIDSet m_Charset; | 469 CIDSet m_Charset; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 | 852 |
851 FX_BOOL m_bInterpolate; | 853 FX_BOOL m_bInterpolate; |
852 | 854 |
853 CPDF_Document* m_pDocument; | 855 CPDF_Document* m_pDocument; |
854 | 856 |
855 CPDF_Dictionary* m_pOC; | 857 CPDF_Dictionary* m_pOC; |
856 CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size); | 858 CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size); |
857 }; | 859 }; |
858 | 860 |
859 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ | 861 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ |
OLD | NEW |