Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.7.0
-
None
-
Mac OSX El capitan
Description
Hi, it's my first bug report for Qt.
I'm not even sure I should post here. I encounter a problem while developing a software with PyQt, and I suspect my bug comes from Qt.
I set the default font of my app like that:
font = QtGui.QFont()
font.setStyleHint(QtGui.QFont.System)
font.setPointSize(self.styles.FONT_SIZE)
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
QtWidgets.qApp.setFont(font)
Basically, I let Qt and the system choose the font. Later, I try to set the font of a QWebEngine view:
self.settings().setFontFamily(QtWebEngineWidgets.QWebEngineSettings.StandardFont, self.parent.font().family())
Basically, I use the default font of the app to set the StandardFont of the QWebEngineView.
However, on Mac OSX El capitan, the app's default font is .SF NS Text. But I can't use this font in QWebEngineView. I can use any other font (like Helvetica), but not this one. It's probably because .SF NS Text is not user accessible.
I don't want to specify a default font for my app, because it's cross platform and I don't want to mess with the OS' font style.
A solution would be to avoid .SF NS Text globally. But substitution does not work:
QFont::insertSubstitution(".SF NS Text", "Helvetica");
Could you give me a hand ?
EDIT: I think it might be related to https://bugreports.qt.io/browse/QTBUG-56160. Should I wait for version 5.7.1 ?
Attachments
Issue Links
- duplicates
-
QTBUG-56398 QtWebEngine: Changing font through javascript call does not work for fonts that have "bold" or "regular" after the name
-
- Closed
-