summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortalha <talha@talhaamir.xyz>2024-06-21 00:33:35 +0500
committertalha <talha@talhaamir.xyz>2024-06-21 00:33:35 +0500
commit8824908b696278f34891d95c15e519710ea0d18d (patch)
treef08522791a6ec89b531317c5ad3b551cca9c3e74
parentba43db84ce7e80449c505c1381b33786cc047131 (diff)
Setup font loading on linux
-rw-r--r--assets/fonts/Roboto.ttfbin0 -> 168260 bytes
-rwxr-xr-xbuild.sh2
-rwxr-xr-xlibs/freetype/libfreetype.sobin0 -> 3467256 bytes
-rw-r--r--source/main.cpp2
4 files changed, 2 insertions, 2 deletions
diff --git a/assets/fonts/Roboto.ttf b/assets/fonts/Roboto.ttf
new file mode 100644
index 0000000..ddf4bfa
--- /dev/null
+++ b/assets/fonts/Roboto.ttf
Binary files 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
--- /dev/null
+++ b/libs/freetype/libfreetype.so
Binary files 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");