Browse Source

fix path typo

master
Odilitime 5 years ago
parent
commit
d7e5278ebe
  1. 11
      src/graphics/text/TextRasterizer.cpp

11
src/graphics/text/TextRasterizer.cpp

@ -11,9 +11,14 @@ TextRasterizer::TextRasterizer(const std::string &fontPath, const int size, cons @@ -11,9 +11,14 @@ TextRasterizer::TextRasterizer(const std::string &fontPath, const int size, cons
FT_Init_FreeType(&lib);
face = std::make_unique<FT_Face>();
std::string path = Environment::getResourceDir() + "/" + fontPath;
if (FT_New_Face(lib, bold ? (path.substr(0, fontPath.length() - 4) + "-Bold.ttf").c_str() : path.c_str(), 0, face.get())) {
std::cout << "Could not open font" << std::endl;
std::string path = Environment::getResourceDir() + "/" + fontPath;
//std::cout << "font path [" << path << "]" << std::endl;
if (bold) {
path = path.substr(0, path.length() -4) + "-Bold.ttf";
}
//std::cout << "font path [" << path << "]" << std::endl;
if (FT_New_Face(lib, path.c_str(), 0, face.get())) {
std::cout << "Could not open font, bold: " << bold << std::endl;
return;
}
if (!isUnicodeBMP(*face)) {

Loading…
Cancel
Save