2020-11-21 19:57:40 +00:00
|
|
|
#ifndef SDLPP_HPP_FONT
|
|
|
|
#define SDLPP_HPP_FONT
|
|
|
|
|
|
|
|
#include "sdlpp_common.hpp"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
namespace SDLPP {
|
2020-11-22 22:37:55 +00:00
|
|
|
class SDLPPSCOPE Font {
|
2020-11-21 19:57:40 +00:00
|
|
|
public:
|
|
|
|
Font() = delete;
|
2020-12-18 14:08:21 +00:00
|
|
|
Font( const std::string &font );
|
2020-11-21 19:57:40 +00:00
|
|
|
Font( const std::string &font, int size );
|
|
|
|
virtual ~Font();
|
|
|
|
const TTF_Font *getFont() const;
|
|
|
|
TTF_Font *getFont();
|
|
|
|
void setOutline( int size );
|
|
|
|
int getOutline();
|
|
|
|
void setStyle( int style );
|
|
|
|
void setHinting( int hinting );
|
2020-12-18 14:08:21 +00:00
|
|
|
void changeFontSize( int size );
|
|
|
|
void revertSize();
|
2020-11-21 19:57:40 +00:00
|
|
|
|
|
|
|
private:
|
2020-12-18 14:08:21 +00:00
|
|
|
void closeFont();
|
|
|
|
void checkFont();
|
|
|
|
|
2020-11-21 19:57:40 +00:00
|
|
|
TTF_Font *font_ptr;
|
2020-12-18 14:08:21 +00:00
|
|
|
const std::string font_path;
|
|
|
|
int original_size = -1;
|
2020-11-21 19:57:40 +00:00
|
|
|
};
|
|
|
|
} // namespace SDLPP
|
|
|
|
#endif
|