mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2025-07-14 11:24:22 +02:00
Improved/optimized text rendering
This commit is contained in:
@ -21,12 +21,12 @@ int TextItem::avgCharWidth() const
|
||||
ratio = 1.0;
|
||||
// Greek & Cyrilic
|
||||
else if (cp >= 0x03FF && cp <= 0x04FF) {
|
||||
ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.75 : 0.67;
|
||||
ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.80 : 0.72;
|
||||
if (_font.bold())
|
||||
ratio *= 1.1;
|
||||
// The rest (Latin scripts, Arabic, ...)
|
||||
} else {
|
||||
ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.7 : 0.58;
|
||||
ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.75 : 0.63;
|
||||
if (_font.bold())
|
||||
ratio *= 1.1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user