You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some debugging due to a number of Linux font issues, I think I have worked out why gImageReader has not been outputting PDFs as I expected - it silently reverts back to the default font if a word element's font cannot be found. Would it be possible to warn about this? For example with something like:
index d8277ccc..b2c1b5ca 100644
--- a/qt/src/hocr/HOCRPdfExporter.cc+++ b/qt/src/hocr/HOCRPdfExporter.cc@@ -562,6 +562,7 @@ PoDoFo::PdfFont* HOCRPoDoFoPdfPrinter::getFont(QString family, bool bold, bool i
if(it == m_fontCache.end()) {
if(family.isEmpty() || !m_fontDatabase.hasFamily(family)) {
family = m_defaultFontFamily;
+ QMessageBox::warning(MAIN, _("Missing Font"), _("WARNING: Cannot find the font '%1' in the QFontDatabase, switching to the font '%2'.").arg(key).arg(family));
}
PoDoFo::PdfFont* font = nullptr;
try {
This doesn't work, probably as the parent should be HOCRPdfExporter rather than MAIN, but it makes it crystal clear why the PDF output is not what you see in the GUI.
Cheers,
Edward
The text was updated successfully, but these errors were encountered:
Might make sense to collect all the missing fonts and then display a final warning after the export, rather than risking many popups appearing during the export.
Is there a global data structure for storing this info? I haven't looked too deeply into the code yet. There are a number of font failures that would be useful to report back to the user, so they know that a better result can be obtained by switching away from the failing fonts. I could try coding something in a few weeks.
After some debugging due to a number of Linux font issues, I think I have worked out why gImageReader has not been outputting PDFs as I expected - it silently reverts back to the default font if a word element's font cannot be found. Would it be possible to warn about this? For example with something like:
This doesn't work, probably as the parent should be HOCRPdfExporter rather than MAIN, but it makes it crystal clear why the PDF output is not what you see in the GUI.
Cheers,
Edward
The text was updated successfully, but these errors were encountered: