| 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 "core/include/fxcrt/fx_system.h" | 7 #include "core/include/fxcrt/fx_system.h" |
| 8 #include "core/include/fxge/fx_ge.h" | 8 #include "core/include/fxge/fx_ge.h" |
| 9 | 9 |
| 10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (!pFont->GetPlatformFont()) { | 67 if (!pFont->GetPlatformFont()) { |
| 68 if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) { | 68 if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) { |
| 69 return FALSE; | 69 return FALSE; |
| 70 } | 70 } |
| 71 pFont->SetPlatformFont( | 71 pFont->SetPlatformFont( |
| 72 quartz2d.CreateFont(pFont->GetFontData(), pFont->GetSize())); | 72 quartz2d.CreateFont(pFont->GetFontData(), pFont->GetSize())); |
| 73 if (!pFont->GetPlatformFont()) { | 73 if (!pFont->GetPlatformFont()) { |
| 74 return FALSE; | 74 return FALSE; |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars); | 77 CFX_FixedBufGrow<uint16_t, 32> glyph_indices(nChars); |
| 78 CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars); | 78 CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars); |
| 79 for (int i = 0; i < nChars; i++) { | 79 for (int i = 0; i < nChars; i++) { |
| 80 glyph_indices[i] = pCharPos[i].m_ExtGID; | 80 glyph_indices[i] = pCharPos[i].m_ExtGID; |
| 81 if (bNegSize) { | 81 if (bNegSize) { |
| 82 glyph_positions[i].x = -pCharPos[i].m_OriginX; | 82 glyph_positions[i].x = -pCharPos[i].m_OriginX; |
| 83 } else { | 83 } else { |
| 84 glyph_positions[i].x = pCharPos[i].m_OriginX; | 84 glyph_positions[i].x = pCharPos[i].m_OriginX; |
| 85 } | 85 } |
| 86 glyph_positions[i].y = pCharPos[i].m_OriginY; | 86 glyph_positions[i].y = pCharPos[i].m_OriginY; |
| 87 } | 87 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 void CFX_Font::ReleasePlatformResource() { | 164 void CFX_Font::ReleasePlatformResource() { |
| 165 if (m_pPlatformFont) { | 165 if (m_pPlatformFont) { |
| 166 CQuartz2D& quartz2d = | 166 CQuartz2D& quartz2d = |
| 167 ((CApplePlatform*)CFX_GEModule::Get()->GetPlatformData())->_quartz2d; | 167 ((CApplePlatform*)CFX_GEModule::Get()->GetPlatformData())->_quartz2d; |
| 168 quartz2d.DestroyFont(m_pPlatformFont); | 168 quartz2d.DestroyFont(m_pPlatformFont); |
| 169 m_pPlatformFont = NULL; | 169 m_pPlatformFont = NULL; |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 173 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
| OLD | NEW |