Home | History | Annotate | Download | only in android
      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_SKIAFONTDESCRIPTOR_H_
      8 #define CORE_FXGE_ANDROID_CFPF_SKIAFONTDESCRIPTOR_H_
      9 
     10 #include "core/fxcrt/fx_system.h"
     11 
     12 #define FPF_SKIAFONTTYPE_Unknown 0
     13 
     14 class CFPF_SkiaFontDescriptor {
     15  public:
     16   CFPF_SkiaFontDescriptor()
     17       : m_pFamily(nullptr),
     18         m_dwStyle(0),
     19         m_iFaceIndex(0),
     20         m_dwCharsets(0),
     21         m_iGlyphNum(0) {}
     22   virtual ~CFPF_SkiaFontDescriptor() { FX_Free(m_pFamily); }
     23 
     24   virtual int32_t GetType() const { return FPF_SKIAFONTTYPE_Unknown; }
     25 
     26   void SetFamily(const FX_CHAR* pFamily) {
     27     FX_Free(m_pFamily);
     28     int32_t iSize = FXSYS_strlen(pFamily);
     29     m_pFamily = FX_Alloc(FX_CHAR, iSize + 1);
     30     FXSYS_memcpy(m_pFamily, pFamily, iSize * sizeof(FX_CHAR));
     31     m_pFamily[iSize] = 0;
     32   }
     33   FX_CHAR* m_pFamily;
     34   uint32_t m_dwStyle;
     35   int32_t m_iFaceIndex;
     36   uint32_t m_dwCharsets;
     37   int32_t m_iGlyphNum;
     38 };
     39 
     40 #endif  // CORE_FXGE_ANDROID_CFPF_SKIAFONTDESCRIPTOR_H_
     41