Some more bounding rect computation tweaking

This commit is contained in:
Martin Tůma 2019-10-04 20:23:34 +02:00
parent 1c42f104d1
commit 148f79eaef

View File

@ -24,11 +24,15 @@ qreal TextItem::avgCharWidth() const
ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.80 : 0.73; ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.80 : 0.73;
if (_font.bold()) if (_font.bold())
ratio *= 1.1; ratio *= 1.1;
if (_font.italic())
ratio *= 0.9;
// The rest (Latin scripts, Arabic, ...) // The rest (Latin scripts, Arabic, ...)
} else { } else {
ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.75 : 0.63; ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.75 : 0.63;
if (_font.bold()) if (_font.bold())
ratio *= 1.1; ratio *= 1.1;
if (_font.italic())
ratio *= 0.9;
} }
return ratio * _font.pixelSize(); return ratio * _font.pixelSize();