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

Unified Diff: core/fpdfapi/fpdf_font/cpdf_simplefont.h

Issue 1824033002: Split core/include/fpdfapi/fpdf_resource.h (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fixing mac build Created 4 years, 9 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
Index: core/fpdfapi/fpdf_font/cpdf_simplefont.h
diff --git a/core/fpdfapi/fpdf_font/cpdf_simplefont.h b/core/fpdfapi/fpdf_font/cpdf_simplefont.h
new file mode 100644
index 0000000000000000000000000000000000000000..017f36ca90cc4c7a833bba60ae518f7e13859229
--- /dev/null
+++ b/core/fpdfapi/fpdf_font/cpdf_simplefont.h
@@ -0,0 +1,48 @@
+// 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_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_
+#define CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_
+
+#include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
+#include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h"
+#include "core/include/fxcrt/fx_string.h"
+#include "core/include/fxcrt/fx_system.h"
+
+class CPDF_SimpleFont : public CPDF_Font {
+ public:
+ CPDF_SimpleFont();
+ virtual ~CPDF_SimpleFont();
+
+ // CPDF_Font:
+ int GetCharWidthF(FX_DWORD charcode, int level = 0) override;
+ FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override;
+ int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override;
+ FX_BOOL IsUnicodeCompatible() const override;
+ CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override;
+ FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const override;
+
+ CPDF_FontEncoding* GetEncoding() { return &m_Encoding; }
+
+ protected:
+ virtual void LoadGlyphMap() = 0;
+
+ FX_BOOL LoadCommon();
+ void LoadSubstFont();
+ void LoadFaceMetrics();
+ void LoadCharMetrics(int charcode);
+
+ CPDF_FontEncoding m_Encoding;
+ uint16_t m_GlyphIndex[256];
+ uint16_t m_ExtGID[256];
+ CFX_ByteString* m_pCharNames;
+ int m_BaseEncoding;
+ uint16_t m_CharWidth[256];
+ FX_SMALL_RECT m_CharBBox[256];
+ FX_BOOL m_bUseFontWidth;
+};
+
+#endif // CORE_FPDFAPI_FPDF_FONT_CPDF_SIMPLEFONT_H_

Powered by Google App Engine
This is Rietveld 408576698