Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGTextFT2Backend.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _OSGTEXTFT2BACKEND_H_
00040 #define _OSGTEXTFT2BACKEND_H_
00041 
00042 #ifdef _MSC_VER
00043 # pragma once
00044 #endif
00045 
00046 
00047 #include <OSGConfig.h>
00048 #include <OSGSystemDef.h>
00049 
00050 
00051 #ifdef FT2_LIB
00052 
00053 
00054 #include "OSGTextBackend.h"
00055 #ifndef FONTCONFIG_LIB
00056 # include <map>
00057 #endif
00058 #include <ft2build.h>
00059 #include FT_FREETYPE_H
00060 #include <string>
00061 
00062 
00063 OSG_BEGIN_NAMESPACE
00064 
00065 
00073 class OSG_SYSTEMLIB_DLLMAPPING TextFT2Backend: public TextBackend
00074 {
00075     /*==========================  PUBLIC  =================================*/
00076   public:
00077 
00079     TextFT2Backend();
00080 
00082     virtual ~TextFT2Backend();
00083 
00090     virtual TextVectorFace*
00091     createVectorFace(const std::string &family, TextFace::Style style);
00092 
00100     virtual TextPixmapFace*
00101     createPixmapFace(const std::string &family, TextFace::Style style, UInt32 size);
00102 
00111     virtual TextTXFFace*
00112     createTXFFace(const std::string &family, TextFace::Style style, const TextTXFParam &param);
00113 
00119     virtual void getFontFamilies(std::vector<std::string> &families);
00120 
00121     /*==========================  PRIVATE  ================================*/
00122   private:
00123 
00125     TextFT2Backend(const TextFT2Backend &);
00126 
00128     const TextFT2Backend &operator=(const TextFT2Backend &);
00129 
00131     bool findPath(const std::string &family, TextFace::Style style, std::string &path, int &index);
00132 
00134     FT_Face createFace(const std::string &family, TextFace::Style style, FT_UInt size);
00135 
00137     FT_Library _library;
00138 
00139 #ifndef FONTCONFIG_LIB
00140 
00142     std::string _pathList;
00143 
00145     bool _scanForFonts;
00146 
00148     typedef struct
00149     {
00150         std::string path;
00151         int index;
00152         TextFace::Style style;
00153     }
00154     FontInfo;
00155 
00157     typedef std::multimap<std::string, FontInfo> FontMap;
00158 
00160     FontMap _fontMap;
00161 
00163     void scanForFonts();
00164 
00169     void scanDir(const std::string &path);
00170 
00175     void checkFile(const std::string &fullname);
00176 
00177 #endif // !FONTCONFIG_LIB
00178 
00179 };
00180 
00181 
00182 OSG_END_NAMESPACE
00183 
00184 
00185 #endif // FT2_LIB
00186 
00187 
00188 #include <OSGTextFT2Backend.inl>
00189 
00190 #define OSGTEXTFT2BACKEND_HEADER_CVSID "@(#)$Id: OSGTextFT2Backend.h,v 1.1 2005/03/03 13:43:06 a-m-z Exp $"
00191 
00192 #endif /* _OSGTEXTFT2BACKEND_H_ */

Generated on Thu Aug 25 04:11:18 2005 for OpenSG by  doxygen 1.4.3