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 "../../../include/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
8 #include "../../../include/fxge/fx_freetype.h" | 8 #include "../../../include/fxge/fx_freetype.h" |
9 #include "text_int.h" | 9 #include "text_int.h" |
10 #define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1]) | 10 #define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1]) |
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 } | 1421 } |
1422 void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_
DWORD filesize, FX_DWORD offset) | 1422 void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_
DWORD filesize, FX_DWORD offset) |
1423 { | 1423 { |
1424 FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET); | 1424 FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET); |
1425 char buffer[16]; | 1425 char buffer[16]; |
1426 if (!FXSYS_fread(buffer, 12, 1, pFile)) { | 1426 if (!FXSYS_fread(buffer, 12, 1, pFile)) { |
1427 return; | 1427 return; |
1428 } | 1428 } |
1429 FX_DWORD nTables = GET_TT_SHORT(buffer + 4); | 1429 FX_DWORD nTables = GET_TT_SHORT(buffer + 4); |
1430 CFX_ByteString tables = _FPDF_ReadStringFromFile(pFile, nTables * 16); | 1430 CFX_ByteString tables = _FPDF_ReadStringFromFile(pFile, nTables * 16); |
| 1431 if (tables.IsEmpty()) { |
| 1432 return; |
| 1433 } |
1431 CFX_ByteString names = _FPDF_LoadTableFromTT(pFile, tables, nTables, 0x6e616
d65); | 1434 CFX_ByteString names = _FPDF_LoadTableFromTT(pFile, tables, nTables, 0x6e616
d65); |
1432 CFX_ByteString facename = _FPDF_GetNameFromTT(names, 1); | 1435 CFX_ByteString facename = _FPDF_GetNameFromTT(names, 1); |
1433 CFX_ByteString style = _FPDF_GetNameFromTT(names, 2); | 1436 CFX_ByteString style = _FPDF_GetNameFromTT(names, 2); |
1434 if (style != "Regular") { | 1437 if (style != "Regular") { |
1435 facename += " " + style; | 1438 facename += " " + style; |
1436 } | 1439 } |
1437 FX_LPVOID p; | 1440 FX_LPVOID p; |
1438 if (m_FontList.Lookup(facename, p)) { | 1441 if (m_FontList.Lookup(facename, p)) { |
1439 return; | 1442 return; |
1440 } | 1443 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 } | 1552 } |
1550 CFontFaceInfo* pFont = (CFontFaceInfo*)hFont; | 1553 CFontFaceInfo* pFont = (CFontFaceInfo*)hFont; |
1551 name = pFont->m_FaceName; | 1554 name = pFont->m_FaceName; |
1552 return TRUE; | 1555 return TRUE; |
1553 } | 1556 } |
1554 FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) | 1557 FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset) |
1555 { | 1558 { |
1556 return FALSE; | 1559 return FALSE; |
1557 } | 1560 } |
1558 #endif | 1561 #endif |
OLD | NEW |