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

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_document.cpp

Issue 2083943003: Use FXFONT defines in place of integers. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 4 years, 6 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/fpdfdoc/cpvt_fontmap.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 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 int32_t iMid = (iStart + iEnd) / 2; 254 int32_t iMid = (iStart + iEnd) / 2;
255 const FX_LANG2CS& charset = gs_FXLang2CharsetTable[iMid]; 255 const FX_LANG2CS& charset = gs_FXLang2CharsetTable[iMid];
256 if (uCode == charset.uLang) 256 if (uCode == charset.uLang)
257 return charset.uCharset; 257 return charset.uCharset;
258 258
259 if (uCode < charset.uLang) 259 if (uCode < charset.uLang)
260 iEnd = iMid - 1; 260 iEnd = iMid - 1;
261 else 261 else
262 iStart = iMid + 1; 262 iStart = iMid + 1;
263 } 263 }
264 return 0; 264 return FXFONT_ANSI_CHARSET;
265 } 265 }
266 266
267 uint8_t FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength) { 267 uint8_t FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength) {
268 ASSERT(pLang); 268 ASSERT(pLang);
269 if (iLength < 0) 269 if (iLength < 0)
270 iLength = FXSYS_strlen(pLang); 270 iLength = FXSYS_strlen(pLang);
271 271
272 uint32_t uHash = FX_GetLangHashCode(pLang); 272 uint32_t uHash = FX_GetLangHashCode(pLang);
273 return FX_GetCsFromLangCode(uHash); 273 return FX_GetCsFromLangCode(uHash);
274 } 274 }
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 } 1447 }
1448 } 1448 }
1449 pFontDesc->SetAtInteger("StemV", fStemV); 1449 pFontDesc->SetAtInteger("StemV", fStemV);
1450 AddIndirectObject(pFontDesc); 1450 AddIndirectObject(pFontDesc);
1451 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc); 1451 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
1452 CFRelease(traits); 1452 CFRelease(traits);
1453 CFRelease(languages); 1453 CFRelease(languages);
1454 return LoadFont(pBaseDict); 1454 return LoadFont(pBaseDict);
1455 } 1455 }
1456 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 1456 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
OLDNEW
« no previous file with comments | « no previous file | core/fpdfdoc/cpvt_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698