| 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 "xfa/fgas/crt/fgas_codepage.h" | 9 #include "xfa/fgas/crt/fgas_codepage.h" |
| 10 #include "xfa/fgas/font/fgas_fontutils.h" | 10 #include "xfa/fgas/font/fgas_fontutils.h" |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 if (ppFont) | 487 if (ppFont) |
| 488 *ppFont = pFont; | 488 *ppFont = pFont; |
| 489 return iGlyphIndex; | 489 return iGlyphIndex; |
| 490 } | 490 } |
| 491 } | 491 } |
| 492 } | 492 } |
| 493 if (m_pFontMgr && bRecursive) { | 493 if (m_pFontMgr && bRecursive) { |
| 494 CFX_WideString wsFamily; | 494 CFX_WideString wsFamily; |
| 495 GetFamilyName(wsFamily); | 495 GetFamilyName(wsFamily); |
| 496 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 496 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 497 IFX_Font* pFont = m_pFontMgr->GetDefFontByUnicode(wUnicode, GetFontStyles(), | 497 pFont = m_pFontMgr->GetDefFontByUnicode(wUnicode, GetFontStyles(), |
| 498 wsFamily.c_str()); | 498 wsFamily.c_str()); |
| 499 #else | 499 #else |
| 500 IFX_Font* pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), | 500 pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), |
| 501 wsFamily.c_str()); | 501 wsFamily.c_str()); |
| 502 if (!pFont) | 502 if (!pFont) |
| 503 pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), NULL); | 503 pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), NULL); |
| 504 #endif | 504 #endif |
| 505 if (pFont) { | 505 if (pFont) { |
| 506 if (pFont == this) { | 506 if (pFont == this) { |
| 507 pFont->Release(); | 507 pFont->Release(); |
| 508 return 0xFFFF; | 508 return 0xFFFF; |
| 509 } | 509 } |
| 510 m_FontMapper[wUnicode] = pFont; | 510 m_FontMapper[wUnicode] = pFont; |
| 511 int32_t i = m_SubstFonts.GetSize(); | 511 int32_t i = m_SubstFonts.GetSize(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 542 } | 542 } |
| 543 if (m_pRectArray != NULL) { | 543 if (m_pRectArray != NULL) { |
| 544 m_pRectArray->RemoveAll(); | 544 m_pRectArray->RemoveAll(); |
| 545 } | 545 } |
| 546 } | 546 } |
| 547 IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { | 547 IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { |
| 548 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; | 548 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; |
| 549 return iGlyphIndex == 0 ? const_cast<CFX_GEFont*>(this) | 549 return iGlyphIndex == 0 ? const_cast<CFX_GEFont*>(this) |
| 550 : m_SubstFonts[iGlyphIndex - 1]; | 550 : m_SubstFonts[iGlyphIndex - 1]; |
| 551 } | 551 } |
| OLD | NEW |