summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_font.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-04 02:21:44 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-04 02:21:44 +0000
commit03395da5d5827b6b3049d8632d8d3f5545e45293 (patch)
tree910f8e48db49cfc9f88d6e621fd2a183038d6b1d /core/fpdfapi/font/cpdf_font.h
parentf21b88ef08d6f6d64e783f55819fc8b86c3b370e (diff)
downloadpdfium-03395da5d5827b6b3049d8632d8d3f5545e45293.tar.xz
Set the CPDF_Font doc / font dict in the ctor.
Then we can mark the doc pointer as const because it never changes again. Also move initialization to headers when possible, add missing dtors, and fix some nits. Change-Id: I461affc8dce14d805b935fb4d8b5aaafb058a789 Reviewed-on: https://pdfium-review.googlesource.com/39413 Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/font/cpdf_font.h')
-rw-r--r--core/fpdfapi/font/cpdf_font.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/fpdfapi/font/cpdf_font.h b/core/fpdfapi/font/cpdf_font.h
index 9580d1c36b..d79b13fb6b 100644
--- a/core/fpdfapi/font/cpdf_font.h
+++ b/core/fpdfapi/font/cpdf_font.h
@@ -88,7 +88,7 @@ class CPDF_Font {
CFX_Font* GetFontFallback(int position);
protected:
- CPDF_Font();
+ CPDF_Font(CPDF_Document* pDocument, CPDF_Dictionary* pFontDict);
static int TT2PDF(int m, FXFT_Face face);
static bool FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id);
@@ -108,20 +108,20 @@ class CPDF_Font {
const std::vector<ByteString>& charnames,
int charcode);
- UnownedPtr<CPDF_Document> m_pDocument;
+ UnownedPtr<CPDF_Document> const m_pDocument;
CFX_Font m_Font;
std::vector<std::unique_ptr<CFX_Font>> m_FontFallbacks;
- ByteString m_BaseFont;
RetainPtr<CPDF_StreamAcc> m_pFontFile;
UnownedPtr<CPDF_Dictionary> m_pFontDict;
+ ByteString m_BaseFont;
mutable std::unique_ptr<CPDF_ToUnicodeMap> m_pToUnicodeMap;
- mutable bool m_bToUnicodeLoaded;
- int m_Flags;
+ mutable bool m_bToUnicodeLoaded = false;
+ int m_Flags = 0;
+ int m_StemV = 0;
+ int m_Ascent = 0;
+ int m_Descent = 0;
+ int m_ItalicAngle = 0;
FX_RECT m_FontBBox;
- int m_StemV;
- int m_Ascent;
- int m_Descent;
- int m_ItalicAngle;
};
#endif // CORE_FPDFAPI_FONT_CPDF_FONT_H_