For bug 68028

This commit is contained in:
Oleg Korshul
2024-06-02 10:20:52 +03:00
parent bfb97ef026
commit 7a1a59a883
4 changed files with 23 additions and 19 deletions

View File

@ -110,7 +110,9 @@
"_getcwd=getcwd",
"NO_CONSOLE_IO",
"BUILD_ZLIB_AS_SOURCES",
"IMAGE_CHECKER_DISABLE_XML"
"IMAGE_CHECKER_DISABLE_XML",
"BUILDING_WASM_MODULE"
],
"compile_files_array": [
{

View File

@ -1169,6 +1169,7 @@ namespace MetaFile
std::wstring wsFontName = pFont->GetFaceName();
#ifndef BUILDING_WASM_MODULE
if (!wsFontName.empty())
{
NSFonts::CFontSelectFormat oFormat;
@ -1179,6 +1180,7 @@ namespace MetaFile
if (NULL != pFontInfo && !StringEquals(wsFontName, pFontInfo->m_wsFontName))
wsFontName = L"'" + wsFontName + L"', '" + pFontInfo->m_wsFontName + L"'";
}
#endif
if (!wsFontName.empty())
arNodeAttributes.push_back({L"font-family", wsFontName});

View File

@ -283,6 +283,7 @@ namespace MetaFile
std::wstring wsFontName = pFont->GetFaceName();
#ifndef BUILDING_WASM_MODULE
if (!wsFontName.empty())
{
NSFonts::CFontSelectFormat oFormat;
@ -293,6 +294,7 @@ namespace MetaFile
if (NULL != pFontInfo && !StringEquals(wsFontName, pFontInfo->m_wsFontName))
wsFontName = L"'" + wsFontName + L"', '" + pFontInfo->m_wsFontName + L"'";
}
#endif
if (!wsFontName.empty())
arNodeAttributes.push_back({L"font-family", wsFontName});

View File

@ -29,35 +29,33 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//#include <QCoreApplication>
// #include <QCoreApplication>
#include "../../../../fontengine/ApplicationFontsWorker.h"
#include "../../../../graphics/pro/Fonts.h"
#include "../../../../graphics/pro/Graphics.h"
#include "../../../../fontengine/ApplicationFontsWorker.h"
#include "../../../../raster/BgraFrame.h"
#include "../../../../common/Directory.h"
#include "../../../../raster/BgraFrame.h"
int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
// Check system fonts
CApplicationFontsWorker oWorker;
oWorker.m_sDirectory = NSFile::GetProcessDirectory() + L"/fonts_cache";
oWorker.m_bIsNeedThumbnails = false;
// Check system fonts
CApplicationFontsWorker oWorker;
oWorker.m_sDirectory = NSFile::GetProcessDirectory() + L"/fonts_cache";
oWorker.m_bIsNeedThumbnails = false;
if (!NSDirectory::Exists(oWorker.m_sDirectory))
NSDirectory::CreateDirectory(oWorker.m_sDirectory);
if (!NSDirectory::Exists(oWorker.m_sDirectory))
NSDirectory::CreateDirectory(oWorker.m_sDirectory);
NSFonts::IApplicationFonts* pFonts = oWorker.Check();
NSFonts::IApplicationFonts* pFonts = oWorker.Check();
MetaFile::IMetaFile* pMetafile = MetaFile::Create(pFonts);
pMetafile->LoadFromFile(L"PATH_TO_METAFILE");
MetaFile::IMetaFile* pMetafile = MetaFile::Create(pFonts);
pMetafile->LoadFromFile(L"D:/image1.wmf");
std::wstring wsData;
pMetafile->ConvertToSvg(wsData);
std::wstring wsData = pMetafile->ConvertToSvg();
pMetafile->Release();
pFonts->Release();
return 0;
pFonts->Release();
return 0;
}