From 8824908b696278f34891d95c15e519710ea0d18d Mon Sep 17 00:00:00 2001 From: talha Date: Fri, 21 Jun 2024 00:33:35 +0500 Subject: Setup font loading on linux --- assets/fonts/Roboto.ttf | Bin 0 -> 168260 bytes build.sh | 2 +- libs/freetype/libfreetype.so | Bin 0 -> 3467256 bytes source/main.cpp | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 assets/fonts/Roboto.ttf create mode 100755 libs/freetype/libfreetype.so diff --git a/assets/fonts/Roboto.ttf b/assets/fonts/Roboto.ttf new file mode 100644 index 0000000..ddf4bfa Binary files /dev/null and b/assets/fonts/Roboto.ttf differ diff --git a/build.sh b/build.sh index 4e11e85..d4ce93c 100755 --- a/build.sh +++ b/build.sh @@ -11,7 +11,7 @@ include_opts="-I $include_path" files="source/main.cpp $include_path/glad/glad.c" build_opts="$build_dir/main" -lib_path="lib/SDL2" +lib_path="libs/SDL2 libs/freetype/libfreetype.so" link_opts="-L $lib_path -lSDL2" build_command="clang++ -std=c++11 -g -Og $include_opts $files $link_opts -o $build_opts" diff --git a/libs/freetype/libfreetype.so b/libs/freetype/libfreetype.so new file mode 100755 index 0000000..89774b8 Binary files /dev/null and b/libs/freetype/libfreetype.so differ diff --git a/source/main.cpp b/source/main.cpp index 6df5451..3458820 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -378,7 +378,7 @@ int main(int argc, char* argv[]) return -1; } - FT_Error error = FT_New_Face(ft_lib, "assets/fonts/Arial.ttf", 0, &face); + FT_Error error = FT_New_Face(ft_lib, "assets/fonts/Roboto.ttf", 0, &face); if (error == FT_Err_Unknown_File_Format) { printf("Error: Font Loading Failed. The font format is unsupported.\n"); -- cgit v1.2.3