diff options
author | San Jacobs | 2023-10-13 18:47:06 +0200 |
---|---|---|
committer | San Jacobs | 2023-10-13 18:47:06 +0200 |
commit | a8ae49ea33b9575597012cb5b3927583184c4c73 (patch) | |
tree | 4058b138d569062bfb7fc6fe7bb6355696ca254e /src/main.odin | |
parent | a32fc0f0f6bf3acc18e03fb436564cc135717157 (diff) | |
download | satscalc-a8ae49ea33b9575597012cb5b3927583184c4c73.tar.gz satscalc-a8ae49ea33b9575597012cb5b3927583184c4c73.tar.bz2 satscalc-a8ae49ea33b9575597012cb5b3927583184c4c73.zip |
Fonts are now embedded in the program
Diffstat (limited to 'src/main.odin')
-rw-r--r-- | src/main.odin | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main.odin b/src/main.odin index 96a56d5..1ae20c6 100644 --- a/src/main.odin +++ b/src/main.odin @@ -70,16 +70,18 @@ main :: proc() { // Loading fonts - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - font_size :: 18 - //font: Font = LoadFontFromMemory("ttf", &UBUNTU_MONO, i32(len(UBUNTU_MONO)), font_size, nil, 0) - font: Font = LoadFontEx("res/UbuntuMono-Regular.ttf", font_size, nil, 0) + font: Font = LoadFontFromMemory(".ttf", raw_data(UBUNTU_MONO), i32(len(UBUNTU_MONO)), font_size, nil, 0) + //font: Font = LoadFontEx("res/UbuntuMono-Regular.ttf", font_size, nil, 0) defer UnloadFont(font) small_font_size :: 14 - small_font: Font = LoadFontEx("res/UbuntuMono-Regular.ttf", small_font_size, nil, 0) + small_font: Font = LoadFontFromMemory(".ttf", raw_data(UBUNTU_MONO), i32(len(UBUNTU_MONO)), small_font_size, nil, 0) + //small_font: Font = LoadFontEx("res/UbuntuMono-Regular.ttf", small_font_size, nil, 0) defer UnloadFont(small_font) big_font_size :: 24 - big_font: Font = LoadFontEx("res/UbuntuMono-Regular.ttf", big_font_size, nil, 0) + big_font: Font = LoadFontFromMemory(".ttf", raw_data(UBUNTU_MONO), i32(len(UBUNTU_MONO)), big_font_size, nil, 0) + //big_font: Font = LoadFontEx("res/UbuntuMono-Regular.ttf", big_font_size, nil, 0) defer UnloadFont(big_font) // oui stuff @@ -150,7 +152,7 @@ when true { oui.set_height(top_bar, 30) oui.item_insert(master_container, top_bar) - date_label := label("Date abcg", big_font) + date_label := label("Date abcg", font) oui.item_insert(top_bar, date_label) bottom_bar := panel(PBGCOLOR) @@ -234,4 +236,3 @@ when true { EndDrawing() } } - |