| 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 "core/include/fxge/fx_freetype.h" | 9 #include "core/include/fxge/fx_freetype.h" |
| 10 #include "core/include/fxge/fx_ge.h" | 10 #include "core/include/fxge/fx_ge.h" |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 } | 1045 } |
| 1046 } | 1046 } |
| 1047 } else { | 1047 } else { |
| 1048 italic_angle = 0; | 1048 italic_angle = 0; |
| 1049 weight = | 1049 weight = |
| 1050 nStyle & FX_FONT_STYLE_BoldBold | 1050 nStyle & FX_FONT_STYLE_BoldBold |
| 1051 ? 900 | 1051 ? 900 |
| 1052 : (nStyle & FX_FONT_STYLE_Bold ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL); | 1052 : (nStyle & FX_FONT_STYLE_Bold ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL); |
| 1053 } | 1053 } |
| 1054 if (!match.IsEmpty() || iBaseFont < 12) { | 1054 if (!match.IsEmpty() || iBaseFont < 12) { |
| 1055 pSubstFont->m_SubstFlags |= FXFONT_SUBST_EXACT; | |
| 1056 if (!match.IsEmpty()) { | 1055 if (!match.IsEmpty()) { |
| 1057 family = match; | 1056 family = match; |
| 1058 } | 1057 } |
| 1059 if (iBaseFont < 12) { | 1058 if (iBaseFont < 12) { |
| 1060 if (nStyle && !(iBaseFont % 4)) { | 1059 if (nStyle && !(iBaseFont % 4)) { |
| 1061 if ((nStyle & 0x3) == 1) { | 1060 if ((nStyle & 0x3) == 1) { |
| 1062 iBaseFont += 1; | 1061 iBaseFont += 1; |
| 1063 } | 1062 } |
| 1064 if ((nStyle & 0x3) == 2) { | 1063 if ((nStyle & 0x3) == 2) { |
| 1065 iBaseFont += 3; | 1064 iBaseFont += 3; |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1591 int PDF_GetStandardFontName(CFX_ByteString* name) { | 1590 int PDF_GetStandardFontName(CFX_ByteString* name) { |
| 1592 AltFontName* found = static_cast<AltFontName*>( | 1591 AltFontName* found = static_cast<AltFontName*>( |
| 1593 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), | 1592 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), |
| 1594 sizeof(AltFontName), CompareString)); | 1593 sizeof(AltFontName), CompareString)); |
| 1595 if (!found) | 1594 if (!found) |
| 1596 return -1; | 1595 return -1; |
| 1597 | 1596 |
| 1598 *name = g_Base14FontNames[found->m_Index]; | 1597 *name = g_Base14FontNames[found->m_Index]; |
| 1599 return found->m_Index; | 1598 return found->m_Index; |
| 1600 } | 1599 } |
| OLD | NEW |