OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 7 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 const CPDF_CIDFont* pCIDFont = AsCIDFont(); | 142 const CPDF_CIDFont* pCIDFont = AsCIDFont(); |
143 if (pCIDFont) { | 143 if (pCIDFont) { |
144 bVertWriting = pCIDFont->IsVertWriting(); | 144 bVertWriting = pCIDFont->IsVertWriting(); |
145 } else { | 145 } else { |
146 bVertWriting = m_Font.IsVertical(); | 146 bVertWriting = m_Font.IsVertical(); |
147 } | 147 } |
148 return bVertWriting; | 148 return bVertWriting; |
149 } | 149 } |
150 | 150 |
151 int CPDF_Font::AppendChar(FX_CHAR* buf, uint32_t charcode) const { | 151 int CPDF_Font::AppendChar(FX_CHAR* buf, uint32_t charcode) const { |
152 *buf = (FX_CHAR)charcode; | 152 *buf = static_cast<FX_CHAR>(charcode); |
153 return 1; | 153 return 1; |
154 } | 154 } |
155 | 155 |
156 void CPDF_Font::AppendChar(CFX_ByteString& str, uint32_t charcode) const { | 156 void CPDF_Font::AppendChar(CFX_ByteString& str, uint32_t charcode) const { |
157 char buf[4]; | 157 char buf[4]; |
158 int len = AppendChar(buf, charcode); | 158 int len = AppendChar(buf, charcode); |
159 if (len == 1) { | 159 if (len == 1) { |
160 str += buf[0]; | 160 str += buf[0]; |
161 } else { | 161 } else { |
162 str += CFX_ByteString(buf, len); | 162 str += CFX_ByteString(buf, len); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 if (charcode < 0 || charcode >= 256) | 462 if (charcode < 0 || charcode >= 256) |
463 return nullptr; | 463 return nullptr; |
464 | 464 |
465 const FX_CHAR* name = nullptr; | 465 const FX_CHAR* name = nullptr; |
466 if (pCharNames) | 466 if (pCharNames) |
467 name = pCharNames[charcode].c_str(); | 467 name = pCharNames[charcode].c_str(); |
468 if ((!name || name[0] == 0) && iBaseEncoding) | 468 if ((!name || name[0] == 0) && iBaseEncoding) |
469 name = PDF_CharNameFromPredefinedCharSet(iBaseEncoding, charcode); | 469 name = PDF_CharNameFromPredefinedCharSet(iBaseEncoding, charcode); |
470 return name && name[0] ? name : nullptr; | 470 return name && name[0] ? name : nullptr; |
471 } | 471 } |
OLD | NEW |