mirror of
https://github.com/Elvanos/fantasia-archive.git
synced 2024-05-22 05:03:13 +12:00
more pdfkit font fixes
This commit is contained in:
parent
a5ded58d3e
commit
8999a4dfce
|
@ -552,8 +552,20 @@ export default class ExportProject extends DialogBase {
|
|||
|
||||
// PDF
|
||||
if (this.selectedExportFormat === "Adobe Reader - PDF") {
|
||||
const normalFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/Roboto-Regular.ttf"))
|
||||
const boldFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/Roboto-Bold.ttf"))
|
||||
let normalFontContents = null
|
||||
let boldFontContents = null
|
||||
// Check if we are running dev or production mode and load accordingly
|
||||
// If Prod
|
||||
// @ts-ignore
|
||||
if (process?.mainModule?.filename?.indexOf("app.asar") < -1) {
|
||||
normalFontContents = fs.readFileSync(path.resolve(__dirname, "../../resources/app.asar//fonts/Roboto-Regular.ttf"))
|
||||
boldFontContents = fs.readFileSync(path.resolve(__dirname, "../../resources/app.asar//fonts/Roboto-Bold.ttf"))
|
||||
}
|
||||
// If dev
|
||||
else {
|
||||
normalFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/Roboto-Regular.ttf"))
|
||||
boldFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/Roboto-Bold.ttf"))
|
||||
}
|
||||
|
||||
this.exportFile_PDF(exportObject, exportPath, normalFontContents, boldFontContents)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue