• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 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 #ifndef CORE_FXGE_CFX_FACE_H_
6 #define CORE_FXGE_CFX_FACE_H_
7 
8 #include "core/fxcrt/observed_ptr.h"
9 #include "core/fxcrt/retain_ptr.h"
10 #include "core/fxge/fx_freetype.h"
11 #include "third_party/base/span.h"
12 
13 class CFX_Face : public Retainable, public Observable {
14  public:
15   static RetainPtr<CFX_Face> New(FT_Library library,
16                                  const RetainPtr<Retainable>& pDesc,
17                                  pdfium::span<const FT_Byte> data,
18                                  FT_Long face_index);
19 
20   static RetainPtr<CFX_Face> Open(FT_Library library,
21                                   const FT_Open_Args* args,
22                                   FT_Long face_index);
23 
24   ~CFX_Face() override;
25 
GetRec()26   FXFT_FaceRec* GetRec() { return m_pRec.get(); }
27 
28  private:
29   CFX_Face(FXFT_FaceRec* pRec, const RetainPtr<Retainable>& pDesc);
30 
31   ScopedFXFTFaceRec const m_pRec;
32   RetainPtr<Retainable> const m_pDesc;
33 };
34 
35 #endif  // CORE_FXGE_CFX_FACE_H_
36