Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57327

Can't access .SF NS Text font from QWebEngineView on Mac OSX El capitan

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.7.0
    • WebEngine
    • None
    • Mac OSX El capitan
    • macOS

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              jpfrancoia jpfrancoia
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes