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

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

Issue 1258093002: FX Bool considered harmful, part 3 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 4 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/include/fxge/fx_dib.h ('k') | core/include/fxge/fx_ge.h » ('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_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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #define FXFONT_FF_ROMAN (1<<4) 49 #define FXFONT_FF_ROMAN (1<<4)
50 #define FXFONT_FF_SCRIPT (4<<4) 50 #define FXFONT_FF_SCRIPT (4<<4)
51 #define FXFONT_FW_NORMAL 400 51 #define FXFONT_FW_NORMAL 400
52 #define FXFONT_FW_BOLD 700 52 #define FXFONT_FW_BOLD 700
53 class CFX_Font 53 class CFX_Font
54 { 54 {
55 public: 55 public:
56 CFX_Font(); 56 CFX_Font();
57 ~CFX_Font(); 57 ~CFX_Font();
58 58
59 FX_BOOL» » » » » LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags, 59 bool» » » » » LoadSubst(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags,
60 int weight, int italic_angle, int CharsetC P, FX_BOOL bVertical = FALSE); 60 int weight, int italic_angle, int CharsetC P, bool bVertical = false);
61 61
62 FX_BOOL» » » » » LoadEmbedded(const uint8_t* data , FX_DWORD size); 62 bool» » » » » LoadEmbedded(const uint8_t* data , FX_DWORD size);
63 63
64 FX_BOOL» » » » » LoadFile(IFX_FileRead* pFile); 64 bool» » » » » LoadFile(IFX_FileRead* pFile);
65 65
66 FXFT_Face GetFace() const 66 FXFT_Face GetFace() const
67 { 67 {
68 return m_Face; 68 return m_Face;
69 } 69 }
70 70
71 71
72 const CFX_SubstFont* GetSubstFont() const 72 const CFX_SubstFont* GetSubstFont() const
73 { 73 {
74 return m_pSubstFont; 74 return m_pSubstFont;
75 } 75 }
76 76
77 CFX_PathData* LoadGlyphPath(FX_DWORD glyph_index, int dest_width = 0); 77 CFX_PathData* LoadGlyphPath(FX_DWORD glyph_index, int dest_width = 0);
78 78
79 int GetGlyphWidth(FX_DWORD glyph_ind ex); 79 int GetGlyphWidth(FX_DWORD glyph_ind ex);
80 80
81 int GetAscent() const; 81 int GetAscent() const;
82 82
83 int GetDescent() const; 83 int GetDescent() const;
84 84
85 FX_BOOL GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox); 85 bool GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox);
86 86
87 FX_BOOL IsItalic(); 87 bool IsItalic();
88 88
89 FX_BOOL IsBold(); 89 bool IsBold();
90 90
91 FX_BOOL IsFixedWidth(); 91 bool IsFixedWidth();
92 92
93 FX_BOOL» » » » » IsVertical() const 93 bool» » » » » IsVertical() const
94 { 94 {
95 return m_bVertical; 95 return m_bVertical;
96 } 96 }
97 97
98 CFX_WideString GetPsName() const; 98 CFX_WideString GetPsName() const;
99 99
100 100
101 CFX_ByteString GetFamilyName() const; 101 CFX_ByteString GetFamilyName() const;
102 102
103 CFX_ByteString GetFaceName() const; 103 CFX_ByteString GetFaceName() const;
104 104
105 105
106 FX_BOOL IsTTFont(); 106 bool IsTTFont();
107 107
108 FX_BOOL GetBBox(FX_RECT &bbox); 108 bool GetBBox(FX_RECT &bbox);
109 109
110 int GetHeight(); 110 int GetHeight();
111 111
112 int GetULPos(); 112 int GetULPos();
113 113
114 int GetULthickness(); 114 int GetULthickness();
115 115
116 int GetMaxAdvanceWidth(); 116 int GetMaxAdvanceWidth();
117 117
118 FXFT_Face m_Face; 118 FXFT_Face m_Face;
119 119
120 CFX_SubstFont* m_pSubstFont; 120 CFX_SubstFont* m_pSubstFont;
121 FX_BOOL» » » » » IsEmbedded() 121 bool» » » » » IsEmbedded()
122 { 122 {
123 return m_bEmbedded; 123 return m_bEmbedded;
124 } 124 }
125 125
126 void AdjustMMParams(int glyph_index, int width, int weight); 126 void AdjustMMParams(int glyph_index, int width, int weight);
127 uint8_t* m_pFontDataAllocation; 127 uint8_t* m_pFontDataAllocation;
128 uint8_t* m_pFontData; 128 uint8_t* m_pFontData;
129 uint8_t* m_pGsubData; 129 uint8_t* m_pGsubData;
130 FX_DWORD m_dwSize; 130 FX_DWORD m_dwSize;
131 CFX_BinaryBuf m_OtfFontData; 131 CFX_BinaryBuf m_OtfFontData;
132 void* m_hHandle; 132 void* m_hHandle;
133 void* m_pPlatformFont; 133 void* m_pPlatformFont;
134 void* m_pPlatformFontCollection; 134 void* m_pPlatformFontCollection;
135 void* m_pDwFont; 135 void* m_pDwFont;
136 FX_BOOL m_bDwLoaded; 136 bool m_bDwLoaded;
137 void ReleasePlatformResource(); 137 void ReleasePlatformResource();
138 138
139 void DeleteFace(); 139 void DeleteFace();
140 protected: 140 protected:
141 141
142 FX_BOOL» » » » » m_bEmbedded; 142 bool» » » » » m_bEmbedded;
143 FX_BOOL» » » » » m_bVertical; 143 bool» » » » » m_bVertical;
144 void* m_pOwnedStream; 144 void* m_pOwnedStream;
145 }; 145 };
146 #define ENCODING_INTERNAL 0 146 #define ENCODING_INTERNAL 0
147 #define ENCODING_UNICODE 1 147 #define ENCODING_UNICODE 1
148 class IFX_FontEncoding 148 class IFX_FontEncoding
149 { 149 {
150 public: 150 public:
151 virtual ~IFX_FontEncoding() {} 151 virtual ~IFX_FontEncoding() {}
152 152
153 virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode) = 0; 153 virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode) = 0;
(...skipping 21 matching lines...) Expand all
175 CFX_ByteString m_Family; 175 CFX_ByteString m_Family;
176 176
177 int m_Charset; 177 int m_Charset;
178 178
179 FX_DWORD m_SubstFlags; 179 FX_DWORD m_SubstFlags;
180 180
181 int m_Weight; 181 int m_Weight;
182 182
183 int m_ItalicAngle; 183 int m_ItalicAngle;
184 184
185 FX_BOOL» » » » » m_bSubstOfCJK; 185 bool» » » » » m_bSubstOfCJK;
186 186
187 int m_WeightCJK; 187 int m_WeightCJK;
188 188
189 FX_BOOL» » » » » m_bItlicCJK; 189 bool» » » » » m_bItlicCJK;
190 }; 190 };
191 #define FX_FONT_FLAG_SERIF 0x01 191 #define FX_FONT_FLAG_SERIF 0x01
192 #define FX_FONT_FLAG_FIXEDPITCH 0x02 192 #define FX_FONT_FLAG_FIXEDPITCH 0x02
193 #define FX_FONT_FLAG_ITALIC 0x04 193 #define FX_FONT_FLAG_ITALIC 0x04
194 #define FX_FONT_FLAG_BOLD 0x08 194 #define FX_FONT_FLAG_BOLD 0x08
195 #define FX_FONT_FLAG_SYMBOLIC_SYMBOL 0x10 195 #define FX_FONT_FLAG_SYMBOLIC_SYMBOL 0x10
196 #define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20 196 #define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20
197 #define FX_FONT_FLAG_MULTIPLEMASTER 0x40 197 #define FX_FONT_FLAG_MULTIPLEMASTER 0x40
198 typedef struct { 198 typedef struct {
199 const uint8_t* m_pFontData; 199 const uint8_t* m_pFontData;
200 FX_DWORD m_dwSize; 200 FX_DWORD m_dwSize;
201 } FoxitFonts; 201 } FoxitFonts;
202 class CFX_FontMgr 202 class CFX_FontMgr
203 { 203 {
204 public: 204 public:
205 CFX_FontMgr(); 205 CFX_FontMgr();
206 ~CFX_FontMgr(); 206 ~CFX_FontMgr();
207 void InitFTLibrary(); 207 void InitFTLibrary();
208 FXFT_Face GetCachedFace(const CFX_ByteString& face_name, 208 FXFT_Face GetCachedFace(const CFX_ByteString& face_name,
209 int weight, FX_BOOL bItalic, uint8_t*& pFontDa ta); 209 int weight, bool bItalic, uint8_t*& pFontData) ;
210 FXFT_Face AddCachedFace(const CFX_ByteString& face_name, 210 FXFT_Face AddCachedFace(const CFX_ByteString& face_name,
211 int weight, FX_BOOL bItalic, uint8_t* pData, F X_DWORD size, int face_index); 211 int weight, bool bItalic, uint8_t* pData, FX_D WORD size, int face_index);
212 FXFT_Face GetCachedTTCFace(int ttc_size, FX_DWORD checksum, 212 FXFT_Face GetCachedTTCFace(int ttc_size, FX_DWORD checksum,
213 int font_offset, uint8_t*& pFontData); 213 int font_offset, uint8_t*& pFontData);
214 FXFT_Face AddCachedTTCFace(int ttc_size, FX_DWORD checksum, 214 FXFT_Face AddCachedTTCFace(int ttc_size, FX_DWORD checksum,
215 uint8_t* pData, FX_DWORD size, int font_off set); 215 uint8_t* pData, FX_DWORD size, int font_off set);
216 FXFT_Face GetFileFace(const FX_CHAR* filename, int face_index); 216 FXFT_Face GetFileFace(const FX_CHAR* filename, int face_index);
217 FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int fa ce_index); 217 FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int fa ce_index);
218 void ReleaseFace(FXFT_Face face); 218 void ReleaseFace(FXFT_Face face);
219 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) ; 219 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) ;
220 FXFT_Face» » FindSubstFont(const CFX_ByteString& face_name, FX_BOOL b TrueType, FX_DWORD flags, 220 FXFT_Face» » FindSubstFont(const CFX_ByteString& face_name, bool bTru eType, FX_DWORD flags,
221 int weight, int italic_angle, int CharsetCP, C FX_SubstFont* pSubstFont); 221 int weight, int italic_angle, int CharsetCP, C FX_SubstFont* pSubstFont);
222 222
223 void FreeCache(); 223 void FreeCache();
224 224
225 FX_BOOL» » » GetStandardFont(const uint8_t*& pFontData, FX_DW ORD& size, int index); 225 bool» » » GetStandardFont(const uint8_t*& pFontData, FX_DW ORD& size, int index);
226 CFX_FontMapper* m_pBuiltinMapper; 226 CFX_FontMapper* m_pBuiltinMapper;
227 IFX_FontMapper* m_pExtMapper; 227 IFX_FontMapper* m_pExtMapper;
228 CFX_MapByteStringToPtr m_FaceMap; 228 CFX_MapByteStringToPtr m_FaceMap;
229 FXFT_Library m_FTLibrary; 229 FXFT_Library m_FTLibrary;
230 FoxitFonts m_ExternalFonts[16]; 230 FoxitFonts m_ExternalFonts[16];
231 }; 231 };
232 class IFX_FontMapper 232 class IFX_FontMapper
233 { 233 {
234 public: 234 public:
235 235
236 virtual ~IFX_FontMapper() {} 236 virtual ~IFX_FontMapper() {}
237 237
238 virtual FXFT_Face» FindSubstFont(const CFX_ByteString& face_name, FX_BOOL b TrueType, FX_DWORD flags, 238 virtual FXFT_Face» FindSubstFont(const CFX_ByteString& face_name, bool bTru eType, FX_DWORD flags,
239 int weight, int italic_angle, int CharsetC P, CFX_SubstFont* pSubstFont) = 0; 239 int weight, int italic_angle, int CharsetC P, CFX_SubstFont* pSubstFont) = 0;
240 240
241 CFX_FontMgr* m_pFontMgr; 241 CFX_FontMgr* m_pFontMgr;
242 }; 242 };
243 class IFX_FontEnumerator 243 class IFX_FontEnumerator
244 { 244 {
245 public: 245 public:
246 virtual ~IFX_FontEnumerator() { } 246 virtual ~IFX_FontEnumerator() { }
247 247
248 virtual void HitFont() = 0; 248 virtual void HitFont() = 0;
(...skipping 21 matching lines...) Expand all
270 void LoadInstalledFonts(); 270 void LoadInstalledFonts();
271 CFX_ByteStringArray m_InstalledTTFonts; 271 CFX_ByteStringArray m_InstalledTTFonts;
272 void SetFontEnumerator(IFX_FontEnumerator* pF ontEnumerator) 272 void SetFontEnumerator(IFX_FontEnumerator* pF ontEnumerator)
273 { 273 {
274 m_pFontEnumerator = pFontEnumerator; 274 m_pFontEnumerator = pFontEnumerator;
275 } 275 }
276 IFX_FontEnumerator* GetFontEnumerator() const 276 IFX_FontEnumerator* GetFontEnumerator() const
277 { 277 {
278 return m_pFontEnumerator; 278 return m_pFontEnumerator;
279 } 279 }
280 virtual FXFT_Face» FindSubstFont(const CFX_ByteString& face_name, FX_BOOL b TrueType, FX_DWORD flags, 280 virtual FXFT_Face» FindSubstFont(const CFX_ByteString& face_name, bool bTru eType, FX_DWORD flags,
281 int weight, int italic_angle, int CharsetC P, CFX_SubstFont* pSubstFont); 281 int weight, int italic_angle, int CharsetC P, CFX_SubstFont* pSubstFont);
282 private: 282 private:
283 CFX_ByteString GetPSNameFromTT(void* hFont); 283 CFX_ByteString GetPSNameFromTT(void* hFont);
284 CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_n ame); 284 CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_n ame);
285 FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily); 285 FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily);
286 286
287 FX_BOOL» » » » m_bListLoaded; 287 bool» » » » m_bListLoaded;
288 FXFT_Face m_MMFaces[2]; 288 FXFT_Face m_MMFaces[2];
289 CFX_ByteString m_LastFamily; 289 CFX_ByteString m_LastFamily;
290 CFX_DWordArray m_CharsetArray; 290 CFX_DWordArray m_CharsetArray;
291 CFX_ByteStringArray m_FaceArray; 291 CFX_ByteStringArray m_FaceArray;
292 IFX_SystemFontInfo* m_pFontInfo; 292 IFX_SystemFontInfo* m_pFontInfo;
293 FXFT_Face m_FoxitFaces[14]; 293 FXFT_Face m_FoxitFaces[14];
294 IFX_FontEnumerator* m_pFontEnumerator; 294 IFX_FontEnumerator* m_pFontEnumerator;
295 }; 295 };
296 class IFX_SystemFontInfo 296 class IFX_SystemFontInfo
297 { 297 {
298 public: 298 public:
299 static IFX_SystemFontInfo* CreateDefault(); 299 static IFX_SystemFontInfo* CreateDefault();
300 virtual void Release() = 0; 300 virtual void Release() = 0;
301 301
302 virtual» FX_BOOL»» EnumFontList(CFX_FontMapper* pMapper) = 0; 302 virtual» bool» » EnumFontList(CFX_FontMapper* pMapper) = 0;
303 virtual void*» » MapFont(int weight, FX_BOOL bItalic, int charset , int pitch_family, const FX_CHAR* face, int& iExact) = 0; 303 virtual void*» » MapFont(int weight, bool bItalic, int charset, i nt pitch_family, const FX_CHAR* face, int& iExact) = 0;
304 virtual void* GetFont(const FX_CHAR* face) = 0; 304 virtual void* GetFont(const FX_CHAR* face) = 0;
305 virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer , FX_DWORD size) = 0; 305 virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer , FX_DWORD size) = 0;
306 virtual FX_BOOL» » GetFaceName(void* hFont, CFX_ByteString& name) = 0; 306 virtual bool» » GetFaceName(void* hFont, CFX_ByteString& name) = 0;
307 virtual FX_BOOL» » GetFontCharset(void* hFont, int& charset) = 0; 307 virtual bool» » GetFontCharset(void* hFont, int& charset) = 0;
308 virtual int GetFaceIndex(void* hFont) 308 virtual int GetFaceIndex(void* hFont)
309 { 309 {
310 return 0; 310 return 0;
311 } 311 }
312 virtual void DeleteFont(void* hFont) = 0; 312 virtual void DeleteFont(void* hFont) = 0;
313 virtual void* RetainFont(void* hFont) 313 virtual void* RetainFont(void* hFont)
314 { 314 {
315 return NULL; 315 return NULL;
316 } 316 }
317 protected: 317 protected:
318 ~IFX_SystemFontInfo() { } 318 ~IFX_SystemFontInfo() { }
319 }; 319 };
320 class CFX_FolderFontInfo : public IFX_SystemFontInfo 320 class CFX_FolderFontInfo : public IFX_SystemFontInfo
321 { 321 {
322 public: 322 public:
323 CFX_FolderFontInfo(); 323 CFX_FolderFontInfo();
324 virtual ~CFX_FolderFontInfo(); 324 virtual ~CFX_FolderFontInfo();
325 void AddPath(const CFX_ByteStringC& path); 325 void AddPath(const CFX_ByteStringC& path);
326 326
327 // IFX_SytemFontInfo: 327 // IFX_SytemFontInfo:
328 void Release() override; 328 void Release() override;
329 FX_BOOL EnumFontList(CFX_FontMapper* pMapper) override; 329 bool EnumFontList(CFX_FontMapper* pMapper) override;
330 void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, 330 void* MapFont(int weight, bool bItalic, int charset, int pitch_family,
331 const FX_CHAR* face, int& bExact) override; 331 const FX_CHAR* face, int& bExact) override;
332 void* GetFont(const FX_CHAR* face) override; 332 void* GetFont(const FX_CHAR* face) override;
333 FX_DWORD GetFontData(void* hFont, FX_DWORD table, 333 FX_DWORD GetFontData(void* hFont, FX_DWORD table,
334 uint8_t* buffer, FX_DWORD size) override; 334 uint8_t* buffer, FX_DWORD size) override;
335 void DeleteFont(void* hFont) override; 335 void DeleteFont(void* hFont) override;
336 FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override; 336 bool GetFaceName(void* hFont, CFX_ByteString& name) override;
337 FX_BOOL GetFontCharset(void* hFont, int& charset) override; 337 bool GetFontCharset(void* hFont, int& charset) override;
338 338
339 protected: 339 protected:
340 CFX_MapByteStringToPtr m_FontList; 340 CFX_MapByteStringToPtr m_FontList;
341 CFX_ByteStringArray m_PathList; 341 CFX_ByteStringArray m_PathList;
342 CFX_FontMapper* m_pMapper; 342 CFX_FontMapper* m_pMapper;
343 void ScanPath(CFX_ByteString& path); 343 void ScanPath(CFX_ByteString& path);
344 void ScanFile(CFX_ByteString& path); 344 void ScanFile(CFX_ByteString& path);
345 void ReportFace(CFX_ByteString& path, FXSYS_F ILE* pFile, FX_DWORD filesize, FX_DWORD offset); 345 void ReportFace(CFX_ByteString& path, FXSYS_F ILE* pFile, FX_DWORD filesize, FX_DWORD offset);
346 }; 346 };
347 class CFX_CountedFaceCache 347 class CFX_CountedFaceCache
348 { 348 {
349 public: 349 public:
350 CFX_FaceCache* m_Obj; 350 CFX_FaceCache* m_Obj;
351 FX_DWORD m_nCount; 351 FX_DWORD m_nCount;
352 }; 352 };
353 353
354 class CFX_FontCache 354 class CFX_FontCache
355 { 355 {
356 public: 356 public:
357 ~CFX_FontCache(); 357 ~CFX_FontCache();
358 CFX_FaceCache* GetCachedFace(CFX_Font* pFont); 358 CFX_FaceCache* GetCachedFace(CFX_Font* pFont);
359 void ReleaseCachedFace(CFX_Font* pFon t); 359 void ReleaseCachedFace(CFX_Font* pFon t);
360 void» » » » » FreeCache(FX_BOOL bRelease = FAL SE); 360 void» » » » » FreeCache(bool bRelease = false) ;
361 361
362 private: 362 private:
363 using CFX_FTCacheMap = std::map<FXFT_Face, CFX_CountedFaceCache*>; 363 using CFX_FTCacheMap = std::map<FXFT_Face, CFX_CountedFaceCache*>;
364 CFX_FTCacheMap m_FTFaceMap; 364 CFX_FTCacheMap m_FTFaceMap;
365 CFX_FTCacheMap m_ExtFaceMap; 365 CFX_FTCacheMap m_ExtFaceMap;
366 }; 366 };
367 class CFX_AutoFontCache 367 class CFX_AutoFontCache
368 { 368 {
369 public: 369 public:
370 CFX_AutoFontCache(CFX_FontCache* pFontCache, CFX_Font* pFont) 370 CFX_AutoFontCache(CFX_FontCache* pFontCache, CFX_Font* pFont)
(...skipping 13 matching lines...) Expand all
384 { 384 {
385 public: 385 public:
386 int m_Top; 386 int m_Top;
387 int m_Left; 387 int m_Left;
388 CFX_DIBitmap m_Bitmap; 388 CFX_DIBitmap m_Bitmap;
389 }; 389 };
390 class CFX_FaceCache 390 class CFX_FaceCache
391 { 391 {
392 public: 392 public:
393 ~CFX_FaceCache(); 393 ~CFX_FaceCache();
394 const CFX_GlyphBitmap*» LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_ index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix, 394 const CFX_GlyphBitmap*» LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_ index, bool bFontStyle, const CFX_AffineMatrix* pMatrix,
395 int dest_width, int anti_alias, int& text_flags); 395 int dest_width, int anti_alias, int& text_flags);
396 const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_in dex, int dest_width); 396 const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_in dex, int dest_width);
397 397
398 398
399 CFX_FaceCache(FXFT_Face face); 399 CFX_FaceCache(FXFT_Face face);
400 private: 400 private:
401 FXFT_Face m_Face; 401 FXFT_Face m_Face;
402 CFX_GlyphBitmap*» » RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde x, FX_BOOL bFontStyle, 402 CFX_GlyphBitmap*» » RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde x, bool bFontStyle,
403 const CFX_AffineMatrix* pMatrix, int des t_width, int anti_alias); 403 const CFX_AffineMatrix* pMatrix, int des t_width, int anti_alias);
404 CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index, 404 CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index,
405 const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias); 405 const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias);
406 CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineM atrix* pMatrix, CFX_ByteStringC& FaceGlyphsKey, 406 CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineM atrix* pMatrix, CFX_ByteStringC& FaceGlyphsKey,
407 FX_DWORD glyph_index, FX_BOOL bFontStyle, int dest_width, int anti_a lias); 407 FX_DWORD glyph_index, bool bFontStyle, int dest_width, int anti_alia s);
408 CFX_MapByteStringToPtr m_SizeMap; 408 CFX_MapByteStringToPtr m_SizeMap;
409 CFX_MapPtrToPtr m_PathMap; 409 CFX_MapPtrToPtr m_PathMap;
410 CFX_DIBitmap* m_pBitmap; 410 CFX_DIBitmap* m_pBitmap;
411 411
412 void InitPlatform(); 412 void InitPlatform();
413 void DestroyPlatform(); 413 void DestroyPlatform();
414 }; 414 };
415 typedef struct { 415 typedef struct {
416 const CFX_GlyphBitmap* m_pGlyph; 416 const CFX_GlyphBitmap* m_pGlyph;
417 int m_OriginX, m_OriginY; 417 int m_OriginX, m_OriginY;
418 FX_FLOAT m_fOriginX, m_fOriginY; 418 FX_FLOAT m_fOriginX, m_fOriginY;
419 } FXTEXT_GLYPHPOS; 419 } FXTEXT_GLYPHPOS;
420 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_a lias, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f); 420 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_a lias, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f);
421 FX_BOOL»OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size, 421 bool» OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
422 CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsign ed long argb); 422 CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsign ed long argb);
423 FX_BOOL»OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size, 423 bool» OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
424 CFX_AffineMatrix* pText_matrix, unsigned short const* text, u nsigned long argb); 424 CFX_AffineMatrix* pText_matrix, unsigned short const* text, u nsigned long argb);
425 class IFX_GSUBTable 425 class IFX_GSUBTable
426 { 426 {
427 public: 427 public:
428 static IFX_GSUBTable* Create(CFX_Font* pFont); 428 static IFX_GSUBTable* Create(CFX_Font* pFont);
429 virtual ~IFX_GSUBTable() { } 429 virtual ~IFX_GSUBTable() { }
430 virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0 ; 430 virtual bool GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
431 }; 431 };
432 432
433 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ 433 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_
OLDNEW
« no previous file with comments | « core/include/fxge/fx_dib.h ('k') | core/include/fxge/fx_ge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698