75 lines
2.2 KiB
Plaintext
75 lines
2.2 KiB
Plaintext
#ifndef _CFONT_HPP_
|
|
#define _CFONT_HPP_
|
|
|
|
/*** ANSI C++ Header Files ***/
|
|
#include <vector>
|
|
|
|
/*** SDL Header Files ***/
|
|
#include <SDL.h>
|
|
#include <SDL_ttf.h>
|
|
|
|
/*** TextTypeHelpers ***/
|
|
#include "TextTypeHelpers/cFontHolder.hpp"
|
|
|
|
/*** DLL Header File ***/
|
|
#include "dllExport.h"
|
|
|
|
/*** Custom Header Files ***/
|
|
#include "../UtilityEngine/cString.hpp"
|
|
|
|
using UtilityEngine::cString;
|
|
|
|
/*#pragma warning (disable : 4231)*/
|
|
EXPIMP_TEMPLATE template class EXPORT_FROM_MYDLL std::allocator<TextTypeHelpers::cFontHolder*>;
|
|
EXPIMP_TEMPLATE template class EXPORT_FROM_MYDLL std::vector<TextTypeHelpers::cFontHolder*, std::allocator<TextTypeHelpers::cFontHolder*> >;
|
|
/*#pragma warning (default : 4231)*/
|
|
|
|
namespace TextTypeEngine {
|
|
class EXPORT_FROM_MYDLL cFont
|
|
{
|
|
public:
|
|
cFont(const cString& filename = "", const cString& dir = "", const unsigned long int size = 16 );
|
|
cFont( const cFont& copy );
|
|
~cFont();
|
|
|
|
///Functions
|
|
|
|
|
|
///Sets
|
|
/* Sets the Directory of the TTF file */
|
|
void setDir( const cString& dir );
|
|
/* Sets the Filename of the TTF file */
|
|
void setFileName( const cString& filename );
|
|
/* Sets the Filename and Directory of the TTF file */
|
|
void setFileNameandDir( const cString& filename, const cString& dir = "" );
|
|
/* Sets the size of the TTF. Default is 16 */
|
|
void setSize( const unsigned long int size = 16 );
|
|
|
|
///Gets
|
|
/* Gets the Directory of the TTF file */
|
|
const cString& getDir() const;
|
|
/* Gets the Filename of the TTF file */
|
|
const cString& getFileName() const;
|
|
/* Gets the size of the TTF file. */
|
|
const unsigned long int getSize() const;
|
|
/* Gets the TTF_Font. */
|
|
TTF_Font* getFont();
|
|
/* Gets the TTF_Font. */
|
|
TTF_Font* getFont( const unsigned long int size );
|
|
|
|
private:
|
|
TTF_Font* LoadFont( const unsigned long int size );
|
|
TextTypeHelpers::cFontHolder* getFontHolder( const unsigned long int size );
|
|
void UnloadFont();
|
|
|
|
private:
|
|
std::vector<TextTypeHelpers::cFontHolder*> m_fonts;
|
|
//cFontHolder m_fonts;
|
|
//cFont::cFontHolder m_fonts;
|
|
TextTypeHelpers::cFontHolder** mpp_default;
|
|
cString m_dir;// = ""
|
|
cString m_fileName;// = ""
|
|
|
|
};/// END CLASS DEFINITION cFont
|
|
}/// END NAMESPACE DEFINITION TextTypeEngine
|
|
#endif/// END IFNDEF _CFONT_HPP_ |