Fix em unit calculation in document preview (#1961)
This commit is contained in:
@@ -26,7 +26,7 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt5.QtGui import (
|
from PyQt5.QtGui import (
|
||||||
QColor, QFont, QFontMetrics, QTextBlockFormat, QTextCharFormat,
|
QColor, QFont, QFontMetricsF, QTextBlockFormat, QTextCharFormat,
|
||||||
QTextCursor, QTextDocument
|
QTextCursor, QTextDocument
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -99,8 +99,8 @@ class ToQTextDocument(Tokenizer):
|
|||||||
self._document.clear()
|
self._document.clear()
|
||||||
self._document.setDefaultFont(self._textFont)
|
self._document.setDefaultFont(self._textFont)
|
||||||
|
|
||||||
qMetric = QFontMetrics(self._textFont)
|
qMetric = QFontMetricsF(self._textFont)
|
||||||
mScale = qMetric.height()
|
mScale = qMetric.ascent()
|
||||||
fPt = self._textFont.pointSizeF()
|
fPt = self._textFont.pointSizeF()
|
||||||
|
|
||||||
# Scaled Sizes
|
# Scaled Sizes
|
||||||
|
|||||||
Reference in New Issue
Block a user