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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 return (uint8_t)m_wCharSet; | 340 return (uint8_t)m_wCharSet; |
341 } | 341 } |
342 if (!m_pFont->GetSubstFont()) { | 342 if (!m_pFont->GetSubstFont()) { |
343 return FX_CHARSET_Default; | 343 return FX_CHARSET_Default; |
344 } | 344 } |
345 return m_pFont->GetSubstFont()->m_Charset; | 345 return m_pFont->GetSubstFont()->m_Charset; |
346 } | 346 } |
347 void CFX_GEFont::GetFamilyName(CFX_WideString& wsFamily) const { | 347 void CFX_GEFont::GetFamilyName(CFX_WideString& wsFamily) const { |
348 if (!m_pFont->GetSubstFont() || | 348 if (!m_pFont->GetSubstFont() || |
349 m_pFont->GetSubstFont()->m_Family.GetLength() == 0) { | 349 m_pFont->GetSubstFont()->m_Family.GetLength() == 0) { |
350 wsFamily = CFX_WideString::FromLocal(m_pFont->GetFamilyName()); | 350 wsFamily = |
| 351 CFX_WideString::FromLocal(m_pFont->GetFamilyName().AsByteStringC()); |
351 } else { | 352 } else { |
352 wsFamily = CFX_WideString::FromLocal(m_pFont->GetSubstFont()->m_Family); | 353 wsFamily = CFX_WideString::FromLocal( |
| 354 m_pFont->GetSubstFont()->m_Family.AsByteStringC()); |
353 } | 355 } |
354 } | 356 } |
355 void CFX_GEFont::GetPsName(CFX_WideString& wsName) const { | 357 void CFX_GEFont::GetPsName(CFX_WideString& wsName) const { |
356 wsName = m_pFont->GetPsName(); | 358 wsName = m_pFont->GetPsName(); |
357 } | 359 } |
358 uint32_t CFX_GEFont::GetFontStyles() const { | 360 uint32_t CFX_GEFont::GetFontStyles() const { |
359 FXSYS_assert(m_pFont != NULL); | 361 FXSYS_assert(m_pFont != NULL); |
360 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 362 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
361 if (m_bUseLogFontStyle) { | 363 if (m_bUseLogFontStyle) { |
362 return m_dwLogFontStyle; | 364 return m_dwLogFontStyle; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 } | 565 } |
564 if (m_pRectArray != NULL) { | 566 if (m_pRectArray != NULL) { |
565 m_pRectArray->RemoveAll(); | 567 m_pRectArray->RemoveAll(); |
566 } | 568 } |
567 } | 569 } |
568 IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { | 570 IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const { |
569 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; | 571 iGlyphIndex = ((uint32_t)iGlyphIndex) >> 24; |
570 return iGlyphIndex == 0 ? (IFX_Font*)this | 572 return iGlyphIndex == 0 ? (IFX_Font*)this |
571 : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1]; | 573 : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1]; |
572 } | 574 } |
OLD | NEW |