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 "xfa/fgas/font/fgas_stdfontmgr.h" | 7 #include "xfa/fgas/font/fgas_stdfontmgr.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_stream.h" | 9 #include "core/fxcrt/include/fx_stream.h" |
10 #include "xfa/fgas/crt/fgas_codepage.h" | 10 #include "xfa/fgas/crt/fgas_codepage.h" |
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1373 uint16_t nNameCount = GetUInt16(sp); | 1373 uint16_t nNameCount = GetUInt16(sp); |
1374 uint8_t* lpStr = lpTable + GetUInt16(sp + 2); | 1374 uint8_t* lpStr = lpTable + GetUInt16(sp + 2); |
1375 for (uint16_t j = 0; j < nNameCount; j++) { | 1375 for (uint16_t j = 0; j < nNameCount; j++) { |
1376 uint16_t nNameID = GetUInt16(lpNameRecord + j * 12 + 6); | 1376 uint16_t nNameID = GetUInt16(lpNameRecord + j * 12 + 6); |
1377 if (nNameID != 1) { | 1377 if (nNameID != 1) { |
1378 continue; | 1378 continue; |
1379 } | 1379 } |
1380 uint16_t nPlatformID = GetUInt16(lpNameRecord + j * 12 + 0); | 1380 uint16_t nPlatformID = GetUInt16(lpNameRecord + j * 12 + 0); |
1381 uint16_t nNameLength = GetUInt16(lpNameRecord + j * 12 + 8); | 1381 uint16_t nNameLength = GetUInt16(lpNameRecord + j * 12 + 8); |
1382 uint16_t nNameOffset = GetUInt16(lpNameRecord + j * 12 + 10); | 1382 uint16_t nNameOffset = GetUInt16(lpNameRecord + j * 12 + 10); |
1383 wsFamily.Empty(); | 1383 wsFamily.clear(); |
1384 if (nPlatformID != 1) { | 1384 if (nPlatformID != 1) { |
1385 for (uint16_t k = 0; k < nNameLength / 2; k++) { | 1385 for (uint16_t k = 0; k < nNameLength / 2; k++) { |
1386 FX_WCHAR wcTemp = GetUInt16(lpStr + nNameOffset + k * 2); | 1386 FX_WCHAR wcTemp = GetUInt16(lpStr + nNameOffset + k * 2); |
1387 wsFamily += wcTemp; | 1387 wsFamily += wcTemp; |
1388 } | 1388 } |
1389 Names.Add(wsFamily); | 1389 Names.Add(wsFamily); |
1390 } else { | 1390 } else { |
1391 for (uint16_t k = 0; k < nNameLength; k++) { | 1391 for (uint16_t k = 0; k < nNameLength; k++) { |
1392 FX_WCHAR wcTemp = GetUInt8(lpStr + nNameOffset + k); | 1392 FX_WCHAR wcTemp = GetUInt8(lpStr + nNameOffset + k); |
1393 wsFamily += wcTemp; | 1393 wsFamily += wcTemp; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 } | 1503 } |
1504 } | 1504 } |
1505 int32_t CFX_FontMgrImp::IsPartName(const CFX_WideString& Name1, | 1505 int32_t CFX_FontMgrImp::IsPartName(const CFX_WideString& Name1, |
1506 const CFX_WideString& Name2) { | 1506 const CFX_WideString& Name2) { |
1507 if (Name1.Find(Name2.c_str()) != -1) { | 1507 if (Name1.Find(Name2.c_str()) != -1) { |
1508 return 1; | 1508 return 1; |
1509 } | 1509 } |
1510 return 0; | 1510 return 0; |
1511 } | 1511 } |
1512 #endif | 1512 #endif |
OLD | NEW |