Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

cybfontmanagerc.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 1999-2003  Carsten Winkelholz, Malte Weiß
00003 
00004 Malte Weiß, 09.04.2003: - A folder is specified by user to locate all font files.
00005                         - CybFontManagerC is now responsible for the entire font metric.
00006                           GetTextSize uses external .MET files (created by 'FontMetric') to
00007                           determine the size of each glyph.
00008                         - Added some helper functions (GetFontName, GetFontFilename etc.).
00009             10.04.2003: - GetFontMetric is now responsible for loading metrics.
00010 
00011 Address:  FGAN Forschungsgesellschaft fr Angewandte Naturwissenschaften e. V.
00012       Neuenahrer Str. 20
00013       D - 53343 Wachtberg
00014       
00015 Email:    winkelholz@fgan.de
00016 
00017 This program is free software; you can redistribute it and/or
00018 modify it under the terms of the GNU General Public License
00019 as published by the Free Software Foundation; either version 2
00020 of the License, or (at your option) any later version.
00021 
00022 This program is distributed in the hope that it will be useful,
00023 but WITHOUT ANY WARRANTY; without even the implied warranty of
00024 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025 GNU General Public Licensefor more details.
00026 
00027 You should have received a copy of the GNU General Public License
00028 along with this program; if not, write to the Free Software
00029 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00030 */
00031 
00032 #ifndef CYBFONTMANAGERC_H
00033 #define CYBFONTMANAGERC_H
00034 
00035 //#include <GL/glut.h>
00036 
00037 #include "oaw/misc/stringc.h"
00038 #include "oaw/misc/arrayc.h"
00039 
00040 #include "../oawconfig.h"
00041 
00042 OAW_BEGIN_NAMESPACE
00043 
00044 
00045 // Global function
00046 
00047 class _3DFont{
00048 public:
00049   virtual void Render(const char*,long) = 0;
00050 };
00051 
00052 OAW_DLLMAPPING void SetFontFolder(const char *pFolder);
00053 OAW_DLLMAPPING const char *GetFontFolder();
00054 
00055 // Class definition
00056 
00057 struct FontInfo {
00058     _3DFont* pFont;
00059     StringC fileName, fontName;
00060 };
00061 
00062 struct FontMetric {
00063     StringC fontName;
00064     double glyphWidths[256];
00065 };
00066 
00067 class OAW_DLLMAPPING CybFontManagerC {
00068 public:
00069   CybFontManagerC();
00070   virtual ~CybFontManagerC();
00071 
00072   StringC GetFontName(const char* pFontName, const char* pStyle);
00073   StringC GetFontFilename(const char* pFontName, const char* pStyle);
00074 
00075   virtual _3DFont *RetrieveFont(const char* pFontName, const char* pStyle)      { return NULL; }
00076   virtual FontMetric    *GetFontMetric(const char* pFontName, const char* pStyle);
00077   virtual void           GetTextSize(const char *pText, const char* pFontName, const char* pStyle, double& w, double& h, short bHorizontal);
00078   virtual void           GetTextSizeFromMetric(FontMetric &metric, const char *pText, double& w, double& h, short bHorizontal);
00079 
00080 protected:  
00081   ArrayC<FontInfo>    m_fonts;
00082   ArrayC<FontMetric>  m_fontMetrics;
00083 };
00084 
00085 OAW_END_NAMESPACE
00086 
00087 
00088 #endif
00089 

Generated on Tue Jul 29 14:24:10 2003 for Open ActiveWrl by doxygen1.3-rc2