summaryrefslogtreecommitdiff
path: root/core/fxge/android/cfpf_skiafontmgr.h
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-10-25 14:26:39 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-25 14:26:39 -0700
commitcfcc11e53a60b3f56a9bbe13718ecb9b997384da (patch)
tree7ac6fc6f1bf8f180769021f51c7235db21da4eb1 /core/fxge/android/cfpf_skiafontmgr.h
parent4ee6139e8cfecab9e181115894b26131ad6de09a (diff)
downloadpdfium-cfcc11e53a60b3f56a9bbe13718ecb9b997384da.tar.xz
Name core/fxge/android files appropriately and use one file per class
- Rename files so that they correspond to class names. - Remove OS_Android ifs, since they are unneeded. - Split fpf_skiafontmgr.h into classes, one per file. Review-Url: https://codereview.chromium.org/2448293002
Diffstat (limited to 'core/fxge/android/cfpf_skiafontmgr.h')
-rw-r--r--core/fxge/android/cfpf_skiafontmgr.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/core/fxge/android/cfpf_skiafontmgr.h b/core/fxge/android/cfpf_skiafontmgr.h
new file mode 100644
index 0000000000..7d89c6edb8
--- /dev/null
+++ b/core/fxge/android/cfpf_skiafontmgr.h
@@ -0,0 +1,52 @@
+// 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_ANDROID_CFPF_SKIAFONTMGR_H_
+#define CORE_FXGE_ANDROID_CFPF_SKIAFONTMGR_H_
+
+#include <map>
+#include <vector>
+
+#include "core/fxcrt/fx_stream.h"
+#include "core/fxcrt/fx_string.h"
+#include "core/fxge/fx_font.h"
+
+#define FPF_MATCHFONT_REPLACEANSI 1
+
+class CFPF_SkiaFont;
+class CFPF_SkiaFontDescriptor;
+
+class CFPF_SkiaFontMgr {
+ public:
+ CFPF_SkiaFontMgr();
+ ~CFPF_SkiaFontMgr();
+
+ void LoadSystemFonts();
+ CFPF_SkiaFont* CreateFont(const CFX_ByteStringC& bsFamilyname,
+ uint8_t uCharset,
+ uint32_t dwStyle,
+ uint32_t dwMatch = 0);
+
+ bool InitFTLibrary();
+ FXFT_Face GetFontFace(IFX_SeekableReadStream* pFileRead,
+ int32_t iFaceIndex = 0);
+ FXFT_Face GetFontFace(const CFX_ByteStringC& bsFile, int32_t iFaceIndex = 0);
+ FXFT_Face GetFontFace(const uint8_t* pBuffer,
+ size_t szBuffer,
+ int32_t iFaceIndex = 0);
+
+ private:
+ void ScanPath(const CFX_ByteString& path);
+ void ScanFile(const CFX_ByteString& file);
+ void ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor* pFontDesc);
+
+ bool m_bLoaded;
+ FXFT_Library m_FTLibrary;
+ std::vector<CFPF_SkiaFontDescriptor*> m_FontFaces;
+ std::map<uint32_t, CFPF_SkiaFont*> m_FamilyFonts;
+};
+
+#endif // CORE_FXGE_ANDROID_CFPF_SKIAFONTMGR_H_