moreupdates
[synfig.git] / synfig-core / trunk / src / modules / lyr_freetype / main.cpp
1 /*! ========================================================================
2 ** Synfig
3 ** bleh
4 ** $Id: main.cpp,v 1.1.1.1 2005/01/04 01:23:09 darco Exp $
5 **
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
7 **
8 ** This software and associated documentation
9 ** are CONFIDENTIAL and PROPRIETARY property of
10 ** the above-mentioned copyright holder.
11 **
12 ** You may not copy, print, publish, or in any
13 ** other way distribute this software without
14 ** a prior written agreement with
15 ** the copyright holder.
16 **
17 ** === N O T E S ===========================================================
18 **
19 ** ========================================================================= */
20
21 /* === H E A D E R S ======================================================= */
22
23 #define SYNFIG_MODULE
24
25 #ifdef USING_PCH
26 #       include "pch.h"
27 #else
28 #ifdef HAVE_CONFIG_H
29 #       include <config.h>
30 #endif
31
32 #include <string.h>
33 #include <synfig/module.h>
34 #include "lyr_freetype.h"
35 #include <iostream>
36 #include <ETL/stringf>
37
38 #include <ft2build.h>
39 #include FT_FREETYPE_H
40
41 #endif
42
43 using namespace etl;
44 using namespace std;
45 using namespace synfig;
46
47 FT_Library  ft_library;
48
49 /* === E N T R Y P O I N T ================================================= */
50
51 bool freetype_constructor(synfig::ProgressCallback *cb)
52 {
53         int error;
54         if(cb)cb->task("Initializing FreeType...");
55         if ( (error = FT_Init_FreeType( &ft_library )) )
56         {
57                 if(cb)cb->error(strprintf("lyr_freetype: FreeType initialization failed. (err=%d)",error));
58                 return false;
59         }
60         return true;
61 }
62
63 void freetype_destructor()
64 {
65         std::cerr<<"freetype_destructor()"<<std::endl;
66 }
67
68 /* === E N T R Y P O I N T ================================================= */
69
70 MODULE_DESC_BEGIN(liblyr_freetype)
71         MODULE_NAME("FreeType Font Layer")
72         MODULE_DESCRIPTION("Provides a font rendering layer via FreeType")
73         MODULE_AUTHOR("Robert B. Quattlebaum")
74         MODULE_VERSION("1.0")
75         MODULE_COPYRIGHT(SYNFIG_COPYRIGHT)
76
77         MODULE_CONSTRUCTOR(freetype_constructor)
78         MODULE_DESTRUCTOR(freetype_destructor)
79 MODULE_DESC_END
80
81 MODULE_INVENTORY_BEGIN(liblyr_freetype)
82         BEGIN_LAYERS
83                 LAYER(lyr_freetype)
84                 LAYER_ALIAS(lyr_freetype,"Text")
85         END_LAYERS
86 MODULE_INVENTORY_END