0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / Font / Font_FTLibrary.hxx
CommitLineData
a174a3c5 1// Created on: 2013-01-28
2// Created by: Kirill GAVRILOV
d5f74e42 3// Copyright (c) 2013-2014 OPEN CASCADE SAS
a174a3c5 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
a174a3c5 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
a174a3c5 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
a174a3c5 15
16#ifndef _Font_FTLibrary_H__
17#define _Font_FTLibrary_H__
18
ec357c5c 19#include <Standard_Type.hxx>
a174a3c5 20#include <Standard_Transient.hxx>
a174a3c5 21
22// inclusion template for FreeType
23#include <ft2build.h>
24#include FT_FREETYPE_H
25
26//! Wrapper over FT_Library. Provides access to FreeType library.
27class Font_FTLibrary : public Standard_Transient
28{
29
30public:
31
32 //! Initialize new FT_Library instance.
33 Standard_EXPORT Font_FTLibrary();
34
35 //! Release FT_Library instance.
36 Standard_EXPORT ~Font_FTLibrary();
37
38 //! This method should always return true.
39 //! @return true if FT_Library instance is valid.
40 bool IsValid() const
41 {
42 return myFTLib != NULL;
43 }
44
45 //! Access FT_Library instance.
46 FT_Library Instance() const
47 {
48 return myFTLib;
49 }
50
51private:
52
53 FT_Library myFTLib;
54
55private:
56
57 Font_FTLibrary (const Font_FTLibrary& );
58 Font_FTLibrary& operator= (const Font_FTLibrary& );
59
60public:
61
ec357c5c 62 DEFINE_STANDARD_RTTI(Font_FTLibrary, Standard_Transient) // Type definition
a174a3c5 63
64};
65
66DEFINE_STANDARD_HANDLE(Font_FTLibrary, Standard_Transient)
67
68#endif // _Font_FTLibrary_H__