summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-03-21 15:52:56 -0700
committerTom Sepez <tsepez@chromium.org>2016-03-21 15:52:56 -0700
commitd074e9787fe5f21d49269a504969cfcf4eec016b (patch)
tree8384a35e7cb251df4018c66c98716f41c97002fd /core/fpdfapi/fpdf_font
parent62a70f90c49cf7714c960186eb063ad55333e6f3 (diff)
downloadpdfium-d074e9787fe5f21d49269a504969cfcf4eec016b.tar.xz
Make predefined character table slightly smaller.
Add a few missing consts and remove a few extra externs. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1817283002 .
Diffstat (limited to 'core/fpdfapi/fpdf_font')
-rw-r--r--core/fpdfapi/fpdf_font/font_int.h34
-rw-r--r--core/fpdfapi/fpdf_font/fpdf_font_cid.cpp6
2 files changed, 22 insertions, 18 deletions
diff --git a/core/fpdfapi/fpdf_font/font_int.h b/core/fpdfapi/fpdf_font/font_int.h
index c9981387e6..bb209d8c16 100644
--- a/core/fpdfapi/fpdf_font/font_int.h
+++ b/core/fpdfapi/fpdf_font/font_int.h
@@ -110,16 +110,27 @@ class CPDF_CMapParser {
CFX_ByteString m_Registry, m_Ordering, m_Supplement;
CFX_ByteString m_LastWord;
};
-#define CIDCODING_UNKNOWN 0
-#define CIDCODING_GB 1
-#define CIDCODING_BIG5 2
-#define CIDCODING_JIS 3
-#define CIDCODING_KOREA 4
-#define CIDCODING_UCS2 5
-#define CIDCODING_CID 6
-#define CIDCODING_UTF16 7
+
+enum CIDCoding : uint8_t {
+ CIDCODING_UNKNOWN = 0,
+ CIDCODING_GB,
+ CIDCODING_BIG5,
+ CIDCODING_JIS,
+ CIDCODING_KOREA,
+ CIDCODING_UCS2,
+ CIDCODING_CID,
+ CIDCODING_UTF16,
+};
+
class CPDF_CMap {
public:
+ enum CodingScheme : uint8_t {
+ OneByte,
+ TwoBytes,
+ MixedTwoBytes,
+ MixedFourBytes
+ };
+
CPDF_CMap();
FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr,
const FX_CHAR* name,
@@ -134,12 +145,6 @@ class CPDF_CMap {
FX_DWORD GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const;
int CountChar(const FX_CHAR* pString, int size) const;
int AppendChar(FX_CHAR* str, FX_DWORD charcode) const;
- typedef enum {
- OneByte,
- TwoBytes,
- MixedTwoBytes,
- MixedFourBytes
- } CodingScheme;
protected:
~CPDF_CMap();
@@ -147,7 +152,6 @@ class CPDF_CMap {
friend class CPDF_CMapManager;
friend class CPDF_CIDFont;
- protected:
CFX_ByteString m_PredefinedCMap;
FX_BOOL m_bVertical;
CIDSet m_Charset;
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 60fa40103b..97a3d4dbc1 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -22,15 +22,15 @@ namespace {
const FX_CHAR* const g_CharsetNames[CIDSET_NUM_SETS] = {
nullptr, "GB1", "CNS1", "Japan1", "Korea1", "UCS"};
-const int g_CharsetCPs[CIDSET_NUM_SETS] = {0, 936, 950, 932, 949, 1200};
+const uint16_t g_CharsetCPs[CIDSET_NUM_SETS] = {0, 936, 950, 932, 949, 1200};
class CPDF_PredefinedCMap {
public:
const FX_CHAR* m_pName;
CIDSet m_Charset;
- int m_Coding;
+ CIDCoding m_Coding;
CPDF_CMap::CodingScheme m_CodingScheme;
- FX_DWORD m_LeadingSegCount;
+ uint8_t m_LeadingSegCount;
uint8_t m_LeadingSegs[4];
};