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 "core/fxge/include/cfx_substfont.h" | 9 #include "core/fxge/include/cfx_substfont.h" |
10 #include "core/fxge/include/cfx_unicodeencoding.h" | 10 #include "core/fxge/include/cfx_unicodeencoding.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 int32_t iWeight = | 189 int32_t iWeight = |
190 (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL; | 190 (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL; |
191 m_pFont = new CFX_Font; | 191 m_pFont = new CFX_Font; |
192 if ((dwFlags & FXFONT_ITALIC) && (dwFlags & FXFONT_BOLD)) { | 192 if ((dwFlags & FXFONT_ITALIC) && (dwFlags & FXFONT_BOLD)) { |
193 csFontFamily += ",BoldItalic"; | 193 csFontFamily += ",BoldItalic"; |
194 } else if (dwFlags & FXFONT_BOLD) { | 194 } else if (dwFlags & FXFONT_BOLD) { |
195 csFontFamily += ",Bold"; | 195 csFontFamily += ",Bold"; |
196 } else if (dwFlags & FXFONT_ITALIC) { | 196 } else if (dwFlags & FXFONT_ITALIC) { |
197 csFontFamily += ",Italic"; | 197 csFontFamily += ",Italic"; |
198 } | 198 } |
199 m_pFont->LoadSubst(csFontFamily, TRUE, dwFlags, iWeight, 0, wCodePage); | 199 m_pFont->LoadSubst(csFontFamily, TRUE, dwFlags, iWeight, 0, wCodePage, false); |
200 if (!m_pFont->GetFace()) | 200 if (!m_pFont->GetFace()) |
201 return false; | 201 return false; |
202 return InitFont(); | 202 return InitFont(); |
203 } | 203 } |
204 | 204 |
205 FX_BOOL CFGAS_GEFont::LoadFontInternal(const uint8_t* pBuffer, int32_t length) { | 205 FX_BOOL CFGAS_GEFont::LoadFontInternal(const uint8_t* pBuffer, int32_t length) { |
206 if (m_pFont) | 206 if (m_pFont) |
207 return FALSE; | 207 return FALSE; |
208 | 208 |
209 m_pFont = new CFX_Font; | 209 m_pFont = new CFX_Font; |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } | 480 } |
481 if (m_pRectArray) { | 481 if (m_pRectArray) { |
482 m_pRectArray->RemoveAll(FALSE); | 482 m_pRectArray->RemoveAll(FALSE); |
483 } | 483 } |
484 } | 484 } |
485 CFGAS_GEFont* CFGAS_GEFont::GetSubstFont(int32_t iGlyphIndex) const { | 485 CFGAS_GEFont* CFGAS_GEFont::GetSubstFont(int32_t iGlyphIndex) const { |
486 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; | 486 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; |
487 return iGlyphIndex == 0 ? const_cast<CFGAS_GEFont*>(this) | 487 return iGlyphIndex == 0 ? const_cast<CFGAS_GEFont*>(this) |
488 : m_SubstFonts[iGlyphIndex - 1]; | 488 : m_SubstFonts[iGlyphIndex - 1]; |
489 } | 489 } |
OLD | NEW |