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 #ifndef CYBFONTMANAGERC_H
00033 #define CYBFONTMANAGERC_H
00034
00035
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
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
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