OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |