* A Font that is not managed by C++ RAII. * * Make sure to Unload() this if needed, otherwise use raylib::Font. * * @see raylib::Font */
| 17 | * @see raylib::Font |
| 18 | */ |
| 19 | class FontUnmanaged : public ::Font { |
| 20 | public: |
| 21 | FontUnmanaged( |
| 22 | int baseSize, |
| 23 | int glyphCount, |
| 24 | int glyphPadding, |
| 25 | ::Texture2D texture, |
| 26 | ::Rectangle* recs = nullptr, |
| 27 | ::GlyphInfo* glyphs = nullptr) |
| 28 | : ::Font{baseSize, glyphCount, glyphPadding, texture, recs, glyphs} { |
| 29 | // Nothing. |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Retrieves the default Font. |
| 34 | */ |
| 35 | FontUnmanaged() : ::Font(::GetFontDefault()) {} |
| 36 | |
| 37 | /** |
| 38 | * Creates a FontUnmanaged from an existing Font struct. |
| 39 | */ |
| 40 | FontUnmanaged(const ::Font& font) : ::Font(font) {} |
| 41 | |
| 42 | /** |
| 43 | * Loads a Font from the given file. |
| 44 | * |
| 45 | * @throws raylib::RaylibException Throws if the given font failed to initialize. |
| 46 | */ |
| 47 | FontUnmanaged(const std::string& fileName) { Load(fileName); } |
| 48 | |
| 49 | /** |
| 50 | * Loads a Font from the given file, with generation parameters. |
| 51 | * |
| 52 | * @throws raylib::RaylibException Throws if the given font failed to initialize. |
| 53 | */ |
| 54 | FontUnmanaged(const std::string& fileName, int fontSize, const int* codepoints = nullptr, int codepointCount = 0) { |
| 55 | Load(fileName, fontSize, codepoints, codepointCount); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Loads a Font from the given image with a color key. |
| 60 | * |
| 61 | * @throws raylib::RaylibException Throws if the given font failed to initialize. |
| 62 | */ |
| 63 | FontUnmanaged(const ::Image& image, ::Color key, int firstChar) { Load(image, key, firstChar); } |
| 64 | |
| 65 | /** |
| 66 | * Loads a font from memory, based on the given file type and file data. |
| 67 | * |
| 68 | * @throws raylib::RaylibException Throws if the given font failed to initialize. |
| 69 | */ |
| 70 | FontUnmanaged( |
| 71 | const std::string& fileType, |
| 72 | const unsigned char* fileData, |
| 73 | int dataSize, |
| 74 | int fontSize, |
| 75 | const int* codepoints, |
| 76 | int codepointCount) { |
nothing calls this directly
no outgoing calls
no test coverage detected