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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 *ppFont = pFont; | 507 *ppFont = pFont; |
508 } | 508 } |
509 return iGlyphIndex; | 509 return iGlyphIndex; |
510 } | 510 } |
511 } | 511 } |
512 } | 512 } |
513 if (m_pFontMgr != NULL && bRecursive) { | 513 if (m_pFontMgr != NULL && bRecursive) { |
514 CFX_WideString wsFamily; | 514 CFX_WideString wsFamily; |
515 GetFamilyName(wsFamily); | 515 GetFamilyName(wsFamily); |
516 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 516 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
517 IFX_Font* pFont = m_pFontMgr->GetDefFontByUnicode( | 517 IFX_Font* pFont = m_pFontMgr->GetDefFontByUnicode(wUnicode, GetFontStyles(), |
518 wUnicode, GetFontStyles(), (const FX_WCHAR*)wsFamily); | 518 wsFamily.c_str()); |
519 #else | 519 #else |
520 IFX_Font* pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), | 520 IFX_Font* pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), |
521 (const FX_WCHAR*)wsFamily); | 521 wsFamily.c_str()); |
522 if (NULL == pFont) { | 522 if (NULL == pFont) { |
523 pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), NULL); | 523 pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), NULL); |
524 } | 524 } |
525 #endif | 525 #endif |
526 if (pFont != NULL) { | 526 if (pFont != NULL) { |
527 if (pFont == (IFX_Font*)this) { | 527 if (pFont == (IFX_Font*)this) { |
528 pFont->Release(); | 528 pFont->Release(); |
529 return 0xFFFF; | 529 return 0xFFFF; |
530 } | 530 } |
531 m_FontMapper.SetAt((void*)(uintptr_t)wUnicode, (void*)pFont); | 531 m_FontMapper.SetAt((void*)(uintptr_t)wUnicode, (void*)pFont); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 } | 564 } |
565 if (m_pRectArray != NULL) { | 565 if (m_pRectArray != NULL) { |
566 m_pRectArray->RemoveAll(); | 566 m_pRectArray->RemoveAll(); |
567 } | 567 } |
568 } | 568 } |
569 IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { | 569 IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { |
570 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; | 570 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; |
571 return iGlyphIndex == 0 ? (IFX_Font*)this | 571 return iGlyphIndex == 0 ? (IFX_Font*)this |
572 : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1]; | 572 : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1]; |
573 } | 573 } |
OLD | NEW |