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

Side by Side Diff: core/fpdfapi/fpdf_font/font_int.h

Issue 1817283002: Make predefined character table slightly smaller. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_font/fpdf_font_cid.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FPDFAPI_FPDF_FONT_FONT_INT_H_ 7 #ifndef CORE_FPDFAPI_FPDF_FONT_FONT_INT_H_
8 #define CORE_FPDFAPI_FPDF_FONT_FONT_INT_H_ 8 #define CORE_FPDFAPI_FPDF_FONT_FONT_INT_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 const CFX_ByteStringC& second); 103 const CFX_ByteStringC& second);
104 104
105 CPDF_CMap* m_pCMap; 105 CPDF_CMap* m_pCMap;
106 int m_Status; 106 int m_Status;
107 int m_CodeSeq; 107 int m_CodeSeq;
108 FX_DWORD m_CodePoints[4]; 108 FX_DWORD m_CodePoints[4];
109 CFX_ArrayTemplate<CMap_CodeRange> m_CodeRanges; 109 CFX_ArrayTemplate<CMap_CodeRange> m_CodeRanges;
110 CFX_ByteString m_Registry, m_Ordering, m_Supplement; 110 CFX_ByteString m_Registry, m_Ordering, m_Supplement;
111 CFX_ByteString m_LastWord; 111 CFX_ByteString m_LastWord;
112 }; 112 };
113 #define CIDCODING_UNKNOWN 0 113
114 #define CIDCODING_GB 1 114 enum CIDCoding : uint8_t {
115 #define CIDCODING_BIG5 2 115 CIDCODING_UNKNOWN = 0,
116 #define CIDCODING_JIS 3 116 CIDCODING_GB,
117 #define CIDCODING_KOREA 4 117 CIDCODING_BIG5,
118 #define CIDCODING_UCS2 5 118 CIDCODING_JIS,
119 #define CIDCODING_CID 6 119 CIDCODING_KOREA,
120 #define CIDCODING_UTF16 7 120 CIDCODING_UCS2,
121 CIDCODING_CID,
122 CIDCODING_UTF16,
123 };
124
121 class CPDF_CMap { 125 class CPDF_CMap {
122 public: 126 public:
127 enum CodingScheme : uint8_t {
128 OneByte,
129 TwoBytes,
130 MixedTwoBytes,
131 MixedFourBytes
132 };
133
123 CPDF_CMap(); 134 CPDF_CMap();
124 FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr, 135 FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr,
125 const FX_CHAR* name, 136 const FX_CHAR* name,
126 FX_BOOL bPromptCJK); 137 FX_BOOL bPromptCJK);
127 FX_BOOL LoadEmbedded(const uint8_t* pData, FX_DWORD dwSize); 138 FX_BOOL LoadEmbedded(const uint8_t* pData, FX_DWORD dwSize);
128 void Release(); 139 void Release();
129 FX_BOOL IsLoaded() const { return m_bLoaded; } 140 FX_BOOL IsLoaded() const { return m_bLoaded; }
130 FX_BOOL IsVertWriting() const { return m_bVertical; } 141 FX_BOOL IsVertWriting() const { return m_bVertical; }
131 uint16_t CIDFromCharCode(FX_DWORD charcode) const; 142 uint16_t CIDFromCharCode(FX_DWORD charcode) const;
132 FX_DWORD CharCodeFromCID(uint16_t CID) const; 143 FX_DWORD CharCodeFromCID(uint16_t CID) const;
133 int GetCharSize(FX_DWORD charcode) const; 144 int GetCharSize(FX_DWORD charcode) const;
134 FX_DWORD GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const; 145 FX_DWORD GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const;
135 int CountChar(const FX_CHAR* pString, int size) const; 146 int CountChar(const FX_CHAR* pString, int size) const;
136 int AppendChar(FX_CHAR* str, FX_DWORD charcode) const; 147 int AppendChar(FX_CHAR* str, FX_DWORD charcode) const;
137 typedef enum {
138 OneByte,
139 TwoBytes,
140 MixedTwoBytes,
141 MixedFourBytes
142 } CodingScheme;
143 148
144 protected: 149 protected:
145 ~CPDF_CMap(); 150 ~CPDF_CMap();
146 friend class CPDF_CMapParser; 151 friend class CPDF_CMapParser;
147 friend class CPDF_CMapManager; 152 friend class CPDF_CMapManager;
148 friend class CPDF_CIDFont; 153 friend class CPDF_CIDFont;
149 154
150 protected:
151 CFX_ByteString m_PredefinedCMap; 155 CFX_ByteString m_PredefinedCMap;
152 FX_BOOL m_bVertical; 156 FX_BOOL m_bVertical;
153 CIDSet m_Charset; 157 CIDSet m_Charset;
154 int m_Coding; 158 int m_Coding;
155 CodingScheme m_CodingScheme; 159 CodingScheme m_CodingScheme;
156 int m_nCodeRanges; 160 int m_nCodeRanges;
157 uint8_t* m_pLeadingBytes; 161 uint8_t* m_pLeadingBytes;
158 uint16_t* m_pMapping; 162 uint16_t* m_pMapping;
159 uint8_t* m_pAddMapping; 163 uint8_t* m_pAddMapping;
160 FX_BOOL m_bLoaded; 164 FX_BOOL m_bLoaded;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 198
195 static FX_DWORD StringToCode(const CFX_ByteStringC& str); 199 static FX_DWORD StringToCode(const CFX_ByteStringC& str);
196 static CFX_WideString StringToWideString(const CFX_ByteStringC& str); 200 static CFX_WideString StringToWideString(const CFX_ByteStringC& str);
197 }; 201 };
198 202
199 void FPDFAPI_LoadCID2UnicodeMap(CIDSet charset, 203 void FPDFAPI_LoadCID2UnicodeMap(CIDSet charset,
200 const uint16_t*& pMap, 204 const uint16_t*& pMap,
201 FX_DWORD& count); 205 FX_DWORD& count);
202 206
203 #endif // CORE_FPDFAPI_FPDF_FONT_FONT_INT_H_ 207 #endif // CORE_FPDFAPI_FPDF_FONT_FONT_INT_H_
OLDNEW
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_font/fpdf_font_cid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698