From 775d06de9dd2538fc69612e678f2d59db4e2a768 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Sun, 2 Apr 2023 20:16:15 +0300 Subject: [PATCH] Fix build js module --- DesktopEditor/graphics/pro/js/wasm/js/drawingfile_base.js | 8 ++++++-- PdfFile/PdfWriter_empty.cpp | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/DesktopEditor/graphics/pro/js/wasm/js/drawingfile_base.js b/DesktopEditor/graphics/pro/js/wasm/js/drawingfile_base.js index 9001e957a2..eb162f7822 100644 --- a/DesktopEditor/graphics/pro/js/wasm/js/drawingfile_base.js +++ b/DesktopEditor/graphics/pro/js/wasm/js/drawingfile_base.js @@ -39,6 +39,8 @@ return name; } + var baseFontsPath = "../../../../fonts/"; + var FS = undefined; //desktop_fetch @@ -411,7 +413,9 @@ }; self["AscViewer"]["CDrawingFile"] = CFile; - self["AscViewer"]["InitializeFonts"] = function() { + self["AscViewer"]["InitializeFonts"] = function(basePath) { + if (undefined !== basePath && "" !== basePath) + baseFontsPath = basePath; if (!window["g_fonts_selection_bin"]) return; var memoryBuffer = window["g_fonts_selection_bin"].toUtf8(); @@ -500,7 +504,7 @@ { // шрифт не грузится - надо загрузить var _t = file; - file.LoadFontAsync("../../../../fonts/", function(){ + file.LoadFontAsync(baseFontsPath, function(){ fontToMemory(_t, true); var pages = self.fontStreams[fileId].pages; diff --git a/PdfFile/PdfWriter_empty.cpp b/PdfFile/PdfWriter_empty.cpp index 3046823271..20c72a26e3 100644 --- a/PdfFile/PdfWriter_empty.cpp +++ b/PdfFile/PdfWriter_empty.cpp @@ -32,7 +32,7 @@ #include "PdfWriter.h" #ifdef BUILDING_WASM_MODULE -CPdfWriter::CPdfWriter(NSFonts::IApplicationFonts* pAppFonts, bool isPDFA) : m_oCommandManager(this) {} +CPdfWriter::CPdfWriter(NSFonts::IApplicationFonts* pAppFonts, bool isPDFA, IRenderer* pRenderer) : m_oCommandManager(this) {} CPdfWriter::~CPdfWriter() {} int CPdfWriter::SaveToFile(const std::wstring& wsPath) { return 0; } void CPdfWriter::SetPassword(const std::wstring& wsPassword) {} @@ -141,8 +141,8 @@ void CPdfWriter::Sign(const double& dX, const double& dY, const double& dW, cons bool CPdfWriter::DrawImage(Aggplus::CImage* pImage, const double& dX, const double& dY, const double& dW, const double& dH, const BYTE& nAlpha) { return false; } //bool CPdfWriter::DrawText(unsigned char* pCodes, const unsigned int& unLen, const double& dX, const double& dY) { return false; } bool CPdfWriter::PathCommandDrawText(unsigned int* pUnicodes, unsigned int unLen, const double& dX, const double& dY, const unsigned int* pGids) { return false; } -void CPdfWriter::UpdateFont() {} -void CPdfWriter::GetFontPath(const std::wstring& wsFontName, const bool& bBold, const bool& bItalic, std::wstring& wsFontPath, LONG& lFaceIndex) {} +bool CPdfWriter::UpdateFont() { return false; } +bool CPdfWriter::GetFontPath(const std::wstring &wsFontName, const bool &bBold, const bool &bItalic, std::wstring& wsFontPath, LONG& lFaceIndex) { return false; } PdfWriter::CFontCidTrueType* CPdfWriter::GetFont(const std::wstring& wsFontPath, const LONG& lFontIndex) { return NULL; } PdfWriter::CFontCidTrueType* CPdfWriter::GetFont(const std::wstring& wsFontName, const bool& bBold, const bool& bItalic) { return NULL; } void CPdfWriter::UpdateTransform() {}