| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #include "core/fxge/ge/cttfontdesc.h" |
| 8 |
| 9 #include "core/fxge/include/fx_freetype.h" |
| 10 |
| 11 CTTFontDesc::~CTTFontDesc() { |
| 12 if (m_Type == 1) { |
| 13 if (m_SingleFace.m_pFace) |
| 14 FXFT_Done_Face(m_SingleFace.m_pFace); |
| 15 } else if (m_Type == 2) { |
| 16 for (int i = 0; i < 16; i++) { |
| 17 if (m_TTCFace.m_pFaces[i]) |
| 18 FXFT_Done_Face(m_TTCFace.m_pFaces[i]); |
| 19 } |
| 20 } |
| 21 FX_Free(m_pFontData); |
| 22 } |
| 23 |
| 24 int CTTFontDesc::ReleaseFace(FXFT_Face face) { |
| 25 if (m_Type == 1) { |
| 26 if (m_SingleFace.m_pFace != face) |
| 27 return -1; |
| 28 } else if (m_Type == 2) { |
| 29 int i; |
| 30 for (i = 0; i < 16; i++) { |
| 31 if (m_TTCFace.m_pFaces[i] == face) |
| 32 break; |
| 33 } |
| 34 if (i == 16) |
| 35 return -1; |
| 36 } |
| 37 m_RefCount--; |
| 38 if (m_RefCount) |
| 39 return m_RefCount; |
| 40 delete this; |
| 41 return 0; |
| 42 } |
| OLD | NEW |