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

FontMgr.H

Go to the documentation of this file.
00001 /**************************************************************
00002  *  Name: Sascha Becker (sab)
00003  *  File: FontMgr.H
00004  *  Asgn: cavewriting
00005  *  Date: Sat Feb  5 11:18:26 EST 2005
00006  **************************************************************/
00007 
00008 #ifndef FontMgr_Header
00009 #define FontMgr_Header
00010 
00011 // XXX - Needs to be included first. ??
00012 #include <IS3D.H>
00013 
00014 #include <FTGLExtrdFont.h>
00015 #include <FTGLOutlineFont.h>
00016 #include <FTGLPolygonFont.h>
00017 #include <FTGLTextureFont.h>
00018 #include <FTGLPixmapFont.h>
00019 #include <FTGLBitmapFont.h>
00020 #include <FTGlyph.h>
00021 #include <FTVectoriser.h>
00022 #include <FTPoint.h>
00023 
00024 
00025 
00026 
00027 namespace cavewriting {
00028 
00029   class NiceExtrudedFont : public FTFont
00030   {
00031   public:
00032     NiceExtrudedFont( const std::string& filename );
00033 
00034   protected:
00035     
00036     virtual FTGlyph* MakeGlyph( unsigned int glyphIdx );
00037     
00038   };
00039 
00040   class NiceExtrudedGlyph : public FTGlyph
00041   {
00042   public:
00043     NiceExtrudedGlyph( FT_GlyphSlot glyph );
00044     virtual ~NiceExtrudedGlyph();
00045     virtual const FTPoint& Render( const FTPoint& pen );
00046   
00047   private:
00048     void   buildVAR();
00049     size_t requiredVARSize();
00050     
00057     inline int            numSegments()                      const;
00058     inline int            numVerticesInSegment( int segIdx ) const;
00059     const Array<Vector3>& verticesForSeg      ( int segIdx ) const;
00060     const Array<Vector3>& normalsForSeg       ( int segIdx ) const;
00061     const Array<Vector2>& texcoordForSeg      ( int segIdx ) const;
00062     
00063     Array< Array<Vector3> >              _vertices, _normals;
00064     Array< Array<Vector2> >              _texCoords;
00065     
00066     //Array< Array<int> >                  _indices;       // For each array of indices there
00067     //Array< Array<int>
00068     Array< RenderDevice::Primitive >     _primitiveType; // is a primitive type to draw. 
00069     
00070     
00071     static VARAreaRef                    _glyphVARArea;
00072     VAR                                 *_verticesVAR, *_normalsVAR, *_texCoordsVAR;
00073   
00074     int                                  _num_segments;
00075     int                                 *_num_vertices_in_segments; // for faster lookups
00076   };
00077 
00078 class FontMgr {
00079 
00080 public:
00081   static FontMgr* instance(); 
00082   static FTFont* getDefaultFont();
00083 
00084   FontMgr();
00085   virtual ~FontMgr();
00086 
00087 protected:
00088   FTFont* _defaultFont; 
00089   static FontMgr* _instance; 
00090 
00091 private:
00092 
00093 };
00094 }
00095 
00096 #endif

Generated on Sun Apr 17 13:34:27 2005 for cavewriting by  doxygen 1.4.0