305c9c207bec2a56036ff8b1d96fc6199e632688
[occt.git] / src / Font / Font_FTLibrary.hxx
1 // Created on: 2013-01-28
2 // Created by: Kirill GAVRILOV
3 // Copyright (c) 2013-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _Font_FTLibrary_H__
17 #define _Font_FTLibrary_H__
18
19 #include <Standard_DefineHandle.hxx>
20 #include <Standard_Transient.hxx>
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.
27 class Font_FTLibrary : public Standard_Transient
28 {
29
30 public:
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
51 private:
52
53   FT_Library myFTLib;
54
55 private:
56
57   Font_FTLibrary            (const Font_FTLibrary& );
58   Font_FTLibrary& operator= (const Font_FTLibrary& );
59
60 public:
61
62   DEFINE_STANDARD_RTTI(Font_FTLibrary) // Type definition
63
64 };
65
66 DEFINE_STANDARD_HANDLE(Font_FTLibrary, Standard_Transient)
67
68 #endif // _Font_FTLibrary_H__