File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11/*
22 libSDL2pp - C++11 bindings/wrapper for SDL2
3- Copyright (C) 2014 Dmitry Marakasov <amdmi3@amdmi3.ru>
3+ Copyright (C) 2014-2015 Dmitry Marakasov <amdmi3@amdmi3.ru>
44
55 This software is provided 'as-is', without any express or implied
66 warranty. In no event will the authors be held liable for any damages
2727
2828namespace SDL2pp {
2929
30+ Font::Font (TTF_Font* font) {
31+ font_ = font;
32+ }
33+
3034Font::Font (const std::string& file, int ptsize, long index) {
3135 if ((font_ = TTF_OpenFontIndex (file.c_str (), ptsize, index)) == nullptr )
3236 throw Exception (" TTF_OpenFontIndex failed" );
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ private:
4949 TTF_Font* font_; // /< Managed TTF_Font object
5050
5151public:
52+ // //////////////////////////////////////////////////////////
53+ // / \brief Construct from existing TTF_Font structure
54+ // /
55+ // / \param font Existing TTF_Font to manage
56+ // /
57+ // //////////////////////////////////////////////////////////
58+ Font (TTF_Font* font);
59+
5260 // //////////////////////////////////////////////////////////
5361 // / \brief Loads font from .ttf or .fon file
5462 // /
You can’t perform that action at this time.
0 commit comments