[education/rkward] rkward/rbackend: Attempt to fix default device font inside AppImage

Thomas Friedrichsmeier null at kde.org
Sun Jul 17 12:54:24 BST 2022


Git commit 098b5ed57e62e1701137af2ed58d4966437c2392 by Thomas Friedrichsmeier.
Committed on 17/07/2022 at 11:54.
Pushed by tfry into branch 'master'.

Attempt to fix default device font inside AppImage

M  +1    -1    rkward/rbackend/rkrinterface.cpp
M  +2    -1    rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp

https://invent.kde.org/education/rkward/commit/098b5ed57e62e1701137af2ed58d4966437c2392

diff --git a/rkward/rbackend/rkrinterface.cpp b/rkward/rbackend/rkrinterface.cpp
index 11c0d3f6..0142fc18 100644
--- a/rkward/rbackend/rkrinterface.cpp
+++ b/rkward/rbackend/rkrinterface.cpp
@@ -383,7 +383,7 @@ void RInterface::handleRequest (RBackendRequest* request) {
 
 		if (!qgetenv("APPDIR").isEmpty()) {
 			// Running inside an AppImage. As soon as R has started, it should behave as if running in the main (system) environment (esp. when calling helper binaries such as wget or gcc).
-			// Unset any paths starting with APPDIR, _except_ those inside R_HOME. 
+			// Unset any paths starting with APPDIR, _except_ those inside R_HOME.
 			runStartupCommand(new RCommand("local({\n"
 			"	appdir <- Sys.getenv(\"APPDIR\")\n"
 			"	fix <- function(key) {\n"
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
index 6c551cf1..5e6549cf 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
@@ -197,7 +197,8 @@ static QFont readFont (QDataStream &instream) {
 #ifdef __GNUC__
 #	warning TODO deal with line-height
 #endif
-	QFont ret (fontfamily);
+	QFont ret;
+	if (!fontfamily.isEmpty()) ret.setFamily(fontfamily);
 	if (fontface == 2 || fontface == 4) ret.setWeight (QFont::Bold);
 	if (fontface == 3 || fontface == 4) ret.setItalic (true);
 	ret.setPointSizeF (cex*ps);


More information about the rkward-tracker mailing list