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