Loading fonts is done
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user