| 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 "xfa/fgas/font/fgas_gefont.h" | 7 #include "xfa/fgas/font/fgas_gefont.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 iGlyphIndex |= ((i + 1) << 24); | 431 iGlyphIndex |= ((i + 1) << 24); |
| 432 if (ppFont) | 432 if (ppFont) |
| 433 *ppFont = pFont; | 433 *ppFont = pFont; |
| 434 return iGlyphIndex; | 434 return iGlyphIndex; |
| 435 } | 435 } |
| 436 } | 436 } |
| 437 } | 437 } |
| 438 if (m_pFontMgr && bRecursive) { | 438 if (m_pFontMgr && bRecursive) { |
| 439 CFX_WideString wsFamily; | 439 CFX_WideString wsFamily; |
| 440 GetFamilyName(wsFamily); | 440 GetFamilyName(wsFamily); |
| 441 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | |
| 442 CFGAS_GEFont* pFont = m_pFontMgr->GetDefFontByUnicode( | |
| 443 wUnicode, GetFontStyles(), wsFamily.c_str()); | |
| 444 #else | |
| 445 CFGAS_GEFont* pFont = m_pFontMgr->GetFontByUnicode( | 441 CFGAS_GEFont* pFont = m_pFontMgr->GetFontByUnicode( |
| 446 wUnicode, GetFontStyles(), wsFamily.c_str()); | 442 wUnicode, GetFontStyles(), wsFamily.c_str()); |
| 443 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
| 447 if (!pFont) | 444 if (!pFont) |
| 448 pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), nullptr); | 445 pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), nullptr); |
| 449 #endif | 446 #endif |
| 450 if (pFont) { | 447 if (pFont) { |
| 451 if (pFont == this) { | 448 if (pFont == this) { |
| 452 pFont->Release(); | 449 pFont->Release(); |
| 453 return 0xFFFF; | 450 return 0xFFFF; |
| 454 } | 451 } |
| 455 m_FontMapper[wUnicode] = pFont; | 452 m_FontMapper[wUnicode] = pFont; |
| 456 int32_t i = m_SubstFonts.GetSize(); | 453 int32_t i = m_SubstFonts.GetSize(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 483 } | 480 } |
| 484 if (m_pRectArray) { | 481 if (m_pRectArray) { |
| 485 m_pRectArray->RemoveAll(false); | 482 m_pRectArray->RemoveAll(false); |
| 486 } | 483 } |
| 487 } | 484 } |
| 488 CFGAS_GEFont* CFGAS_GEFont::GetSubstFont(int32_t iGlyphIndex) const { | 485 CFGAS_GEFont* CFGAS_GEFont::GetSubstFont(int32_t iGlyphIndex) const { |
| 489 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; | 486 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; |
| 490 return iGlyphIndex == 0 ? const_cast<CFGAS_GEFont*>(this) | 487 return iGlyphIndex == 0 ? const_cast<CFGAS_GEFont*>(this) |
| 491 : m_SubstFonts[iGlyphIndex - 1]; | 488 : m_SubstFonts[iGlyphIndex - 1]; |
| 492 } | 489 } |
| OLD | NEW |