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

Unified Diff: core/fxge/include/cfx_fontmapper.h

Issue 2185533006: Splitting fx_ge_fontmap.cpp (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add missing includes Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxge/ge/fx_ge_text.cpp ('k') | core/fxge/include/cfx_fontmgr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/include/cfx_fontmapper.h
diff --git a/core/fxge/include/cfx_fontmapper.h b/core/fxge/include/cfx_fontmapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..dc36f0b08a266fbe5c8c3eee2cf6596bfa025750
--- /dev/null
+++ b/core/fxge/include/cfx_fontmapper.h
@@ -0,0 +1,73 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FXGE_INCLUDE_CFX_FONTMAPPER_H_
+#define CORE_FXGE_INCLUDE_CFX_FONTMAPPER_H_
+
+#include <memory>
+#include <vector>
+
+#include "core/fxge/include/cfx_fontmgr.h"
+#include "core/fxge/include/fx_font.h"
+
+class CFX_FontMapper {
+ public:
+ explicit CFX_FontMapper(CFX_FontMgr* mgr);
+ ~CFX_FontMapper();
+
+ void SetSystemFontInfo(std::unique_ptr<IFX_SystemFontInfo> pFontInfo);
+ IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo.get(); }
+ void AddInstalledFont(const CFX_ByteString& name, int charset);
+ void LoadInstalledFonts();
+
+ FXFT_Face FindSubstFont(const CFX_ByteString& face_name,
+ FX_BOOL bTrueType,
+ uint32_t flags,
+ int weight,
+ int italic_angle,
+ int CharsetCP,
+ CFX_SubstFont* pSubstFont);
+#ifdef PDF_ENABLE_XFA
+ FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode,
+ uint32_t flags,
+ int weight,
+ int italic_angle);
+#endif // PDF_ENABLE_XFA
+ FX_BOOL IsBuiltinFace(const FXFT_Face face) const;
+ int GetFaceSize() const;
+ CFX_ByteString GetFaceName(int index) const {
+ return m_FaceArray[index].name;
+ }
+
+ std::vector<CFX_ByteString> m_InstalledTTFonts;
+
+ private:
+ static const size_t MM_FACE_COUNT = 2;
+ static const size_t FOXIT_FACE_COUNT = 14;
+
+ CFX_ByteString GetPSNameFromTT(void* hFont);
+ CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name);
+ FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont,
+ int iBaseFont,
+ int italic_angle,
+ int weight,
+ int picthfamily);
+
+ struct FaceData {
+ CFX_ByteString name;
+ uint32_t charset;
+ };
+
+ FX_BOOL m_bListLoaded;
+ FXFT_Face m_MMFaces[MM_FACE_COUNT];
+ CFX_ByteString m_LastFamily;
+ std::vector<FaceData> m_FaceArray;
+ std::unique_ptr<IFX_SystemFontInfo> m_pFontInfo;
+ FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT];
+ CFX_FontMgr* const m_pFontMgr;
+};
+
+#endif // CORE_FXGE_INCLUDE_CFX_FONTMAPPER_H_
« no previous file with comments | « core/fxge/ge/fx_ge_text.cpp ('k') | core/fxge/include/cfx_fontmgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698