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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const; | 142 void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const; |
143 | 143 |
144 void GetFontBBox(FX_RECT& rect) const { rect = m_FontBBox; } | 144 void GetFontBBox(FX_RECT& rect) const { rect = m_FontBBox; } |
145 int GetTypeAscent() const { return m_Ascent; } | 145 int GetTypeAscent() const { return m_Ascent; } |
146 int GetTypeDescent() const { return m_Descent; } | 146 int GetTypeDescent() const { return m_Descent; } |
147 int GetItalicAngle() const { return m_ItalicAngle; } | 147 int GetItalicAngle() const { return m_ItalicAngle; } |
148 int GetStemV() const { return m_StemV; } | 148 int GetStemV() const { return m_StemV; } |
149 int GetStringWidth(const FX_CHAR* pString, int size); | 149 int GetStringWidth(const FX_CHAR* pString, int size); |
150 | 150 |
151 virtual int GetCharWidthF(FX_DWORD charcode, int level = 0) = 0; | 151 virtual int GetCharWidthF(FX_DWORD charcode, int level = 0) = 0; |
152 virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) = 0; | 152 virtual FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) = 0; |
153 | 153 |
154 CPDF_Document* m_pDocument; | 154 CPDF_Document* m_pDocument; |
155 CFX_Font m_Font; | 155 CFX_Font m_Font; |
156 | 156 |
157 protected: | 157 protected: |
158 CPDF_Font(); | 158 CPDF_Font(); |
159 | 159 |
160 virtual FX_BOOL Load() = 0; | 160 virtual FX_BOOL Load() = 0; |
161 | 161 |
162 FX_BOOL Initialize(); | 162 FX_BOOL Initialize(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 FX_WCHAR m_Unicodes[256]; | 219 FX_WCHAR m_Unicodes[256]; |
220 }; | 220 }; |
221 | 221 |
222 class CPDF_SimpleFont : public CPDF_Font { | 222 class CPDF_SimpleFont : public CPDF_Font { |
223 public: | 223 public: |
224 CPDF_SimpleFont(); | 224 CPDF_SimpleFont(); |
225 ~CPDF_SimpleFont() override; | 225 ~CPDF_SimpleFont() override; |
226 | 226 |
227 // CPDF_Font: | 227 // CPDF_Font: |
228 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; | 228 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; |
229 void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; | 229 FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override; |
230 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; | 230 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; |
231 FX_BOOL IsUnicodeCompatible() const override; | 231 FX_BOOL IsUnicodeCompatible() const override; |
232 CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override; | 232 CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override; |
233 FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const override; | 233 FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const override; |
234 | 234 |
235 CPDF_FontEncoding* GetEncoding() { return &m_Encoding; } | 235 CPDF_FontEncoding* GetEncoding() { return &m_Encoding; } |
236 | 236 |
237 protected: | 237 protected: |
238 virtual void LoadGlyphMap() = 0; | 238 virtual void LoadGlyphMap() = 0; |
239 | 239 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 class CPDF_Type3Font : public CPDF_SimpleFont { | 310 class CPDF_Type3Font : public CPDF_SimpleFont { |
311 public: | 311 public: |
312 CPDF_Type3Font(); | 312 CPDF_Type3Font(); |
313 ~CPDF_Type3Font() override; | 313 ~CPDF_Type3Font() override; |
314 | 314 |
315 // CPDF_Font: | 315 // CPDF_Font: |
316 bool IsType3Font() const override { return true; } | 316 bool IsType3Font() const override { return true; } |
317 const CPDF_Type3Font* AsType3Font() const override { return this; } | 317 const CPDF_Type3Font* AsType3Font() const override { return this; } |
318 CPDF_Type3Font* AsType3Font() override { return this; } | 318 CPDF_Type3Font* AsType3Font() override { return this; } |
319 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; | 319 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; |
320 void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; | 320 FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override; |
321 | 321 |
322 void SetPageResources(CPDF_Dictionary* pResources) { | 322 void SetPageResources(CPDF_Dictionary* pResources) { |
323 m_pPageResources = pResources; | 323 m_pPageResources = pResources; |
324 } | 324 } |
325 CPDF_Type3Char* LoadChar(FX_DWORD charcode, int level = 0); | 325 CPDF_Type3Char* LoadChar(FX_DWORD charcode, int level = 0); |
326 void CheckType3FontMetrics(); | 326 void CheckType3FontMetrics(); |
327 | 327 |
328 CFX_Matrix& GetFontMatrix() { return m_FontMatrix; } | 328 CFX_Matrix& GetFontMatrix() { return m_FontMatrix; } |
329 | 329 |
330 protected: | 330 protected: |
(...skipping 29 matching lines...) Expand all Loading... |
360 ~CPDF_CIDFont() override; | 360 ~CPDF_CIDFont() override; |
361 | 361 |
362 static FX_FLOAT CIDTransformToFloat(uint8_t ch); | 362 static FX_FLOAT CIDTransformToFloat(uint8_t ch); |
363 | 363 |
364 // CPDF_Font: | 364 // CPDF_Font: |
365 bool IsCIDFont() const override { return true; } | 365 bool IsCIDFont() const override { return true; } |
366 const CPDF_CIDFont* AsCIDFont() const override { return this; } | 366 const CPDF_CIDFont* AsCIDFont() const override { return this; } |
367 CPDF_CIDFont* AsCIDFont() override { return this; } | 367 CPDF_CIDFont* AsCIDFont() override { return this; } |
368 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; | 368 int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override; |
369 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; | 369 int GetCharWidthF(FX_DWORD charcode, int level = 0) override; |
370 void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override; | 370 FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override; |
371 FX_DWORD GetNextChar(const FX_CHAR* pString, | 371 FX_DWORD GetNextChar(const FX_CHAR* pString, |
372 int nStrLen, | 372 int nStrLen, |
373 int& offset) const override; | 373 int& offset) const override; |
374 int CountChar(const FX_CHAR* pString, int size) const override; | 374 int CountChar(const FX_CHAR* pString, int size) const override; |
375 int AppendChar(FX_CHAR* str, FX_DWORD charcode) const override; | 375 int AppendChar(FX_CHAR* str, FX_DWORD charcode) const override; |
376 int GetCharSize(FX_DWORD charcode) const override; | 376 int GetCharSize(FX_DWORD charcode) const override; |
377 FX_BOOL IsVertWriting() const override; | 377 FX_BOOL IsVertWriting() const override; |
378 FX_BOOL IsUnicodeCompatible() const override; | 378 FX_BOOL IsUnicodeCompatible() const override; |
379 FX_BOOL Load() override; | 379 FX_BOOL Load() override; |
380 CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override; | 380 CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 | 778 |
779 FX_BOOL m_bInterpolate; | 779 FX_BOOL m_bInterpolate; |
780 | 780 |
781 CPDF_Document* m_pDocument; | 781 CPDF_Document* m_pDocument; |
782 | 782 |
783 CPDF_Dictionary* m_pOC; | 783 CPDF_Dictionary* m_pOC; |
784 CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size); | 784 CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size); |
785 }; | 785 }; |
786 | 786 |
787 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ | 787 #endif // CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_ |
OLD | NEW |