| 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_FXGE_FX_FONT_H_ | 7 #ifndef CORE_FXGE_FX_FONT_H_ |
| 8 #define CORE_FXGE_FX_FONT_H_ | 8 #define CORE_FXGE_FX_FONT_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 private: | 91 private: |
| 92 FT_Face m_Face; | 92 FT_Face m_Face; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 class CFX_Font { | 95 class CFX_Font { |
| 96 public: | 96 public: |
| 97 CFX_Font(); | 97 CFX_Font(); |
| 98 ~CFX_Font(); | 98 ~CFX_Font(); |
| 99 | 99 |
| 100 void LoadSubst(const CFX_ByteString& face_name, | 100 void LoadSubst(const CFX_ByteString& face_name, |
| 101 FX_BOOL bTrueType, | 101 bool bTrueType, |
| 102 uint32_t flags, | 102 uint32_t flags, |
| 103 int weight, | 103 int weight, |
| 104 int italic_angle, | 104 int italic_angle, |
| 105 int CharsetCP, | 105 int CharsetCP, |
| 106 bool bVertical); | 106 bool bVertical); |
| 107 | 107 |
| 108 FX_BOOL LoadEmbedded(const uint8_t* data, uint32_t size); | 108 bool LoadEmbedded(const uint8_t* data, uint32_t size); |
| 109 FXFT_Face GetFace() const { return m_Face; } | 109 FXFT_Face GetFace() const { return m_Face; } |
| 110 CFX_SubstFont* GetSubstFont() const { return m_pSubstFont.get(); } | 110 CFX_SubstFont* GetSubstFont() const { return m_pSubstFont.get(); } |
| 111 | 111 |
| 112 #ifdef PDF_ENABLE_XFA | 112 #ifdef PDF_ENABLE_XFA |
| 113 FX_BOOL LoadFile(IFX_SeekableReadStream* pFile, | 113 bool LoadFile(IFX_SeekableReadStream* pFile, |
| 114 int nFaceIndex = 0, | 114 int nFaceIndex = 0, |
| 115 int* pFaceCount = nullptr); | 115 int* pFaceCount = nullptr); |
| 116 | 116 |
| 117 FX_BOOL LoadClone(const CFX_Font* pFont); | 117 bool LoadClone(const CFX_Font* pFont); |
| 118 void SetFace(FXFT_Face face); | 118 void SetFace(FXFT_Face face); |
| 119 void SetSubstFont(std::unique_ptr<CFX_SubstFont> subst) { | 119 void SetSubstFont(std::unique_ptr<CFX_SubstFont> subst) { |
| 120 m_pSubstFont = std::move(subst); | 120 m_pSubstFont = std::move(subst); |
| 121 } | 121 } |
| 122 #endif // PDF_ENABLE_XFA | 122 #endif // PDF_ENABLE_XFA |
| 123 | 123 |
| 124 const CFX_GlyphBitmap* LoadGlyphBitmap(uint32_t glyph_index, | 124 const CFX_GlyphBitmap* LoadGlyphBitmap(uint32_t glyph_index, |
| 125 FX_BOOL bFontStyle, | 125 bool bFontStyle, |
| 126 const CFX_Matrix* pMatrix, | 126 const CFX_Matrix* pMatrix, |
| 127 int dest_width, | 127 int dest_width, |
| 128 int anti_alias, | 128 int anti_alias, |
| 129 int& text_flags) const; | 129 int& text_flags) const; |
| 130 const CFX_PathData* LoadGlyphPath(uint32_t glyph_index, int dest_width) const; | 130 const CFX_PathData* LoadGlyphPath(uint32_t glyph_index, int dest_width) const; |
| 131 | 131 |
| 132 #ifdef _SKIA_SUPPORT_ | 132 #ifdef _SKIA_SUPPORT_ |
| 133 CFX_TypeFace* GetDeviceCache() const; | 133 CFX_TypeFace* GetDeviceCache() const; |
| 134 #endif | 134 #endif |
| 135 | 135 |
| 136 int GetGlyphWidth(uint32_t glyph_index); | 136 int GetGlyphWidth(uint32_t glyph_index); |
| 137 int GetAscent() const; | 137 int GetAscent() const; |
| 138 int GetDescent() const; | 138 int GetDescent() const; |
| 139 FX_BOOL GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox); | 139 bool GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox); |
| 140 bool IsItalic() const; | 140 bool IsItalic() const; |
| 141 bool IsBold() const; | 141 bool IsBold() const; |
| 142 bool IsFixedWidth() const; | 142 bool IsFixedWidth() const; |
| 143 bool IsVertical() const { return m_bVertical; } | 143 bool IsVertical() const { return m_bVertical; } |
| 144 CFX_ByteString GetPsName() const; | 144 CFX_ByteString GetPsName() const; |
| 145 CFX_ByteString GetFamilyName() const; | 145 CFX_ByteString GetFamilyName() const; |
| 146 CFX_ByteString GetFaceName() const; | 146 CFX_ByteString GetFaceName() const; |
| 147 bool IsTTFont() const; | 147 bool IsTTFont() const; |
| 148 FX_BOOL GetBBox(FX_RECT& bbox); | 148 bool GetBBox(FX_RECT& bbox); |
| 149 int GetHeight() const; | 149 int GetHeight() const; |
| 150 int GetULPos() const; | 150 int GetULPos() const; |
| 151 int GetULthickness() const; | 151 int GetULthickness() const; |
| 152 int GetMaxAdvanceWidth() const; | 152 int GetMaxAdvanceWidth() const; |
| 153 FX_BOOL IsEmbedded() const { return m_bEmbedded; } | 153 bool IsEmbedded() const { return m_bEmbedded; } |
| 154 uint8_t* GetSubData() const { return m_pGsubData; } | 154 uint8_t* GetSubData() const { return m_pGsubData; } |
| 155 void SetSubData(uint8_t* data) { m_pGsubData = data; } | 155 void SetSubData(uint8_t* data) { m_pGsubData = data; } |
| 156 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 156 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| 157 void* GetPlatformFont() const { return m_pPlatformFont; } | 157 void* GetPlatformFont() const { return m_pPlatformFont; } |
| 158 void SetPlatformFont(void* font) { m_pPlatformFont = font; } | 158 void SetPlatformFont(void* font) { m_pPlatformFont = font; } |
| 159 #endif | 159 #endif |
| 160 uint8_t* GetFontData() const { return m_pFontData; } | 160 uint8_t* GetFontData() const { return m_pFontData; } |
| 161 uint32_t GetSize() const { return m_dwSize; } | 161 uint32_t GetSize() const { return m_dwSize; } |
| 162 void AdjustMMParams(int glyph_index, int width, int weight) const; | 162 void AdjustMMParams(int glyph_index, int width, int weight) const; |
| 163 | 163 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 FX_FLOAT retinaScaleX = 1.0f, | 239 FX_FLOAT retinaScaleX = 1.0f, |
| 240 FX_FLOAT retinaScaleY = 1.0f); | 240 FX_FLOAT retinaScaleY = 1.0f); |
| 241 | 241 |
| 242 CFX_ByteString GetNameFromTT(const uint8_t* name_table, | 242 CFX_ByteString GetNameFromTT(const uint8_t* name_table, |
| 243 uint32_t name_table_size, | 243 uint32_t name_table_size, |
| 244 uint32_t name); | 244 uint32_t name); |
| 245 | 245 |
| 246 int PDF_GetStandardFontName(CFX_ByteString* name); | 246 int PDF_GetStandardFontName(CFX_ByteString* name); |
| 247 | 247 |
| 248 #endif // CORE_FXGE_FX_FONT_H_ | 248 #endif // CORE_FXGE_FX_FONT_H_ |
| OLD | NEW |