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

Side by Side Diff: core/fxge/include/fx_font.h

Issue 2292503002: Refactor fx_font part 4 (Closed)
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/fxge/include/cfx_substfont.h ('k') | fpdfsdk/formfiller/cba_fontmap.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 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_INCLUDE_FX_FONT_H_ 7 #ifndef CORE_FXGE_INCLUDE_FX_FONT_H_
8 #define CORE_FXGE_INCLUDE_FX_FONT_H_ 8 #define CORE_FXGE_INCLUDE_FX_FONT_H_
9 9
10 #include <map>
11 #include <memory> 10 #include <memory>
12 #include <vector> 11 #include <vector>
13 12
14 #include "core/fxcrt/include/fx_system.h" 13 #include "core/fxcrt/include/fx_system.h"
14 #include "core/fxge/include/cfx_substfont.h"
15 #include "core/fxge/include/fx_dib.h" 15 #include "core/fxge/include/fx_dib.h"
16 #include "core/fxge/include/fx_freetype.h" 16 #include "core/fxge/include/fx_freetype.h"
17 17
18 typedef struct FT_FaceRec_* FXFT_Face; 18 typedef struct FT_FaceRec_* FXFT_Face;
19 typedef void* FXFT_Library; 19 typedef void* FXFT_Library;
20 20
21 class CFX_FaceCache; 21 class CFX_FaceCache;
22 class CFX_FontCache; 22 class CFX_FontCache;
23 class CFX_PathData; 23 class CFX_PathData;
24 class CFX_SizeGlyphCache; 24 class CFX_SizeGlyphCache;
25 class CFX_SubstFont;
26 class CTTFontDesc;
27 25
28 #ifdef _SKIA_SUPPORT_ 26 #ifdef _SKIA_SUPPORT_
29 class SkTypeface; 27 class SkTypeface;
30 28
31 using CFX_TypeFace = SkTypeface; 29 using CFX_TypeFace = SkTypeface;
32 #endif 30 #endif
33 31
34 #define FXFONT_FIXED_PITCH 0x01 32 #define FXFONT_FIXED_PITCH 0x01
35 #define FXFONT_SERIF 0x02 33 #define FXFONT_SERIF 0x02
36 #define FXFONT_SYMBOLIC 0x04 34 #define FXFONT_SYMBOLIC 0x04
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 uint8_t* m_pFontData; 165 uint8_t* m_pFontData;
168 uint8_t* m_pGsubData; 166 uint8_t* m_pGsubData;
169 uint32_t m_dwSize; 167 uint32_t m_dwSize;
170 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 168 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
171 void* m_pPlatformFont; 169 void* m_pPlatformFont;
172 #endif 170 #endif
173 FX_BOOL m_bEmbedded; 171 FX_BOOL m_bEmbedded;
174 FX_BOOL m_bVertical; 172 FX_BOOL m_bVertical;
175 }; 173 };
176 174
177 #define FXFONT_SUBST_MM 0x01
178 #define FXFONT_SUBST_GLYPHPATH 0x04
179 #define FXFONT_SUBST_CLEARTYPE 0x08
180 #define FXFONT_SUBST_TRANSFORM 0x10
181 #define FXFONT_SUBST_NONSYMBOL 0x20
182 #define FXFONT_SUBST_EXACT 0x40
183 #define FXFONT_SUBST_STANDARD 0x80
184
185 class CFX_SubstFont {
186 public:
187 CFX_SubstFont();
188
189 CFX_ByteString m_Family;
190 int m_Charset;
191 uint32_t m_SubstFlags;
192 int m_Weight;
193 int m_ItalicAngle;
194 bool m_bSubstCJK;
195 int m_WeightCJK;
196 bool m_bItalicCJK;
197 };
198
199 #define FX_FONT_FLAG_SERIF 0x01
200 #define FX_FONT_FLAG_FIXEDPITCH 0x02
201 #define FX_FONT_FLAG_ITALIC 0x04
202 #define FX_FONT_FLAG_BOLD 0x08
203 #define FX_FONT_FLAG_SYMBOLIC_SYMBOL 0x10
204 #define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20
205 #define FX_FONT_FLAG_MULTIPLEMASTER 0x40
206
207 class CTTFontDesc {
208 public:
209 CTTFontDesc() {
210 m_Type = 0;
211 m_pFontData = nullptr;
212 m_RefCount = 0;
213 }
214 ~CTTFontDesc();
215 // ret < 0, releaseface not appropriate for this object.
216 // ret == 0, object released
217 // ret > 0, object still alive, other referrers.
218 int ReleaseFace(FXFT_Face face);
219 int m_Type;
220 union {
221 struct {
222 FX_BOOL m_bItalic;
223 FX_BOOL m_bBold;
224 FXFT_Face m_pFace;
225 } m_SingleFace;
226 struct {
227 FXFT_Face m_pFaces[16];
228 } m_TTCFace;
229 };
230 uint8_t* m_pFontData;
231 int m_RefCount;
232 };
233
234 class CFX_FontFaceInfo { 175 class CFX_FontFaceInfo {
235 public: 176 public:
236 CFX_FontFaceInfo(CFX_ByteString filePath, 177 CFX_FontFaceInfo(CFX_ByteString filePath,
237 CFX_ByteString faceName, 178 CFX_ByteString faceName,
238 CFX_ByteString fontTables, 179 CFX_ByteString fontTables,
239 uint32_t fontOffset, 180 uint32_t fontOffset,
240 uint32_t fileSize); 181 uint32_t fileSize);
241 182
242 const CFX_ByteString m_FilePath; 183 const CFX_ByteString m_FilePath;
243 const CFX_ByteString m_FaceName; 184 const CFX_ByteString m_FaceName;
(...skipping 30 matching lines...) Expand all
274 FX_FLOAT retinaScaleX = 1.0f, 215 FX_FLOAT retinaScaleX = 1.0f,
275 FX_FLOAT retinaScaleY = 1.0f); 216 FX_FLOAT retinaScaleY = 1.0f);
276 217
277 CFX_ByteString GetNameFromTT(const uint8_t* name_table, 218 CFX_ByteString GetNameFromTT(const uint8_t* name_table,
278 uint32_t name_table_size, 219 uint32_t name_table_size,
279 uint32_t name); 220 uint32_t name);
280 221
281 int PDF_GetStandardFontName(CFX_ByteString* name); 222 int PDF_GetStandardFontName(CFX_ByteString* name);
282 223
283 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ 224 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_
OLDNEW
« no previous file with comments | « core/fxge/include/cfx_substfont.h ('k') | fpdfsdk/formfiller/cba_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698