00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef _OSGTEXTFACEFACTORY_H_
00040 #define _OSGTEXTFACEFACTORY_H_
00041
00042 #ifdef _MSC_VER
00043 # pragma once
00044 #endif
00045
00046
00047 #include <OSGConfig.h>
00048 #include <OSGSystemDef.h>
00049 #include <OSGBaseTypes.h>
00050
00051 #include "OSGTextFace.h"
00052 #include "OSGTextTXFParam.h"
00053
00054 #include <map>
00055 #include <vector>
00056 #include <string>
00057
00058
00059 OSG_BEGIN_NAMESPACE
00060
00061
00062 class TextBackend;
00063 class TextVectorFace;
00064 class TextPixmapFace;
00065 class TextTXFFace;
00066
00067
00078 class OSG_SYSTEMLIB_DLLMAPPING TextFaceFactory
00079 {
00080
00081 public:
00082
00084 ~TextFaceFactory();
00085
00092 TextVectorFace *createVectorFace(const std::string &family,
00093 TextFace::Style style = TextFace::STYLE_PLAIN);
00094
00102 TextPixmapFace *createPixmapFace(const std::string &family,
00103 TextFace::Style style = TextFace::STYLE_PLAIN,
00104 UInt32 size = 32);
00105
00114 TextTXFFace *createTXFFace(const std::string &family,
00115 TextFace::Style style = TextFace::STYLE_PLAIN,
00116 const TextTXFParam ¶m = TextTXFParam());
00117
00119 void clearCache();
00120
00126 void getFontFamilies(std::vector<std::string> &families) const;
00127
00132 static inline TextFaceFactory &the();
00133
00134
00135 private:
00136
00138 TextFaceFactory();
00139
00141 TextFaceFactory(const TextFaceFactory &);
00142
00144 const TextFaceFactory &operator=(const TextFaceFactory &);
00145
00147 static TextFaceFactory _the;
00148
00150 TextBackend *_backend;
00151
00153 typedef std::multimap<std::string, TextVectorFace*> VectorFaceMap;
00154
00156 VectorFaceMap _vectorFaceMap;
00157
00159 typedef std::multimap<std::string, TextPixmapFace*> PixmapFaceMap;
00160
00162 PixmapFaceMap _pixmapFaceMap;
00163
00165 typedef std::multimap<std::string, TextTXFFace*> TXFFaceMap;
00166
00168 TXFFaceMap _txfFaceMap;
00169 };
00170
00171
00172 OSG_END_NAMESPACE
00173
00174
00175 #include <OSGTextFaceFactory.inl>
00176
00177 #define OSGTEXTFACEFACTORY_HEADER_CVSID "@(#)$Id: OSGTextFaceFactory.h,v 1.1 2005/03/03 13:43:06 a-m-z Exp $"
00178
00179 #endif