| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "../../../include/fxge/fx_ge.h" | 9 #include "../../../include/fxge/fx_ge.h" |
| 10 #include "../../../include/fxge/fx_freetype.h" | 10 #include "../../../include/fxge/fx_freetype.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) { | 456 void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) { |
| 457 if (pFontInfo == NULL) { | 457 if (pFontInfo == NULL) { |
| 458 return; | 458 return; |
| 459 } | 459 } |
| 460 if (m_pFontInfo) { | 460 if (m_pFontInfo) { |
| 461 m_pFontInfo->Release(); | 461 m_pFontInfo->Release(); |
| 462 } | 462 } |
| 463 m_pFontInfo = pFontInfo; | 463 m_pFontInfo = pFontInfo; |
| 464 } | 464 } |
| 465 static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) { | 465 static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) { |
| 466 CFX_ByteString norm(family, -1); | 466 CFX_ByteString norm(family); |
| 467 norm.Remove(' '); | 467 norm.Remove(' '); |
| 468 norm.Remove('-'); | 468 norm.Remove('-'); |
| 469 norm.Remove(','); | 469 norm.Remove(','); |
| 470 int pos = norm.Find('+'); | 470 int pos = norm.Find('+'); |
| 471 if (pos > 0) { | 471 if (pos > 0) { |
| 472 norm = norm.Left(pos); | 472 norm = norm.Left(pos); |
| 473 } | 473 } |
| 474 norm.MakeLower(); | 474 norm.MakeLower(); |
| 475 return norm; | 475 return norm; |
| 476 } | 476 } |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 int PDF_GetStandardFontName(CFX_ByteString* name) { | 1663 int PDF_GetStandardFontName(CFX_ByteString* name) { |
| 1664 AltFontName* found = static_cast<AltFontName*>( | 1664 AltFontName* found = static_cast<AltFontName*>( |
| 1665 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), | 1665 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), |
| 1666 sizeof(AltFontName), compareString)); | 1666 sizeof(AltFontName), compareString)); |
| 1667 if (!found) | 1667 if (!found) |
| 1668 return -1; | 1668 return -1; |
| 1669 | 1669 |
| 1670 *name = g_Base14FontNames[found->m_Index]; | 1670 *name = g_Base14FontNames[found->m_Index]; |
| 1671 return found->m_Index; | 1671 return found->m_Index; |
| 1672 } | 1672 } |
| OLD | NEW |