| 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_FXGE_FX_FONT_H_ | 7 #ifndef CORE_INCLUDE_FXGE_FX_FONT_H_ |
| 8 #define CORE_INCLUDE_FXGE_FX_FONT_H_ | 8 #define CORE_INCLUDE_FXGE_FX_FONT_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 CFX_Font* m_pFont; | 132 CFX_Font* m_pFont; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 #define FXFONT_SUBST_MM 0x01 | 135 #define FXFONT_SUBST_MM 0x01 |
| 136 #define FXFONT_SUBST_GLYPHPATH 0x04 | 136 #define FXFONT_SUBST_GLYPHPATH 0x04 |
| 137 #define FXFONT_SUBST_CLEARTYPE 0x08 | 137 #define FXFONT_SUBST_CLEARTYPE 0x08 |
| 138 #define FXFONT_SUBST_TRANSFORM 0x10 | 138 #define FXFONT_SUBST_TRANSFORM 0x10 |
| 139 #define FXFONT_SUBST_NONSYMBOL 0x20 | 139 #define FXFONT_SUBST_NONSYMBOL 0x20 |
| 140 #define FXFONT_SUBST_EXACT 0x40 | 140 #define FXFONT_SUBST_EXACT 0x40 |
| 141 #define FXFONT_SUBST_STANDARD 0x80 | 141 #define FXFONT_SUBST_STANDARD 0x80 |
| 142 |
| 142 class CFX_SubstFont { | 143 class CFX_SubstFont { |
| 143 public: | 144 public: |
| 144 CFX_SubstFont(); | 145 CFX_SubstFont(); |
| 145 | 146 |
| 146 void* m_ExtHandle; | 147 void* m_ExtHandle; |
| 147 | 148 |
| 148 CFX_ByteString m_Family; | 149 CFX_ByteString m_Family; |
| 149 | 150 |
| 150 int m_Charset; | 151 int m_Charset; |
| 151 | 152 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 #define FX_FONTCACHE_DEFINE(pFontCache, pFont) \ | 379 #define FX_FONTCACHE_DEFINE(pFontCache, pFont) \ |
| 379 CFX_AutoFontCache autoFontCache((pFontCache), (pFont)) | 380 CFX_AutoFontCache autoFontCache((pFontCache), (pFont)) |
| 380 class CFX_GlyphBitmap { | 381 class CFX_GlyphBitmap { |
| 381 public: | 382 public: |
| 382 int m_Top; | 383 int m_Top; |
| 383 int m_Left; | 384 int m_Left; |
| 384 CFX_DIBitmap m_Bitmap; | 385 CFX_DIBitmap m_Bitmap; |
| 385 }; | 386 }; |
| 386 class CFX_FaceCache { | 387 class CFX_FaceCache { |
| 387 public: | 388 public: |
| 389 explicit CFX_FaceCache(FXFT_Face face); |
| 388 ~CFX_FaceCache(); | 390 ~CFX_FaceCache(); |
| 389 const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, | 391 const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, |
| 390 FX_DWORD glyph_index, | 392 FX_DWORD glyph_index, |
| 391 FX_BOOL bFontStyle, | 393 FX_BOOL bFontStyle, |
| 392 const CFX_AffineMatrix* pMatrix, | 394 const CFX_AffineMatrix* pMatrix, |
| 393 int dest_width, | 395 int dest_width, |
| 394 int anti_alias, | 396 int anti_alias, |
| 395 int& text_flags); | 397 int& text_flags); |
| 396 const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, | 398 const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, |
| 397 FX_DWORD glyph_index, | 399 FX_DWORD glyph_index, |
| 398 int dest_width); | 400 int dest_width); |
| 399 | 401 |
| 400 CFX_FaceCache(FXFT_Face face); | |
| 401 | |
| 402 private: | 402 private: |
| 403 FXFT_Face m_Face; | |
| 404 CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, | 403 CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, |
| 405 FX_DWORD glyph_index, | 404 FX_DWORD glyph_index, |
| 406 FX_BOOL bFontStyle, | 405 FX_BOOL bFontStyle, |
| 407 const CFX_AffineMatrix* pMatrix, | 406 const CFX_AffineMatrix* pMatrix, |
| 408 int dest_width, | 407 int dest_width, |
| 409 int anti_alias); | 408 int anti_alias); |
| 410 CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, | 409 CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, |
| 411 FX_DWORD glyph_index, | 410 FX_DWORD glyph_index, |
| 412 const CFX_AffineMatrix* pMatrix, | 411 const CFX_AffineMatrix* pMatrix, |
| 413 int dest_width, | 412 int dest_width, |
| 414 int anti_alias); | 413 int anti_alias); |
| 415 CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, | 414 CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, |
| 416 const CFX_AffineMatrix* pMatrix, | 415 const CFX_AffineMatrix* pMatrix, |
| 417 CFX_ByteStringC& FaceGlyphsKey, | 416 CFX_ByteStringC& FaceGlyphsKey, |
| 418 FX_DWORD glyph_index, | 417 FX_DWORD glyph_index, |
| 419 FX_BOOL bFontStyle, | 418 FX_BOOL bFontStyle, |
| 420 int dest_width, | 419 int dest_width, |
| 421 int anti_alias); | 420 int anti_alias); |
| 421 void InitPlatform(); |
| 422 void DestroyPlatform(); |
| 423 |
| 424 FXFT_Face const m_Face; |
| 422 std::map<CFX_ByteString, CFX_SizeGlyphCache*> m_SizeMap; | 425 std::map<CFX_ByteString, CFX_SizeGlyphCache*> m_SizeMap; |
| 423 CFX_MapPtrToPtr m_PathMap; | 426 CFX_MapPtrToPtr m_PathMap; |
| 424 CFX_DIBitmap* m_pBitmap; | 427 CFX_DIBitmap* m_pBitmap; |
| 428 }; |
| 425 | 429 |
| 426 void InitPlatform(); | 430 struct FXTEXT_GLYPHPOS { |
| 427 void DestroyPlatform(); | 431 const CFX_GlyphBitmap* m_pGlyph; |
| 432 int m_OriginX; |
| 433 int m_OriginY; |
| 434 FX_FLOAT m_fOriginX; |
| 435 FX_FLOAT m_fOriginY; |
| 428 }; | 436 }; |
| 429 typedef struct { | 437 |
| 430 const CFX_GlyphBitmap* m_pGlyph; | |
| 431 int m_OriginX, m_OriginY; | |
| 432 FX_FLOAT m_fOriginX, m_fOriginY; | |
| 433 } FXTEXT_GLYPHPOS; | |
| 434 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, | 438 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, |
| 435 int nChars, | 439 int nChars, |
| 436 int anti_alias, | 440 int anti_alias, |
| 437 FX_FLOAT retinaScaleX = 1.0f, | 441 FX_FLOAT retinaScaleX = 1.0f, |
| 438 FX_FLOAT retinaScaleY = 1.0f); | 442 FX_FLOAT retinaScaleY = 1.0f); |
| 439 | 443 |
| 440 class IFX_GSUBTable { | 444 class IFX_GSUBTable { |
| 441 public: | 445 public: |
| 442 static IFX_GSUBTable* Create(CFX_Font* pFont); | 446 static IFX_GSUBTable* Create(CFX_Font* pFont); |
| 443 virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0; | 447 virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0; |
| 444 | 448 |
| 445 protected: | 449 protected: |
| 446 virtual ~IFX_GSUBTable() {} | 450 virtual ~IFX_GSUBTable() {} |
| 447 }; | 451 }; |
| 448 | 452 |
| 449 CFX_ByteString GetNameFromTT(const uint8_t* name_table, FX_DWORD name); | 453 CFX_ByteString GetNameFromTT(const uint8_t* name_table, FX_DWORD name); |
| 450 | 454 |
| 451 int PDF_GetStandardFontName(CFX_ByteString* name); | 455 int PDF_GetStandardFontName(CFX_ByteString* name); |
| 452 | 456 |
| 453 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ | 457 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ |
| OLD | NEW |