mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2024-11-24 03:35:54 +01:00
Some more bounding rect computation tweaking
This commit is contained in:
parent
1c42f104d1
commit
148f79eaef
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user