Loading fonts is done

This commit is contained in:
2023-06-10 12:01:14 -07:00
parent 1af1f9ef14
commit 86bca79768
12 changed files with 171 additions and 391 deletions

View File

@@ -9,12 +9,17 @@ using namespace Dawn;
NewTrueTypeFile::NewTrueTypeFile(std::string path) : file(path) {
this->path = path;
// Remove extension
size_t pos = path.find_last_of(".");
std::string filename = path.substr(0, pos);
style = 0;
if(path.find("bold") != std::string::npos) {
if(path.find("bold") != std::string::npos || filename.ends_with("bd") || filename.ends_with("bi")) {
style |= NEW_TRUETYPE_VARIANT_BOLD;
}
if(path.find("italics") != std::string::npos) {
if(path.find("italics") != std::string::npos || filename.ends_with("i") || filename.ends_with("bi")) {
style |= NEW_TRUETYPE_VARIANT_ITALICS;
}