From a5209153cf8df1cd58c2f70f9eabb0bf5dd071f8 Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Sun, 1 Feb 2026 12:07:18 +0000 Subject: fonts --- fonts/Atkinson/info.txt | 68 +++++++++++++++++++++ .../mono/AtkinsonHyperlegibleMono-Bold.otf | Bin 0 -> 33148 bytes .../mono/AtkinsonHyperlegibleMono-BoldItalic.otf | Bin 0 -> 33688 bytes .../mono/AtkinsonHyperlegibleMono-Regular.otf | Bin 0 -> 31624 bytes .../AtkinsonHyperlegibleMono-RegularItalic.otf | Bin 0 -> 32840 bytes .../regular/AtkinsonHyperlegibleNext-Bold.otf | Bin 0 -> 45384 bytes .../AtkinsonHyperlegibleNext-BoldItalic.otf | Bin 0 -> 48796 bytes .../regular/AtkinsonHyperlegibleNext-Regular.otf | Bin 0 -> 42916 bytes .../AtkinsonHyperlegibleNext-RegularItalic.otf | Bin 0 -> 47304 bytes fonts/TypeLightSans/TypeLightSans.otf | Bin 0 -> 19636 bytes fonts/TypeLightSans/info.txt | 2 + fonts/UnitBlock/Unitblock.ttf | Bin 0 -> 76092 bytes fonts/UnitBlock/info.txt | 2 + source/all.h | 2 + source/main.c | 8 ++- source/render.c | 4 +- 16 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 fonts/Atkinson/info.txt create mode 100644 fonts/Atkinson/mono/AtkinsonHyperlegibleMono-Bold.otf create mode 100644 fonts/Atkinson/mono/AtkinsonHyperlegibleMono-BoldItalic.otf create mode 100644 fonts/Atkinson/mono/AtkinsonHyperlegibleMono-Regular.otf create mode 100644 fonts/Atkinson/mono/AtkinsonHyperlegibleMono-RegularItalic.otf create mode 100644 fonts/Atkinson/regular/AtkinsonHyperlegibleNext-Bold.otf create mode 100644 fonts/Atkinson/regular/AtkinsonHyperlegibleNext-BoldItalic.otf create mode 100644 fonts/Atkinson/regular/AtkinsonHyperlegibleNext-Regular.otf create mode 100644 fonts/Atkinson/regular/AtkinsonHyperlegibleNext-RegularItalic.otf create mode 100644 fonts/TypeLightSans/TypeLightSans.otf create mode 100644 fonts/TypeLightSans/info.txt create mode 100644 fonts/UnitBlock/Unitblock.ttf create mode 100644 fonts/UnitBlock/info.txt diff --git a/fonts/Atkinson/info.txt b/fonts/Atkinson/info.txt new file mode 100644 index 0000000..2d696c3 --- /dev/null +++ b/fonts/Atkinson/info.txt @@ -0,0 +1,68 @@ +https://www.brailleinstitute.org/freefont + +Copyright 2020, Braille Institute of America, Inc. (https://www.brailleinstitute.org/), with +Reserved Font Names: “ATKINSON” and “HYPERLEGIBLE”. +This Font Software is licensed under the SIL Open Font License, Version 1.1. This +license is copied below, and is also available with a FAQ at: https://openfontlicense.org +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide development of +collaborative font projects, to support the font creation efforts of academic and +linguistic communities, and to provide a free and open framework in which fonts may be +shared and improved in partnership with others. +The OFL allows the licensed fonts to be used, studied, modified and redistributed freely +as long as they are not sold by themselves. The fonts, including any derivative works, +can be bundled, embedded, redistributed and/or sold with any software provided that +any reserved names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The requirement for fonts +to remain under this license does not apply to any document created using the fonts or +their derivatives. +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright Holder under this +license and clearly marked as such. This may include source files, build scripts and +documentation. +"Reserved Font Names" refers to any names specified as such after the copyright +statement. +"Original Version" refers to the collection of Font Software components as distributed by +the Copyright Holder. +"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- +in part or in whole -- any of the components of the Original Version, by changing +formats or by porting the Font Software to a new environment. +"Author" refers to any designer, engineer, programmer, technical writer or other person +who contributed to the Font Software. +PERMISSION & CONDITIONS +VP/#68933639.2 +Permission is hereby granted, free of charge, to any person obtaining a copy of the Font +Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and +unmodified copies of the Font Software, subject to the following conditions: +1) Neither the Font Software nor any of its individual components, in Original or +Modified Versions, may be sold by itself. +2) Original or Modified Versions of the Font Software may be bundled, redistributed +and/or sold with any software, provided that each copy contains the above copyright +notice and this license. These can be included either as stand-alone text files, human- +readable headers or in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. +3) No Modified Version of the Font Software may use the Reserved Font Names unless +explicit written permission is granted by the Copyright Holder. This restriction only +applies to the primary font name as presented to the users. +4) The name of the Copyright Holder or the Author(s) of the Font Software shall not be +used to promote, endorse or advertise any Modified Version, except to acknowledge the +contributions of the Copyright Holder and the Author(s) or with their explicit written +permission. +5) The Font Software, modified or unmodified, in part or in whole, must be distributed +entirely under this license, and must not be distributed under any other license. The +requirement for fonts to remain under this license does not apply to any document +created using the Font Software. +TERMINATION +This license becomes null and void if any of the above conditions are not met. +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO +EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR +CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT +SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. +VP/#68933639.2 diff --git a/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-Bold.otf b/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-Bold.otf new file mode 100644 index 0000000..e092ce8 Binary files /dev/null and b/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-Bold.otf differ diff --git a/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-BoldItalic.otf b/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-BoldItalic.otf new file mode 100644 index 0000000..ac99b71 Binary files /dev/null and b/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-BoldItalic.otf differ diff --git a/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-Regular.otf b/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-Regular.otf new file mode 100644 index 0000000..36c0a22 Binary files /dev/null and b/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-Regular.otf differ diff --git a/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-RegularItalic.otf b/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-RegularItalic.otf new file mode 100644 index 0000000..567aa1f Binary files /dev/null and b/fonts/Atkinson/mono/AtkinsonHyperlegibleMono-RegularItalic.otf differ diff --git a/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-Bold.otf b/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-Bold.otf new file mode 100644 index 0000000..2d10468 Binary files /dev/null and b/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-Bold.otf differ diff --git a/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-BoldItalic.otf b/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-BoldItalic.otf new file mode 100644 index 0000000..6de50d5 Binary files /dev/null and b/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-BoldItalic.otf differ diff --git a/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-Regular.otf b/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-Regular.otf new file mode 100644 index 0000000..ba345b5 Binary files /dev/null and b/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-Regular.otf differ diff --git a/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-RegularItalic.otf b/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-RegularItalic.otf new file mode 100644 index 0000000..49c0897 Binary files /dev/null and b/fonts/Atkinson/regular/AtkinsonHyperlegibleNext-RegularItalic.otf differ diff --git a/fonts/TypeLightSans/TypeLightSans.otf b/fonts/TypeLightSans/TypeLightSans.otf new file mode 100644 index 0000000..670e3b7 Binary files /dev/null and b/fonts/TypeLightSans/TypeLightSans.otf differ diff --git a/fonts/TypeLightSans/info.txt b/fonts/TypeLightSans/info.txt new file mode 100644 index 0000000..116e91d --- /dev/null +++ b/fonts/TypeLightSans/info.txt @@ -0,0 +1,2 @@ +license: Public Domain +link: https://www.fontspace.com/type-light-sans-font-f135100 \ No newline at end of file diff --git a/fonts/UnitBlock/Unitblock.ttf b/fonts/UnitBlock/Unitblock.ttf new file mode 100644 index 0000000..be3872e Binary files /dev/null and b/fonts/UnitBlock/Unitblock.ttf differ diff --git a/fonts/UnitBlock/info.txt b/fonts/UnitBlock/info.txt new file mode 100644 index 0000000..22e3606 --- /dev/null +++ b/fonts/UnitBlock/info.txt @@ -0,0 +1,2 @@ +license: Public Domain +link: https://www.fontspace.com/unitblock-font-f104834 \ No newline at end of file diff --git a/source/all.h b/source/all.h index b8f13bd..9d97653 100644 --- a/source/all.h +++ b/source/all.h @@ -9,6 +9,8 @@ #define TEXT_BUFFER_LIMIT (1<<12) #define FRAME_LIMIT (1<<4) +#define MIN(a,b) (a)<(b)?(a):(b) + typedef struct { Font font; float frame_x[FRAME_LIMIT]; diff --git a/source/main.c b/source/main.c index 1cf3c55..c775851 100644 --- a/source/main.c +++ b/source/main.c @@ -29,7 +29,8 @@ int main (int count, char ** arguments) InitAudioDevice(); SetWindowPosition(0, 0); } - game->font = GetFontDefault(); + game->font = LoadFont("fonts/Atkinson/mono/AtkinsonHyperlegibleMono-Bold.otf"); + if (!IsFontValid(game->font)) { game->font = GetFontDefault(); } /* :todo ping me I'll update this to a u/f seperated game loop */ { /* loop to end all loops */ @@ -41,6 +42,8 @@ int main (int count, char ** arguments) clock_gettime(CLOCK_MONOTONIC, &start); ClearWindowState(FLAG_WINDOW_HIDDEN); + int test[200*200] = {0}; + for (int i = 0; i < 200*200; i++) { test[i] = i;} while (1) { if (delta > wait) { clock_gettime(CLOCK_MONOTONIC, &start); @@ -62,7 +65,7 @@ int main (int count, char ** arguments) { /* draw */ BeginDrawing(); ClearBackground(BLACK); - draw_square_grid(game, 0, 50, NULL, (int[]) {1,2,3, 4,5,6, 7,8,9}, 9); + draw_square_grid(game, 0, MIN(game->vertical/20, game->horizontal/25), NULL, test, 200); draw_centered_text(game, 1, 20, WHITE, "Snails are now preparing!"); draw_centered_text(game, 2, 20, WHITE, "Gambling here"); rlDrawRenderBatchActive(); @@ -79,6 +82,7 @@ int main (int count, char ** arguments) } stop: SetWindowState(FLAG_WINDOW_HIDDEN); + UnloadFont(game->font); CloseAudioDevice(); CloseWindow(); return 0; diff --git a/source/render.c b/source/render.c index 3271b99..ef7280e 100644 --- a/source/render.c +++ b/source/render.c @@ -2,10 +2,10 @@ void draw_square_grid(game_t * game, size_t frame, int size, Texture * texture, int * array, size_t length) { (void)texture; + float x = game->frame_x[frame], y = game->frame_y[frame]; float square_length = size; size_t square = floor(sqrt(length)); size_t j, i; - float x = game->frame_x[frame], y = game->frame_y[frame]; for (i = 0; i < square; ++i) { for (j = 0; j < square; ++j) { DrawRectangleV((Vector2){x+i*square_length, y+j*square_length}, @@ -20,11 +20,11 @@ void draw_square_grid(game_t * game, size_t frame, int size, Texture * texture, void draw_centered_text(game_t * game, size_t frame, int font_size, Color color, char * format, ...) { char buffer[TEXT_BUFFER_LIMIT]; + float x = game->frame_x[frame], y = game->frame_y[frame]; va_list ap; va_start(ap, format); vsnprintf(buffer, TEXT_BUFFER_LIMIT, format, ap); va_end(ap); Vector2 v = MeasureTextEx(game->font, buffer, font_size, 1); - float x = game->frame_x[frame], y = game->frame_y[frame]; DrawTextEx(game->font, buffer, (Vector2){x-v.x/2, y-v.y/2}, font_size, 1, color); } -- cgit v1.2.3