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_skiapathfont.h" 8 9 #include "core/fxcrt/fx_memory.h" 10 CFPF_SkiaPathFont()11CFPF_SkiaPathFont::CFPF_SkiaPathFont() : m_pPath(nullptr) {} 12 ~CFPF_SkiaPathFont()13CFPF_SkiaPathFont::~CFPF_SkiaPathFont() { 14 FX_Free(m_pPath); 15 } 16 GetType() const17int32_t CFPF_SkiaPathFont::GetType() const { 18 return FPF_SKIAFONTTYPE_Path; 19 } 20 SetPath(const char * pPath)21void CFPF_SkiaPathFont::SetPath(const char* pPath) { 22 FX_Free(m_pPath); 23 int32_t iSize = strlen(pPath); 24 m_pPath = FX_Alloc(char, iSize + 1); 25 memcpy(m_pPath, pPath, iSize * sizeof(char)); 26 m_pPath[iSize] = 0; 27 } 28