mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
doctrenderer builds
This commit is contained in:
@ -759,8 +759,8 @@ namespace NSDoctRenderer
|
||||
|
||||
if (!bIsEqual || bIsCheckSystemFonts)
|
||||
{
|
||||
CApplicationFonts oApplicationF;
|
||||
std::vector<std::wstring> strFontsW_Cur = oApplicationF.GetSetupFontFiles();
|
||||
NSFonts::IApplicationFonts* pApplicationF;
|
||||
std::vector<std::wstring> strFontsW_Cur = pApplicationF->GetSetupFontFiles();
|
||||
|
||||
if (strFonts.size() != strFontsW_Cur.size())
|
||||
bIsEqual = false;
|
||||
@ -798,9 +798,11 @@ namespace NSDoctRenderer
|
||||
}
|
||||
oFile.CloseFile();
|
||||
|
||||
oApplicationF.InitializeFromArrayFiles(strFontsW_Cur, 2);
|
||||
NSCommon::SaveAllFontsJS(oApplicationF, strAllFontsJSPath, L"", strFontsSelectionBin);
|
||||
pApplicationF->InitializeFromArrayFiles(strFontsW_Cur, 2);
|
||||
NSCommon::SaveAllFontsJS(pApplicationF, strAllFontsJSPath, L"", strFontsSelectionBin);
|
||||
}
|
||||
|
||||
RELEASEOBJECT(pApplicationF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -16,11 +16,9 @@ CORE_ROOT_DIR = $$PWD/../..
|
||||
PWD_ROOT_DIR = $$PWD
|
||||
include(../../Common/base.pri)
|
||||
|
||||
include(../Qt_build/graphics/project/graphics_fonts.pri)
|
||||
include(../xml/build/qt/libxml2.pri)
|
||||
|
||||
CONFIG += build_all_zlib build_zlib_as_sources
|
||||
include(../../OfficeUtils/OfficeUtils.pri)
|
||||
DEFINES += KERNEL_USE_DYNAMIC_LIBRARY
|
||||
DEFINES += GRAPHICS_USE_DYNAMIC_LIBRARY
|
||||
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lUnicodeConverter -lkernel -lgraphics
|
||||
|
||||
include(../../Common/3dParty/v8/v8.pri)
|
||||
|
||||
@ -44,23 +42,3 @@ HEADERS += doctrenderer.h \
|
||||
# downloader
|
||||
DEFINES += BUIDLER_OPEN_DOWNLOAD_ENABLED
|
||||
DEFINES += BUIDLER_OPEN_BASE64_ENABLED
|
||||
|
||||
HEADERS += ../../Common/FileDownloader/FileDownloader.h
|
||||
core_windows {
|
||||
SOURCES += \
|
||||
../../Common/FileDownloader/FileDownloader_win.cpp
|
||||
|
||||
LIBS += -lurlmon
|
||||
}
|
||||
core_linux {
|
||||
SOURCES += \
|
||||
../../Common/FileDownloader/FileDownloader_curl.cpp
|
||||
|
||||
LIBS += -lcurl
|
||||
}
|
||||
core_mac {
|
||||
OBJECTIVE_SOURCES += \
|
||||
../../Common/FileDownloader/FileDownloader_mac.mm
|
||||
|
||||
LIBS += -framework AppKit
|
||||
}
|
||||
|
||||
@ -32,15 +32,30 @@
|
||||
#ifndef NATIVECONTROL
|
||||
#define NATIVECONTROL
|
||||
|
||||
#include "memorystream.h"
|
||||
#include <map>
|
||||
#include "../fontengine/ApplicationFonts.h"
|
||||
#include <iostream>
|
||||
|
||||
#include "../graphics/pro/Fonts.h"
|
||||
#include "../../graphics/Timer.h"
|
||||
#include "../../common/Directory.h"
|
||||
#include "../../common/Array.h"
|
||||
#include "../../../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
#include "memorystream.h"
|
||||
#include "../../fontengine/application_generate_fonts_common.h"
|
||||
|
||||
#if defined(CreateDirectory)
|
||||
#undef CreateDirectory
|
||||
#endif
|
||||
|
||||
#if defined(GetTempPath)
|
||||
#undef GetTempPath
|
||||
#endif
|
||||
|
||||
#if defined(CreateFile)
|
||||
#undef CreateFile
|
||||
#endif
|
||||
|
||||
class CZipWorker
|
||||
{
|
||||
public:
|
||||
@ -372,18 +387,17 @@ public:
|
||||
{
|
||||
if (0 == m_map_fonts.size())
|
||||
{
|
||||
CApplicationFonts oApplication;
|
||||
NSFonts::IApplicationFonts* pApplication = NSFonts::NSApplication::Create();
|
||||
if (m_strFontsDirectory == L"")
|
||||
oApplication.Initialize();
|
||||
pApplication->Initialize();
|
||||
else
|
||||
oApplication.InitializeFromFolder(m_strFontsDirectory);
|
||||
pApplication->InitializeFromFolder(m_strFontsDirectory);
|
||||
|
||||
CArray<CFontInfo*>* pFonts = oApplication.GetList()->GetFonts();
|
||||
std::vector<NSFonts::CFontInfo*>* pFonts = pApplication->GetList()->GetFonts();
|
||||
|
||||
int nCount = pFonts->GetCount();
|
||||
for (int nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
for (std::vector<NSFonts::CFontInfo*>::iterator i = pFonts->begin(); i < pFonts->end(); i++)
|
||||
{
|
||||
CFontInfo* pCurrent = pFonts->operator [](nIndex);
|
||||
NSFonts::CFontInfo* pCurrent = *i;
|
||||
|
||||
size_t pos1 = pCurrent->m_wsFontPath.find_last_of(wchar_t('/'));
|
||||
size_t pos2 = pCurrent->m_wsFontPath.find_last_of(wchar_t('\\'));
|
||||
@ -410,13 +424,17 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
CFontSelectFormat oFormat;
|
||||
NSFonts::CFontSelectFormat oFormat;
|
||||
oFormat.wsName = new std::wstring(L"Arial");
|
||||
|
||||
m_sDefaultFont = L"";
|
||||
CFontInfo* pInfo = oApplication.GenerateFontManager()->GetFontInfoByParams(oFormat);
|
||||
NSFonts::IFontManager* pManager = pApplication->GenerateFontManager();
|
||||
NSFonts::CFontInfo* pInfo = pManager->GetFontInfoByParams(oFormat);
|
||||
if (NULL != pInfo)
|
||||
m_sDefaultFont = pInfo->m_wsFontPath;
|
||||
|
||||
RELEASEINTERFACE(pManager);
|
||||
RELEASEOBJECT(pApplication);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user