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/fde/fde_gedevice.h" | 7 #include "xfa/fde/fde_gedevice.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 CFGAS_GEFont* pSTFont = NULL; | 130 CFGAS_GEFont* pSTFont = NULL; |
131 FXTEXT_CHARPOS* pCurCP = NULL; | 131 FXTEXT_CHARPOS* pCurCP = NULL; |
132 int32_t iCurCount = 0; | 132 int32_t iCurCount = 0; |
133 | 133 |
134 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 134 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
135 uint32_t dwFontStyle = pFont->GetFontStyles(); | 135 uint32_t dwFontStyle = pFont->GetFontStyles(); |
136 CFX_Font FxFont; | 136 CFX_Font FxFont; |
137 CFX_SubstFont SubstFxFont; | 137 CFX_SubstFont SubstFxFont; |
138 FxFont.SetSubstFont(&SubstFxFont); | 138 FxFont.SetSubstFont(&SubstFxFont); |
139 SubstFxFont.m_Weight = dwFontStyle & FX_FONTSTYLE_Bold ? 700 : 400; | 139 SubstFxFont.m_Weight = dwFontStyle & FX_FONTSTYLE_Bold ? 700 : 400; |
| 140 SubstFxFont.m_ItalicAngle = dwFontStyle & FX_FONTSTYLE_Italic ? -12 : 0; |
140 SubstFxFont.m_WeightCJK = SubstFxFont.m_Weight; | 141 SubstFxFont.m_WeightCJK = SubstFxFont.m_Weight; |
141 SubstFxFont.m_ItalicAngle = dwFontStyle & FX_FONTSTYLE_Italic ? -12 : 0; | 142 SubstFxFont.m_bItalicCJK = !!(dwFontStyle & FX_FONTSTYLE_Italic); |
142 SubstFxFont.m_bItlicCJK = !!(dwFontStyle & FX_FONTSTYLE_Italic); | |
143 #endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 143 #endif // _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
144 | 144 |
145 for (int32_t i = 0; i < iCount; ++i) { | 145 for (int32_t i = 0; i < iCount; ++i) { |
146 pSTFont = pFont->GetSubstFont((int32_t)pCP->m_GlyphIndex); | 146 pSTFont = pFont->GetSubstFont((int32_t)pCP->m_GlyphIndex); |
147 pCP->m_GlyphIndex &= 0x00FFFFFF; | 147 pCP->m_GlyphIndex &= 0x00FFFFFF; |
148 pCP->m_bFontStyle = false; | 148 pCP->m_bFontStyle = false; |
149 if (pCurFont != pSTFont) { | 149 if (pCurFont != pSTFont) { |
150 if (pCurFont) { | 150 if (pCurFont) { |
151 pFxFont = pCurFont->GetDevFont(); | 151 pFxFont = pCurFont->GetDevFont(); |
152 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 152 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 const CFX_Matrix* pMatrix) { | 323 const CFX_Matrix* pMatrix) { |
324 CFDE_Path* pGePath = (CFDE_Path*)pPath; | 324 CFDE_Path* pGePath = (CFDE_Path*)pPath; |
325 if (!pGePath) | 325 if (!pGePath) |
326 return FALSE; | 326 return FALSE; |
327 if (!pBrush) | 327 if (!pBrush) |
328 return FALSE; | 328 return FALSE; |
329 return m_pDevice->DrawPath(&pGePath->m_Path, pMatrix, nullptr, | 329 return m_pDevice->DrawPath(&pGePath->m_Path, pMatrix, nullptr, |
330 pBrush->GetColor(), 0, FXFILL_WINDING); | 330 pBrush->GetColor(), 0, FXFILL_WINDING); |
331 } | 331 } |
332 | 332 |
OLD | NEW |