summaryrefslogtreecommitdiff
path: root/core/include/fxge/fx_font.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-18 15:39:59 -0700
committerLei Zhang <thestig@chromium.org>2015-08-18 15:39:59 -0700
commite1ce94e0b045b443976c118a251400b4016f9811 (patch)
tree3df3a4e1b8ea6870d5dfbbac3c14269b988ee0a4 /core/include/fxge/fx_font.h
parentbcfcc4619017b7f70c84a582196763894cc72d24 (diff)
downloadpdfium-e1ce94e0b045b443976c118a251400b4016f9811.tar.xz
Cleanup CFX_Font a bit.
- Make methods const. - Make variables non-public. - Remove LoadFile() method. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1293973002 .
Diffstat (limited to 'core/include/fxge/fx_font.h')
-rw-r--r--core/include/fxge/fx_font.h57
1 files changed, 17 insertions, 40 deletions
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 4111acee39..04918ea275 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -54,6 +54,7 @@ class IFX_SystemFontInfo;
#define FXFONT_FF_SCRIPT (4 << 4)
#define FXFONT_FW_NORMAL 400
#define FXFONT_FW_BOLD 700
+
class CFX_Font {
public:
CFX_Font();
@@ -66,57 +67,38 @@ class CFX_Font {
int italic_angle,
int CharsetCP,
FX_BOOL bVertical = FALSE);
-
FX_BOOL LoadEmbedded(const uint8_t* data, FX_DWORD size);
-
- FX_BOOL LoadFile(IFX_FileRead* pFile);
-
FXFT_Face GetFace() const { return m_Face; }
-
const CFX_SubstFont* GetSubstFont() const { return m_pSubstFont; }
-
CFX_PathData* LoadGlyphPath(FX_DWORD glyph_index, int dest_width = 0);
-
int GetGlyphWidth(FX_DWORD glyph_index);
-
int GetAscent() const;
-
int GetDescent() const;
-
FX_BOOL GetGlyphBBox(FX_DWORD glyph_index, FX_RECT& bbox);
-
- FX_BOOL IsItalic();
-
- FX_BOOL IsBold();
-
- FX_BOOL IsFixedWidth();
-
+ FX_BOOL IsItalic() const;
+ FX_BOOL IsBold() const;
+ FX_BOOL IsFixedWidth() const;
FX_BOOL IsVertical() const { return m_bVertical; }
-
CFX_WideString GetPsName() const;
-
CFX_ByteString GetFamilyName() const;
-
CFX_ByteString GetFaceName() const;
-
- FX_BOOL IsTTFont();
-
+ FX_BOOL IsTTFont() const;
FX_BOOL GetBBox(FX_RECT& bbox);
+ int GetHeight() const;
+ int GetULPos() const;
+ int GetULthickness() const;
+ int GetMaxAdvanceWidth() const;
+ FX_BOOL IsEmbedded() const { return m_bEmbedded; }
+ uint8_t* GetSubData() const { return m_pGsubData; }
+ void SetSubData(uint8_t* data) { m_pGsubData = data; }
+ void AdjustMMParams(int glyph_index, int width, int weight);
- int GetHeight();
-
- int GetULPos();
-
- int GetULthickness();
-
- int GetMaxAdvanceWidth();
+ private:
+ void ReleasePlatformResource();
+ void DeleteFace();
FXFT_Face m_Face;
-
CFX_SubstFont* m_pSubstFont;
- FX_BOOL IsEmbedded() { return m_bEmbedded; }
-
- void AdjustMMParams(int glyph_index, int width, int weight);
uint8_t* m_pFontDataAllocation;
uint8_t* m_pFontData;
uint8_t* m_pGsubData;
@@ -127,15 +109,10 @@ class CFX_Font {
void* m_pPlatformFontCollection;
void* m_pDwFont;
FX_BOOL m_bDwLoaded;
- void ReleasePlatformResource();
-
- void DeleteFace();
-
- protected:
FX_BOOL m_bEmbedded;
FX_BOOL m_bVertical;
- void* m_pOwnedStream;
};
+
#define ENCODING_INTERNAL 0
#define ENCODING_UNICODE 1