Skip to content

Commit

Permalink
Potential workaround for Windows woff crashes on scaled displays [dep…
Browse files Browse the repository at this point in the history
…loy]
  • Loading branch information
dougmassay committed Mar 16, 2024
1 parent 08694e1 commit 3c5896b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,21 @@ int main(int argc, char *argv[])
}
}

// Trying to embedd woff fonts, or opening epubs with embedded woff fonts, can cause Sigil to
// silently crash when system display scaling is greater than 100%. So we'll force the fallback
// gdi font backend until such time as the directwrite font backend is more robust.
// See https://www.mobileread.com/forums/showthread.php?t=356351 for discussion.
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
// Leave a back door env var override in case of unforseen complications.
QString font_backend_override = Utility::GetEnvironmentVar("SIGIL_USE_DIRECTWRITE_FONTS");
if (!current_platform_args.contains("nodirectwrite", Qt::CaseInsensitive)) {
if (font_backend_override.isEmpty()) {
current_platform_args.append("nodirectwrite");
}
}
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && QT_VERSION < QT_VERSION_CHECK(6, 8, 0)


// if altgr is not already in the list of windows platform options, add it
SettingsStore ss;
if (ss.enableAltGr()) {
Expand Down

0 comments on commit 3c5896b

Please sign in to comment.