| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 pSubstFont->m_SubstFlags |= FXFONT_SUBST_NONSYMBOL; | 1149 pSubstFont->m_SubstFlags |= FXFONT_SUBST_NONSYMBOL; |
| 1150 return FindSubstFont(family, bTrueType, flags & ~FXFONT_SYMBOLIC, | 1150 return FindSubstFont(family, bTrueType, flags & ~FXFONT_SYMBOLIC, |
| 1151 weight, italic_angle, 0, pSubstFont); | 1151 weight, italic_angle, 0, pSubstFont); |
| 1152 } | 1152 } |
| 1153 if (Charset == FXFONT_ANSI_CHARSET) { | 1153 if (Charset == FXFONT_ANSI_CHARSET) { |
| 1154 pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD; | 1154 pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD; |
| 1155 return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, | 1155 return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, |
| 1156 PitchFamily); | 1156 PitchFamily); |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 auto it = std::find_if( | 1159 auto it = |
| 1160 m_FaceArray.begin(), m_FaceArray.end(), | 1160 std::find_if(m_FaceArray.begin(), m_FaceArray.end(), |
| 1161 [Charset](const FaceData& face) { return face.charset == Charset; }); | 1161 [Charset](const FaceData& face) { |
| 1162 return face.charset == static_cast<uint32_t>(Charset); |
| 1163 }); |
| 1162 if (it == m_FaceArray.end()) { | 1164 if (it == m_FaceArray.end()) { |
| 1163 return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, | 1165 return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, |
| 1164 PitchFamily); | 1166 PitchFamily); |
| 1165 } | 1167 } |
| 1166 hFont = m_pFontInfo->GetFont(it->name); | 1168 hFont = m_pFontInfo->GetFont(it->name); |
| 1167 } | 1169 } |
| 1168 } | 1170 } |
| 1169 pSubstFont->m_ExtHandle = m_pFontInfo->RetainFont(hFont); | 1171 pSubstFont->m_ExtHandle = m_pFontInfo->RetainFont(hFont); |
| 1170 if (!hFont) | 1172 if (!hFont) |
| 1171 return nullptr; | 1173 return nullptr; |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 int PDF_GetStandardFontName(CFX_ByteString* name) { | 1644 int PDF_GetStandardFontName(CFX_ByteString* name) { |
| 1643 AltFontName* found = static_cast<AltFontName*>( | 1645 AltFontName* found = static_cast<AltFontName*>( |
| 1644 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), | 1646 FXSYS_bsearch(name->c_str(), g_AltFontNames, FX_ArraySize(g_AltFontNames), |
| 1645 sizeof(AltFontName), CompareString)); | 1647 sizeof(AltFontName), CompareString)); |
| 1646 if (!found) | 1648 if (!found) |
| 1647 return -1; | 1649 return -1; |
| 1648 | 1650 |
| 1649 *name = g_Base14FontNames[found->m_Index]; | 1651 *name = g_Base14FontNames[found->m_Index]; |
| 1650 return found->m_Index; | 1652 return found->m_Index; |
| 1651 } | 1653 } |
| OLD | NEW |