Skip to content

Commit

Permalink
webenginepreview: Font size should be in pixels
Browse files Browse the repository at this point in the history
Fixes #609.
  • Loading branch information
mitya57 committed Feb 19, 2023
1 parent 961a392 commit 965c803
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ReText/webenginepreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from ReText import globalSettings
from ReText.syncscroll import SyncScroll
from PyQt6.QtCore import QEvent, Qt
from PyQt6.QtGui import QDesktopServices, QGuiApplication, QTextDocument
from PyQt6.QtGui import QDesktopServices, QFontInfo, QGuiApplication, QTextDocument
from PyQt6.QtWebEngineCore import (
QWebEnginePage,
QWebEngineSettings,
Expand Down Expand Up @@ -120,7 +120,7 @@ def setFont(self, font):
settings.setFontFamily(QWebEngineSettings.FontFamily.StandardFont,
font.family())
settings.setFontSize(QWebEngineSettings.FontSize.DefaultFontSize,
font.pointSize())
QFontInfo(font).pixelSize())

def setHtml(self, html, baseUrl):
# A hack to prevent WebEngine from stealing the focus
Expand Down

0 comments on commit 965c803

Please sign in to comment.