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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) { | 448 void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo) { |
449 if (pFontInfo == NULL) { | 449 if (pFontInfo == NULL) { |
450 return; | 450 return; |
451 } | 451 } |
452 if (m_pFontInfo) { | 452 if (m_pFontInfo) { |
453 m_pFontInfo->Release(); | 453 m_pFontInfo->Release(); |
454 } | 454 } |
455 m_pFontInfo = pFontInfo; | 455 m_pFontInfo = pFontInfo; |
456 } | 456 } |
457 static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) { | 457 static CFX_ByteString _TT_NormalizeName(const FX_CHAR* family) { |
458 CFX_ByteString norm(family, -1); | 458 CFX_ByteString norm(family); |
459 norm.Remove(' '); | 459 norm.Remove(' '); |
460 norm.Remove('-'); | 460 norm.Remove('-'); |
461 norm.Remove(','); | 461 norm.Remove(','); |
462 int pos = norm.Find('+'); | 462 int pos = norm.Find('+'); |
463 if (pos > 0) { | 463 if (pos > 0) { |
464 norm = norm.Left(pos); | 464 norm = norm.Left(pos); |
465 } | 465 } |
466 norm.MakeLower(); | 466 norm.MakeLower(); |
467 return norm; | 467 return norm; |
468 } | 468 } |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 int PDF_GetStandardFontName(CFX_ByteString* name) { | 1564 int PDF_GetStandardFontName(CFX_ByteString* name) { |
1565 AltFontName* found = static_cast<AltFontName*>( | 1565 AltFontName* found = static_cast<AltFontName*>( |
1566 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), | 1566 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), |
1567 sizeof(AltFontName), compareString)); | 1567 sizeof(AltFontName), compareString)); |
1568 if (!found) | 1568 if (!found) |
1569 return -1; | 1569 return -1; |
1570 | 1570 |
1571 *name = g_Base14FontNames[found->m_Index]; | 1571 *name = g_Base14FontNames[found->m_Index]; |
1572 return found->m_Index; | 1572 return found->m_Index; |
1573 } | 1573 } |
OLD | NEW |