r21872 by jghali - #14454: Font preview in font selectors always shows the bold variety

scribus-commit scribus-commit at lists.scribus.net
Mon Apr 10 18:07:39 UTC 2017


Author: jghali
Date: Mon Apr 10 18:07:38 2017
New Revision: 21872

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21872
Log:
#14454: Font preview in font selectors always shows the bold variety

Modified:
    trunk/Scribus/scribus/ui/fontcombo.cpp

Modified: trunk/Scribus/scribus/ui/fontcombo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21872&path=/trunk/Scribus/scribus/ui/fontcombo.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/fontcombo.cpp	(original)
+++ trunk/Scribus/scribus/ui/fontcombo.cpp	Mon Apr 10 18:07:38 2017
@@ -452,7 +452,16 @@
 	if (classname == "FontComboH" || classname == "SMFontComboH")
 	{
 		QStringList styles = prefsManager->appPrefs.fontPrefs.AvailFonts.fontMap[text];
-		const ScFace& fon = prefsManager->appPrefs.fontPrefs.AvailFonts.findFont(text, styles[0]);
+		QString style = styles[0];
+		if (styles.contains("Regular"))
+			style = "Regular";
+		else if (styles.contains("Roman"))
+			style = "Roman";
+		else if (styles.contains("Medium"))
+			style = "Medium";
+		else if (styles.contains("Book"))
+			style = "Book";
+		const ScFace& fon = prefsManager->appPrefs.fontPrefs.AvailFonts.findFont(text, style);
 		if (!QFontDatabase().families().contains(text))
 			QFontDatabase().addApplicationFont(fon.fontFilePath());
 		return fon;




More information about the scribus-commit mailing list