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 #ifndef CORE_FXGE_ANDROID_CFPF_SKIAPATHFONT_H_ | |
8 #define CORE_FXGE_ANDROID_CFPF_SKIAPATHFONT_H_ | |
9 | |
10 #include "core/fxcrt/fx_system.h" | |
11 #include "core/fxge/android/cfpf_skiafontdescriptor.h" | |
12 | |
13 #define FPF_SKIAFONTTYPE_Path 1 | |
14 | |
15 class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor { | |
16 public: | |
17 CFPF_SkiaPathFont() : m_pPath(nullptr) {} | |
18 ~CFPF_SkiaPathFont() override { FX_Free(m_pPath); } | |
19 | |
20 // CFPF_SkiaFontDescriptor | |
21 int32_t GetType() const override { return FPF_SKIAFONTTYPE_Path; } | |
22 | |
23 void SetPath(const FX_CHAR* pPath) { | |
24 FX_Free(m_pPath); | |
Tom Sepez
2016/10/25 21:14:14
follow-up: ditto
| |
25 int32_t iSize = FXSYS_strlen(pPath); | |
26 m_pPath = FX_Alloc(FX_CHAR, iSize + 1); | |
27 FXSYS_memcpy(m_pPath, pPath, iSize * sizeof(FX_CHAR)); | |
28 m_pPath[iSize] = 0; | |
29 } | |
30 FX_CHAR* m_pPath; | |
31 }; | |
32 | |
33 #endif // CORE_FXGE_ANDROID_CFPF_SKIAPATHFONT_H_ | |
OLD | NEW |