@@ -370,10 +370,10 @@ static string linuxFontPathByName(const string & fontname){
370370#endif
371371
372372// -----------------------------------------------------------
373- // FIXME: it makes no sense to have _fontname and filename if filename will be rewritten inside this function
374- static bool loadFontFace (const of::filesystem::path& _fontname, FT_Face & face, of::filesystem::path & filename, int index){
373+ // FIXME: it seems first parameter is string because it represents the font name only
374+ static bool loadFontFace (const of::filesystem::path & _fontname, FT_Face & face, of::filesystem::path & filename, int index){
375375 auto fontname = _fontname;
376- filename = ofToDataPathFS (_fontname,true );
376+ filename = ofToDataPathFS (_fontname, true );
377377 int fontID = index;
378378 if (!of::filesystem::exists (filename)){
379379#ifdef TARGET_LINUX
@@ -403,7 +403,7 @@ static bool loadFontFace(const of::filesystem::path& _fontname, FT_Face & face,
403403 fontname = " Courier New" ;
404404 }
405405 // FIXME: fs::path in input and output
406- filename = winFontPathByName (fontname. string ( ));
406+ filename = winFontPathByName (ofPathToString (fontname ));
407407#endif
408408 if (filename == " " ){
409409 ofLogError (" ofTrueTypeFont" ) << " loadFontFace(): couldn't find font " << fontname;
@@ -412,7 +412,7 @@ static bool loadFontFace(const of::filesystem::path& _fontname, FT_Face & face,
412412 ofLogVerbose (" ofTrueTypeFont" ) << " loadFontFace(): " << fontname << " not a file in data loading system font from " << filename;
413413 }
414414 FT_Error err;
415- err = FT_New_Face ( library, filename. string ( ).c_str (), fontID, &face );
415+ err = FT_New_Face ( library, ofPathToString (filename ).c_str (), fontID, &face );
416416 if (err) {
417417 // simple error table in lieu of full table (see fterrors.h)
418418 string errorString = " unknown freetype" ;
0 commit comments