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