| 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 "ttgsubtable.h" | 7 #include "ttgsubtable.h" |
| 8 | 8 |
| 9 #include <memory> |
| 10 |
| 9 #include "core/include/fxge/fx_freetype.h" | 11 #include "core/include/fxge/fx_freetype.h" |
| 10 #include "core/include/fxge/fx_ge.h" | 12 #include "core/include/fxge/fx_ge.h" |
| 11 #include "third_party/base/nonstd_unique_ptr.h" | |
| 12 #include "third_party/base/stl_util.h" | 13 #include "third_party/base/stl_util.h" |
| 13 | 14 |
| 14 CFX_GlyphMap::CFX_GlyphMap() {} | 15 CFX_GlyphMap::CFX_GlyphMap() {} |
| 15 CFX_GlyphMap::~CFX_GlyphMap() {} | 16 CFX_GlyphMap::~CFX_GlyphMap() {} |
| 16 extern "C" { | 17 extern "C" { |
| 17 static int _CompareInt(const void* p1, const void* p2) { | 18 static int _CompareInt(const void* p1, const void* p2) { |
| 18 return (*(FX_DWORD*)p1) - (*(FX_DWORD*)p2); | 19 return (*(FX_DWORD*)p1) - (*(FX_DWORD*)p2); |
| 19 } | 20 } |
| 20 }; | 21 }; |
| 21 struct _IntPair { | 22 struct _IntPair { |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 pFont->SetSubData(FX_Alloc(uint8_t, length)); | 399 pFont->SetSubData(FX_Alloc(uint8_t, length)); |
| 399 } | 400 } |
| 400 if (!pFont->GetSubData()) { | 401 if (!pFont->GetSubData()) { |
| 401 return NULL; | 402 return NULL; |
| 402 } | 403 } |
| 403 } | 404 } |
| 404 int error = | 405 int error = |
| 405 FXFT_Load_Sfnt_Table(pFont->GetFace(), FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, | 406 FXFT_Load_Sfnt_Table(pFont->GetFace(), FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, |
| 406 pFont->GetSubData(), NULL); | 407 pFont->GetSubData(), NULL); |
| 407 if (!error && pFont->GetSubData()) { | 408 if (!error && pFont->GetSubData()) { |
| 408 nonstd::unique_ptr<CFX_GSUBTable> pGsubTable(new CFX_GSUBTable); | 409 std::unique_ptr<CFX_GSUBTable> pGsubTable(new CFX_GSUBTable); |
| 409 if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->GetSubData())) { | 410 if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->GetSubData())) { |
| 410 return pGsubTable.release(); | 411 return pGsubTable.release(); |
| 411 } | 412 } |
| 412 } | 413 } |
| 413 return NULL; | 414 return NULL; |
| 414 } | 415 } |
| OLD | NEW |