• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 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/android/cfpf_skiafontdescriptor.h"
8 
9 #include "core/fxcrt/fx_memory.h"
10 
CFPF_SkiaFontDescriptor()11 CFPF_SkiaFontDescriptor::CFPF_SkiaFontDescriptor()
12     : m_pFamily(nullptr),
13       m_dwStyle(0),
14       m_iFaceIndex(0),
15       m_dwCharsets(0),
16       m_iGlyphNum(0) {}
17 
~CFPF_SkiaFontDescriptor()18 CFPF_SkiaFontDescriptor::~CFPF_SkiaFontDescriptor() {
19   FX_Free(m_pFamily);
20 }
21 
GetType() const22 int32_t CFPF_SkiaFontDescriptor::GetType() const {
23   return FPF_SKIAFONTTYPE_Unknown;
24 }
25 
SetFamily(const char * pFamily)26 void CFPF_SkiaFontDescriptor::SetFamily(const char* pFamily) {
27   FX_Free(m_pFamily);
28   int32_t iSize = strlen(pFamily);
29   m_pFamily = FX_Alloc(char, iSize + 1);
30   memcpy(m_pFamily, pFamily, iSize * sizeof(char));
31   m_pFamily[iSize] = 0;
32 }
33