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

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

Issue 1426403008: Cleanup some fxge font code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | core/src/fxge/ge/fx_ge_fontmap.cpp » ('j') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('J')
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 CFX_Font* m_pFont; 132 CFX_Font* m_pFont;
133 }; 133 };
134 134
135 #define FXFONT_SUBST_MM 0x01 135 #define FXFONT_SUBST_MM 0x01
136 #define FXFONT_SUBST_GLYPHPATH 0x04 136 #define FXFONT_SUBST_GLYPHPATH 0x04
137 #define FXFONT_SUBST_CLEARTYPE 0x08 137 #define FXFONT_SUBST_CLEARTYPE 0x08
138 #define FXFONT_SUBST_TRANSFORM 0x10 138 #define FXFONT_SUBST_TRANSFORM 0x10
139 #define FXFONT_SUBST_NONSYMBOL 0x20 139 #define FXFONT_SUBST_NONSYMBOL 0x20
140 #define FXFONT_SUBST_EXACT 0x40 140 #define FXFONT_SUBST_EXACT 0x40
141 #define FXFONT_SUBST_STANDARD 0x80 141 #define FXFONT_SUBST_STANDARD 0x80
142
142 class CFX_SubstFont { 143 class CFX_SubstFont {
143 public: 144 public:
144 CFX_SubstFont(); 145 CFX_SubstFont();
145 146
146 void* m_ExtHandle; 147 void* m_ExtHandle;
147 148
148 CFX_ByteString m_Family; 149 CFX_ByteString m_Family;
149 150
150 int m_Charset; 151 int m_Charset;
151 152
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 #define FX_FONTCACHE_DEFINE(pFontCache, pFont) \ 379 #define FX_FONTCACHE_DEFINE(pFontCache, pFont) \
379 CFX_AutoFontCache autoFontCache((pFontCache), (pFont)) 380 CFX_AutoFontCache autoFontCache((pFontCache), (pFont))
380 class CFX_GlyphBitmap { 381 class CFX_GlyphBitmap {
381 public: 382 public:
382 int m_Top; 383 int m_Top;
383 int m_Left; 384 int m_Left;
384 CFX_DIBitmap m_Bitmap; 385 CFX_DIBitmap m_Bitmap;
385 }; 386 };
386 class CFX_FaceCache { 387 class CFX_FaceCache {
387 public: 388 public:
389 explicit CFX_FaceCache(FXFT_Face face);
388 ~CFX_FaceCache(); 390 ~CFX_FaceCache();
389 const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, 391 const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont,
390 FX_DWORD glyph_index, 392 FX_DWORD glyph_index,
391 FX_BOOL bFontStyle, 393 FX_BOOL bFontStyle,
392 const CFX_AffineMatrix* pMatrix, 394 const CFX_AffineMatrix* pMatrix,
393 int dest_width, 395 int dest_width,
394 int anti_alias, 396 int anti_alias,
395 int& text_flags); 397 int& text_flags);
396 const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, 398 const CFX_PathData* LoadGlyphPath(CFX_Font* pFont,
397 FX_DWORD glyph_index, 399 FX_DWORD glyph_index,
398 int dest_width); 400 int dest_width);
399 401
400 CFX_FaceCache(FXFT_Face face);
401
402 private: 402 private:
403 FXFT_Face m_Face; 403 FXFT_Face const m_Face;
Tom Sepez 2015/11/09 18:05:17 nit: Someday we'll lose the *s in the typedefs, an
Lei Zhang 2015/11/09 18:41:03 I reordered the methods / variables.
404 CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, 404 CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont,
405 FX_DWORD glyph_index, 405 FX_DWORD glyph_index,
406 FX_BOOL bFontStyle, 406 FX_BOOL bFontStyle,
407 const CFX_AffineMatrix* pMatrix, 407 const CFX_AffineMatrix* pMatrix,
408 int dest_width, 408 int dest_width,
409 int anti_alias); 409 int anti_alias);
410 CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, 410 CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont,
411 FX_DWORD glyph_index, 411 FX_DWORD glyph_index,
412 const CFX_AffineMatrix* pMatrix, 412 const CFX_AffineMatrix* pMatrix,
413 int dest_width, 413 int dest_width,
414 int anti_alias); 414 int anti_alias);
415 CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, 415 CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont,
416 const CFX_AffineMatrix* pMatrix, 416 const CFX_AffineMatrix* pMatrix,
417 CFX_ByteStringC& FaceGlyphsKey, 417 CFX_ByteStringC& FaceGlyphsKey,
418 FX_DWORD glyph_index, 418 FX_DWORD glyph_index,
419 FX_BOOL bFontStyle, 419 FX_BOOL bFontStyle,
420 int dest_width, 420 int dest_width,
421 int anti_alias); 421 int anti_alias);
422 std::map<CFX_ByteString, CFX_SizeGlyphCache*> m_SizeMap; 422 std::map<CFX_ByteString, CFX_SizeGlyphCache*> m_SizeMap;
423 CFX_MapPtrToPtr m_PathMap; 423 CFX_MapPtrToPtr m_PathMap;
424 CFX_DIBitmap* m_pBitmap; 424 CFX_DIBitmap* m_pBitmap;
425 425
426 void InitPlatform(); 426 void InitPlatform();
427 void DestroyPlatform(); 427 void DestroyPlatform();
428 }; 428 };
429 typedef struct { 429
430 struct FXTEXT_GLYPHPOS {
430 const CFX_GlyphBitmap* m_pGlyph; 431 const CFX_GlyphBitmap* m_pGlyph;
431 int m_OriginX, m_OriginY; 432 int m_OriginX, m_OriginY;
Tom Sepez 2015/11/09 18:05:17 nit: one per line (next line too).
Lei Zhang 2015/11/09 18:41:03 Done.
432 FX_FLOAT m_fOriginX, m_fOriginY; 433 FX_FLOAT m_fOriginX, m_fOriginY;
433 } FXTEXT_GLYPHPOS; 434 };
435
434 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, 436 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos,
435 int nChars, 437 int nChars,
436 int anti_alias, 438 int anti_alias,
437 FX_FLOAT retinaScaleX = 1.0f, 439 FX_FLOAT retinaScaleX = 1.0f,
438 FX_FLOAT retinaScaleY = 1.0f); 440 FX_FLOAT retinaScaleY = 1.0f);
439 441
440 class IFX_GSUBTable { 442 class IFX_GSUBTable {
441 public: 443 public:
442 static IFX_GSUBTable* Create(CFX_Font* pFont); 444 static IFX_GSUBTable* Create(CFX_Font* pFont);
443 virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0; 445 virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
444 446
445 protected: 447 protected:
446 virtual ~IFX_GSUBTable() {} 448 virtual ~IFX_GSUBTable() {}
447 }; 449 };
448 450
449 CFX_ByteString GetNameFromTT(const uint8_t* name_table, FX_DWORD name); 451 CFX_ByteString GetNameFromTT(const uint8_t* name_table, FX_DWORD name);
450 452
451 int PDF_GetStandardFontName(CFX_ByteString* name); 453 int PDF_GetStandardFontName(CFX_ByteString* name);
452 454
453 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ 455 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_
OLDNEW
« no previous file with comments | « no previous file | core/src/fxge/ge/fx_ge_fontmap.cpp » ('j') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698