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 "../../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../../third_party/base/nonstd_unique_ptr.h" |
8 #include "../../../include/fxge/fx_ge.h" | 8 #include "../../../include/fxge/fx_ge.h" |
9 #include "../../../include/fxge/fx_freetype.h" | 9 #include "../../../include/fxge/fx_freetype.h" |
10 #include "ttgsubtable.h" | 10 #include "ttgsubtable.h" |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 381 } |
382 FX_BOOL CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum, | 382 FX_BOOL CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum, |
383 FX_DWORD* vglyphnum) { | 383 FX_DWORD* vglyphnum) { |
384 return m_GsubImp.GetVerticalGlyph(glyphnum, vglyphnum); | 384 return m_GsubImp.GetVerticalGlyph(glyphnum, vglyphnum); |
385 } | 385 } |
386 // static | 386 // static |
387 IFX_GSUBTable* IFX_GSUBTable::Create(CFX_Font* pFont) { | 387 IFX_GSUBTable* IFX_GSUBTable::Create(CFX_Font* pFont) { |
388 if (!pFont) { | 388 if (!pFont) { |
389 return NULL; | 389 return NULL; |
390 } | 390 } |
391 if (NULL == pFont->m_pGsubData) { | 391 if (!pFont->GetSubData()) { |
392 unsigned long length = 0; | 392 unsigned long length = 0; |
393 int error = FXFT_Load_Sfnt_Table( | 393 int error = FXFT_Load_Sfnt_Table( |
394 pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length); | 394 pFont->GetFace(), FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length); |
395 if (!error) { | 395 if (!error) { |
396 pFont->m_pGsubData = (unsigned char*)FX_Alloc(uint8_t, length); | 396 pFont->SetSubData((uint8_t*)FX_Alloc(uint8_t, length)); |
397 } | 397 } |
398 if (!pFont->m_pGsubData) { | 398 if (!pFont->GetSubData()) { |
399 return NULL; | 399 return NULL; |
400 } | 400 } |
401 } | 401 } |
402 int error = | 402 int error = |
403 FXFT_Load_Sfnt_Table(pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, | 403 FXFT_Load_Sfnt_Table(pFont->GetFace(), FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, |
404 pFont->m_pGsubData, NULL); | 404 pFont->GetSubData(), NULL); |
405 if (!error && pFont->m_pGsubData) { | 405 if (!error && pFont->GetSubData()) { |
406 nonstd::unique_ptr<CFX_GSUBTable> pGsubTable(new CFX_GSUBTable); | 406 nonstd::unique_ptr<CFX_GSUBTable> pGsubTable(new CFX_GSUBTable); |
407 if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->m_pGsubData)) { | 407 if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->GetSubData())) { |
408 return pGsubTable.release(); | 408 return pGsubTable.release(); |
409 } | 409 } |
410 } | 410 } |
411 return NULL; | 411 return NULL; |
412 } | 412 } |
OLD | NEW |