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

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: Address 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
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, bool* pVertGlyph);
92 int FallbackGlyphFromCharcode(int fallbackFont,
93 uint32_t charcode,
94 bool* pVertGlyph);
91 95
92 virtual int GetCharWidthF(uint32_t charcode, int level = 0) = 0; 96 virtual int GetCharWidthF(uint32_t charcode, int level = 0) = 0;
93 virtual FX_RECT GetCharBBox(uint32_t charcode, int level = 0) = 0; 97 virtual FX_RECT GetCharBBox(uint32_t charcode, int level = 0) = 0;
94 98
95 CPDF_Document* m_pDocument; 99 CPDF_Document* m_pDocument;
96 CFX_Font m_Font; 100 CFX_Font m_Font;
101 std::vector<std::unique_ptr<CFX_Font>> m_FontFallbacks;
97 102
98 protected: 103 protected:
99 CPDF_Font(); 104 CPDF_Font();
100 105
101 virtual FX_BOOL Load() = 0; 106 virtual FX_BOOL Load() = 0;
102 107
103 FX_BOOL Initialize(); 108 FX_BOOL Initialize();
104 void LoadUnicodeMap() const; // logically const only. 109 void LoadUnicodeMap() const; // logically const only.
105 void LoadPDFEncoding(CPDF_Object* pEncoding, 110 void LoadPDFEncoding(CPDF_Object* pEncoding,
106 int& iBaseEncoding, 111 int& iBaseEncoding,
(...skipping 14 matching lines...) Expand all
121 mutable FX_BOOL m_bToUnicodeLoaded; 126 mutable FX_BOOL m_bToUnicodeLoaded;
122 int m_Flags; 127 int m_Flags;
123 FX_RECT m_FontBBox; 128 FX_RECT m_FontBBox;
124 int m_StemV; 129 int m_StemV;
125 int m_Ascent; 130 int m_Ascent;
126 int m_Descent; 131 int m_Descent;
127 int m_ItalicAngle; 132 int m_ItalicAngle;
128 }; 133 };
129 134
130 #endif // CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_ 135 #endif // CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698