[Part][Draft]fix #8271 temporary files on windows

This commit is contained in:
wandererfan
2023-01-26 18:25:37 -08:00
committed by WandererFan
parent 774dc5ce81
commit 80da187cd7
2 changed files with 34 additions and 42 deletions

View File

@@ -2062,19 +2062,7 @@ private:
try {
if (useFontSpec) {
#ifdef FC_OS_WIN32
// Windows doesn't do Utf8 by default and FreeType doesn't do wchar.
// this is a hacky work around.
// copy fontspec to Ascii temp name
std::string tempFile = Base::FileInfo::getTempFileName(); //utf8/ascii
Base::FileInfo fiIn(fontspec);
fiIn.copyTo(tempFile.c_str());
CharList = FT2FC(unichars,pysize,tempFile.c_str(),height,track);
Base::FileInfo fiTemp(tempFile);
fiTemp.deleteFile();
#else
CharList = FT2FC(unichars,pysize,fontspec,height,track);
#endif
}
else {
CharList = FT2FC(unichars,pysize,dir,fontfile,height,track);