diff options
| author | andromeda <andromeda@lenovo> | 2026-04-29 15:24:51 +0200 |
|---|---|---|
| committer | andromeda <andromeda@lenovo> | 2026-04-29 15:24:51 +0200 |
| commit | 18a4a99332b116ec1f094caa41616d4f17686435 (patch) | |
| tree | d684580498c206adb536e51683a939331b8f3e16 | |
| parent | 9a23671a55b4d8841154c18346ec3b8a9d5d3736 (diff) | |
embed Miracode
| -rw-r--r-- | COMICSANS.ttf | bin | 135484 -> 0 bytes | |||
| -rw-r--r-- | Miracode.ttf | bin | 0 -> 298920 bytes | |||
| -rw-r--r-- | main.c3 | 13 |
3 files changed, 10 insertions, 3 deletions
diff --git a/COMICSANS.ttf b/COMICSANS.ttf Binary files differdeleted file mode 100644 index 831e3d8..0000000 --- a/COMICSANS.ttf +++ /dev/null diff --git a/Miracode.ttf b/Miracode.ttf Binary files differnew file mode 100644 index 0000000..c366203 --- /dev/null +++ b/Miracode.ttf @@ -1,7 +1,12 @@ /* * -* Copyright (C) Andromeda 2026 -* ported from <https://github.com/ColleagueRiley/RSGL/blob/main/examples/basics/rfont.c> +* Copyright (C) 2026 andromeda +* +* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. * */ @@ -15,6 +20,8 @@ import libc::termios; faultdef FAIL_OPENPTY, FAIL_FORK; +char[*] font_data = $embed("Miracode.ttf"); + fn Window* init() { GlHints* hints = rgfw::getGlobalHints(); @@ -57,7 +64,7 @@ fn int main(String[] args) rsgl::renderer_updateSize(renderer, 500, 500); rfont::Renderer* renderer_rfont = rsgl::rfont::renderer_init(renderer); - Font* font = rfont::font_init(renderer_rfont, "COMICSANS.ttf", 60, 500, 500); + Font* font = rfont::font_init_data(renderer_rfont, &font_data, 60, 500, 500); int w; int h; |
