0.1.7-RC-3: fixed fonts and other small tweaks

This commit is contained in:
Elvanos 2021-05-21 17:46:52 +02:00
parent 6a452cdd27
commit 0f4d2a008d
2 changed files with 199 additions and 63 deletions

Binary file not shown.

View file

@ -35,15 +35,20 @@
<div class="col-auto self-center q-ml-sm" v-if="selectedExportFormat === 'Adobe Reader - PDF'"> <div class="col-auto self-center q-ml-sm" v-if="selectedExportFormat === 'Adobe Reader - PDF'">
<q-icon name="mdi-alert-circle" size="20px"> <q-icon name="mdi-alert-circle" size="20px">
<q-tooltip :delay="500"> <q-tooltip :delay="500">
Please note that the PDF export doesn't play nice Please note that the PDF export doesn't play nice with:
<br> <ul>
with underlined text if different parts of the same paragraph <li>
<br> With underlined text if different parts of the same paragraph have increased/decreased font sizes
have increased/decreased font sizes </li>
</ul>
<br> <br>
OR OR
<br> <br>
if you have underlines in headings. if you have underlines in headings
<br>
OR
<br> <br>
<br> <br>
If your document contains such text, If your document contains such text,
@ -54,59 +59,153 @@
</div> </div>
</div> </div>
<q-checkbox <q-list class="exportSettings">
class="q-mt-lg"
dark color="primary"
v-model="exportWholeProject"
label="Export whole project?"
/>
<q-checkbox <q-item v-if="selectedExportFormat === 'Adobe Reader - PDF'">
class="q-mt-lg" <q-item-section side>
dark color="primary" <q-icon name="mdi-help-circle" size="18px">
v-model="writerMode" <q-tooltip :delay="500">
label="Export only text editors and document name?" If the exported document doesn't show some characters properly.
/> <br>
Try turning this on and exporting again.
</q-tooltip>
</q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark color="primary"
v-model="useFallbackFont"
label="Use high-compatibility font?"
/>
</q-item-section>
</q-item>
<q-checkbox <q-item>
class="q-mt-lg" <q-item-section side>
dark color="primary" <q-icon name="mdi-help-circle" size="18px">
v-if='writerMode' <q-tooltip :delay="500">
v-model="writerModeTitles" Automatically exports all documents in your project.
label="Include text editor field titles?" </q-tooltip>
/> </q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark color="primary"
v-model="exportWholeProject"
label="Export whole project?"
/>
</q-item-section>
</q-item>
<q-checkbox <q-item>
class="q-mt-lg" <q-item-section side>
v-if='!writerMode' <q-icon name="mdi-help-circle" size="18px">
dark color="primary" <q-tooltip :delay="500">
v-model="includeTags" This setting exports ONLY the main document name.
label="Include tags in the export?" <br>
/> And text editors with content.
</q-tooltip>
</q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark color="primary"
v-model="writerMode"
label="Use writer mode?"
/>
</q-item-section>
</q-item>
<q-checkbox <q-item v-if='writerMode'>
class="q-mt-lg" <q-item-section side>
v-if='!writerMode' <q-icon name="mdi-help-circle" size="18px">
dark color="primary" <q-tooltip :delay="500">
v-model="includeHierarchyPath" Determines if the text editors should have their respective titles or not.
label="Include hierarchical path in the export?" </q-tooltip>
/> </q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark color="primary"
v-model="writerModeTitles"
label="Include text editor field titles?"
/>
</q-item-section>
</q-item>
<q-checkbox <q-item v-if='!writerMode'>
class="q-mt-lg" <q-item-section side>
v-if='!writerMode' <q-icon name="mdi-help-circle" size="18px">
dark color="primary" <q-tooltip :delay="500">
v-model="includeIsDead" Determines if tags will be included in the export or not.
label="Include dead/gone/destroyed documents in the export?" </q-tooltip>
/> </q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark color="primary"
v-model="includeTags"
label="Include tags in the export?"
/>
</q-item-section>
</q-item>
<q-checkbox <q-item v-if='!writerMode'>
v-if='!writerMode && includeIsDead' <q-item-section side>
class="q-mt-lg" <q-icon name="mdi-help-circle" size="18px">
dark color="primary" <q-tooltip :delay="500">
v-model="hideDeadInformation" Determines if hierarchical path will be included in the export or not.
label="Hide dead/gone/destroyed status in the exported documents?" </q-tooltip>
/> </q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark color="primary"
v-model="includeHierarchyPath"
label="Include hierarchical path in the export?"
/>
</q-item-section>
</q-item>
<q-item v-if='!writerMode'>
<q-item-section side>
<q-icon name="mdi-help-circle" size="18px">
<q-tooltip :delay="500">
Determines if documents with status "Dead/Gone/Destroyed"
<br>
will be included in the export or not.
</q-tooltip>
</q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark color="primary"
v-model="includeIsDead"
label="Include dead/gone/destroyed documents in the export?"
/>
</q-item-section>
</q-item>
<q-item v-if='!writerMode && includeIsDead'>
<q-item-section side>
<q-icon name="mdi-help-circle" size="18px">
<q-tooltip :delay="500">
Determines if the status "Dead/Gone/Destroyed"
<br>
should be excluded from the exported documents.
</q-tooltip>
</q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark color="primary"
v-model="hideDeadInformation"
label="Hide dead/gone/destroyed status in the exported documents?"
/>
</q-item-section>
</q-item>
</q-list>
</div> </div>
</div> </div>
@ -301,6 +400,7 @@ import { advancedDocumentFilter } from "src/scripts/utilities/advancedDocumentFi
import RobotoRegular from "src/assets/fonts/Roboto-Regular.ttf" import RobotoRegular from "src/assets/fonts/Roboto-Regular.ttf"
import RobotoBold from "src/assets/fonts/Roboto-Bold.ttf" import RobotoBold from "src/assets/fonts/Roboto-Bold.ttf"
import ArialFallback from "src/assets/fonts/ArialUnicodeMS.ttf"
@Component({ @Component({
components: { components: {
@ -310,6 +410,7 @@ import RobotoBold from "src/assets/fonts/Roboto-Bold.ttf"
export default class ExportProject extends DialogBase { export default class ExportProject extends DialogBase {
RobotoRegular = RobotoRegular RobotoRegular = RobotoRegular
RobotoBold = RobotoBold RobotoBold = RobotoBold
ArialFallback = ArialFallback
/** /**
* React to dialog opening request * React to dialog opening request
@ -345,6 +446,7 @@ export default class ExportProject extends DialogBase {
this.includeIsDead = true this.includeIsDead = true
this.writerMode = false this.writerMode = false
this.writerModeTitles = false this.writerModeTitles = false
this.useFallbackFont = false
this.exportDocumentsModel = [] this.exportDocumentsModel = []
this.exportOngoing = false this.exportOngoing = false
this.exportList = [] this.exportList = []
@ -379,6 +481,8 @@ export default class ExportProject extends DialogBase {
includeIsDead = true includeIsDead = true
useFallbackFont = false
setDocumentPreviewClose () { setDocumentPreviewClose () {
this.documentPreviewClose = uid() this.documentPreviewClose = uid()
} }
@ -545,19 +649,29 @@ export default class ExportProject extends DialogBase {
// @ts-ignore // @ts-ignore
const isDev = remote.getCurrentWindow().isDev const isDev = remote.getCurrentWindow().isDev
console.log(isDev)
// Check if we are running dev or production mode and load accordingly // Check if we are running dev or production mode and load accordingly
// If Prod // If Prod
// @ts-ignore // @ts-ignore
if (!isDev) { if (!isDev) {
normalFontContents = fs.readFileSync(path.resolve(__dirname, "../../resources/app.asar//fonts/Roboto-Regular.ttf")) if (this.useFallbackFont) {
boldFontContents = fs.readFileSync(path.resolve(__dirname, "../../resources/app.asar//fonts/Roboto-Bold.ttf")) 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 // If dev
else { else {
normalFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/Roboto-Regular.ttf")) if (this.useFallbackFont) {
boldFontContents = fs.readFileSync(path.resolve(__dirname, "../../assets/fonts/Roboto-Bold.ttf")) 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) { for (const document of this.exportList) {
@ -576,7 +690,7 @@ export default class ExportProject extends DialogBase {
this.exportFile_PDF(exportObject, exportPath, normalFontContents, boldFontContents) this.exportFile_PDF(exportObject, exportPath, normalFontContents, boldFontContents)
} }
await this.sleep(5) await this.sleep(10)
this.exportedDocuments++ this.exportedDocuments++
} }
@ -665,9 +779,24 @@ export default class ExportProject extends DialogBase {
returnValue = returnValue.map((e: {value: string}) => `${e.value}`) returnValue = returnValue.map((e: {value: string}) => `${e.value}`)
} }
else { else {
returnValue = (field.predefinedListExtras?.reverse) if (field.predefinedListExtras?.reverse) {
? returnValue.map((e: {value: string, affix: string}) => `${e.affix}: ${e.value}`) returnValue = returnValue.map((e: {value: string, affix: string}) => {
: returnValue.map((e: {value: string, affix: string}) => `${e.value} (${e.affix})`) 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 { h6 {
display: block; display: block;
} }
.exportSettings {
.q-item {
padding-right: 0;
padding-left: 0;
}
}
} }
</style> </style>