diff --git a/src/assets/fonts/ArialUnicodeMS.ttf b/src/assets/fonts/ArialUnicodeMS.ttf new file mode 100644 index 0000000..6b30996 Binary files /dev/null and b/src/assets/fonts/ArialUnicodeMS.ttf differ diff --git a/src/components/dialogs/ExportProject.vue b/src/components/dialogs/ExportProject.vue index 0dbd623..a47ac38 100644 --- a/src/components/dialogs/ExportProject.vue +++ b/src/components/dialogs/ExportProject.vue @@ -35,15 +35,20 @@
- Please note that the PDF export doesn't play nice -
- with underlined text if different parts of the same paragraph -
- have increased/decreased font sizes + Please note that the PDF export doesn't play nice with: +
    +
  • + With underlined text if different parts of the same paragraph have increased/decreased font sizes +
  • +
+
OR
- if you have underlines in headings. + if you have underlines in headings +
+ OR +

If your document contains such text, @@ -54,59 +59,153 @@
- + - + + + + + If the exported document doesn't show some characters properly. +
+ Try turning this on and exporting again. +
+
+
+ + + +
- + + + + + Automatically exports all documents in your project. + + + + + + + - + + + + + This setting exports ONLY the main document name. +
+ And text editors with content. +
+
+
+ + + +
- + + + + + Determines if the text editors should have their respective titles or not. + + + + + + + - + + + + + Determines if tags will be included in the export or not. + + + + + + + - + + + + + Determines if hierarchical path will be included in the export or not. + + + + + + + + + + + + + Determines if documents with status "Dead/Gone/Destroyed" +
+ will be included in the export or not. +
+
+
+ + + +
+ + + + + + Determines if the status "Dead/Gone/Destroyed" +
+ should be excluded from the exported documents. +
+
+
+ + + +
+ +
@@ -301,6 +400,7 @@ import { advancedDocumentFilter } from "src/scripts/utilities/advancedDocumentFi import RobotoRegular from "src/assets/fonts/Roboto-Regular.ttf" import RobotoBold from "src/assets/fonts/Roboto-Bold.ttf" +import ArialFallback from "src/assets/fonts/ArialUnicodeMS.ttf" @Component({ components: { @@ -310,6 +410,7 @@ import RobotoBold from "src/assets/fonts/Roboto-Bold.ttf" export default class ExportProject extends DialogBase { RobotoRegular = RobotoRegular RobotoBold = RobotoBold + ArialFallback = ArialFallback /** * React to dialog opening request @@ -345,6 +446,7 @@ export default class ExportProject extends DialogBase { this.includeIsDead = true this.writerMode = false this.writerModeTitles = false + this.useFallbackFont = false this.exportDocumentsModel = [] this.exportOngoing = false this.exportList = [] @@ -379,6 +481,8 @@ export default class ExportProject extends DialogBase { includeIsDead = true + useFallbackFont = false + setDocumentPreviewClose () { this.documentPreviewClose = uid() } @@ -545,19 +649,29 @@ export default class ExportProject extends DialogBase { // @ts-ignore const isDev = remote.getCurrentWindow().isDev - console.log(isDev) - // Check if we are running dev or production mode and load accordingly // If Prod // @ts-ignore if (!isDev) { - 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 (this.useFallbackFont) { + normalFontContents = fs.readFileSync(path.resolve(__dirname, "../../resources/app.asar/fonts/ArialUnicodeMS.ttf")) + boldFontContents = fs.readFileSync(path.resolve(__dirname, "../../resources/app.asar/fonts/ArialUnicodeMS.ttf")) + } + else { + 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")) + if (this.useFallbackFont) { + normalFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/ArialUnicodeMS.ttf")) + boldFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/Roboto-Bold.ttf")) + } + else { + normalFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/ArialUnicodeMS.ttf")) + boldFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/Roboto-Bold.ttf")) + } } for (const document of this.exportList) { @@ -576,7 +690,7 @@ export default class ExportProject extends DialogBase { this.exportFile_PDF(exportObject, exportPath, normalFontContents, boldFontContents) } - await this.sleep(5) + await this.sleep(10) this.exportedDocuments++ } @@ -665,9 +779,24 @@ export default class ExportProject extends DialogBase { returnValue = returnValue.map((e: {value: string}) => `${e.value}`) } else { - returnValue = (field.predefinedListExtras?.reverse) - ? returnValue.map((e: {value: string, affix: string}) => `${e.affix}: ${e.value}`) - : returnValue.map((e: {value: string, affix: string}) => `${e.value} (${e.affix})`) + if (field.predefinedListExtras?.reverse) { + returnValue = returnValue.map((e: {value: string, affix: string}) => { + let returnString = e.affix + if (e.value) { + returnString = `${returnString}: ${e.value}` + } + return returnString + }) + } + else { + returnValue = returnValue.map((e: {value: string, affix: string}) => { + let returnString = e.value + if (e.affix) { + returnString = `${e.value} (${e.affix})` + } + return returnString + }) + } } } @@ -1394,5 +1523,12 @@ export default class ExportProject extends DialogBase { h6 { display: block; } + + .exportSettings { + .q-item { + padding-right: 0; + padding-left: 0; + } + } }