Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Side by Side Diff: core/fpdfapi/fpdf_font/include/cpdf_font.h

Issue 2276653002: Add fallback fonts in pdfium (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_font.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_text.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_ 7 #ifndef CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_
8 #define CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_ 8 #define CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 FX_BOOL IsStandardFont() const; 81 FX_BOOL IsStandardFont() const;
82 FXFT_Face GetFace() const { return m_Font.GetFace(); } 82 FXFT_Face GetFace() const { return m_Font.GetFace(); }
83 void AppendChar(CFX_ByteString& str, uint32_t charcode) const; 83 void AppendChar(CFX_ByteString& str, uint32_t charcode) const;
84 84
85 void GetFontBBox(FX_RECT& rect) const { rect = m_FontBBox; } 85 void GetFontBBox(FX_RECT& rect) const { rect = m_FontBBox; }
86 int GetTypeAscent() const { return m_Ascent; } 86 int GetTypeAscent() const { return m_Ascent; }
87 int GetTypeDescent() const { return m_Descent; } 87 int GetTypeDescent() const { return m_Descent; }
88 int GetItalicAngle() const { return m_ItalicAngle; } 88 int GetItalicAngle() const { return m_ItalicAngle; }
89 int GetStemV() const { return m_StemV; } 89 int GetStemV() const { return m_StemV; }
90 int GetStringWidth(const FX_CHAR* pString, int size); 90 int GetStringWidth(const FX_CHAR* pString, int size);
91 uint32_t FallbackFontFromCharcode(uint32_t charcode);
92 int FallbackGlyphFromCharcode(int fallbackFont, uint32_t charcode);
91 93
92 virtual int GetCharWidthF(uint32_t charcode, int level = 0) = 0; 94 virtual int GetCharWidthF(uint32_t charcode, int level = 0) = 0;
93 virtual FX_RECT GetCharBBox(uint32_t charcode, int level = 0) = 0; 95 virtual FX_RECT GetCharBBox(uint32_t charcode, int level = 0) = 0;
94 96
95 CPDF_Document* m_pDocument; 97 CPDF_Document* m_pDocument;
96 CFX_Font m_Font; 98 CFX_Font m_Font;
99 std::vector<std::unique_ptr<CFX_Font>> m_FontFallbacks;
97 100
98 protected: 101 protected:
99 CPDF_Font(); 102 CPDF_Font();
100 103
101 virtual FX_BOOL Load() = 0; 104 virtual FX_BOOL Load() = 0;
102 105
103 FX_BOOL Initialize(); 106 FX_BOOL Initialize();
104 void LoadUnicodeMap() const; // logically const only. 107 void LoadUnicodeMap() const; // logically const only.
105 void LoadPDFEncoding(CPDF_Object* pEncoding, 108 void LoadPDFEncoding(CPDF_Object* pEncoding,
106 int& iBaseEncoding, 109 int& iBaseEncoding,
(...skipping 14 matching lines...) Expand all
121 mutable FX_BOOL m_bToUnicodeLoaded; 124 mutable FX_BOOL m_bToUnicodeLoaded;
122 int m_Flags; 125 int m_Flags;
123 FX_RECT m_FontBBox; 126 FX_RECT m_FontBBox;
124 int m_StemV; 127 int m_StemV;
125 int m_Ascent; 128 int m_Ascent;
126 int m_Descent; 129 int m_Descent;
127 int m_ItalicAngle; 130 int m_ItalicAngle;
128 }; 131 };
129 132
130 #endif // CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_ 133 #endif // CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_font.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698