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" |
| 11 #include "xfa/fxfa/include/xfa_fontmgr.h" |
11 | 12 |
12 IFX_Font* IFX_Font::LoadFont(const FX_WCHAR* pszFontFamily, | 13 IFX_Font* IFX_Font::LoadFont(const FX_WCHAR* pszFontFamily, |
13 uint32_t dwFontStyles, | 14 uint32_t dwFontStyles, |
14 uint16_t wCodePage, | 15 uint16_t wCodePage, |
15 IFX_FontMgr* pFontMgr) { | 16 IFX_FontMgr* pFontMgr) { |
16 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 17 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
17 if (NULL != pFontMgr) { | 18 if (NULL != pFontMgr) { |
18 return pFontMgr->GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily); | 19 return pFontMgr->GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily); |
19 } | 20 } |
20 return NULL; | 21 return NULL; |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 } | 565 } |
565 if (m_pRectArray != NULL) { | 566 if (m_pRectArray != NULL) { |
566 m_pRectArray->RemoveAll(); | 567 m_pRectArray->RemoveAll(); |
567 } | 568 } |
568 } | 569 } |
569 IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { | 570 IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { |
570 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; | 571 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; |
571 return iGlyphIndex == 0 ? (IFX_Font*)this | 572 return iGlyphIndex == 0 ? (IFX_Font*)this |
572 : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1]; | 573 : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1]; |
573 } | 574 } |
OLD | NEW |