Changeset View
Changeset View
Standalone View
Standalone View
src/render/katerenderer.cpp
Show First 20 Lines • Show All 974 Lines • ▼ Show 20 Line(s) | 961 | { | |||
---|---|---|---|---|---|
975 | * | 975 | * | ||
976 | * qreal height = maxY + fontHeight - minY; | 976 | * qreal height = maxY + fontHeight - minY; | ||
977 | * | 977 | * | ||
978 | * with fontHeight: | 978 | * with fontHeight: | ||
979 | * | 979 | * | ||
980 | * qreal fontHeight = font.ascent() + font.descent(); | 980 | * qreal fontHeight = font.ascent() + font.descent(); | ||
981 | */ | 981 | */ | ||
982 | m_fontHeight = qMax(1, qCeil(m_fontMetrics.ascent() + m_fontMetrics.descent())); | 982 | m_fontHeight = qMax(1, qCeil(m_fontMetrics.ascent() + m_fontMetrics.descent())); | ||
983 | // Try to use representitve character from English, Chinese, Japanese | ||||
pshinjo: I think this causes the regression mentioned in
>>! In D25339#663322, @rjvbb wrote:
> I can't… | |||||
984 | // and Korean to calculate the line height. | ||||
985 | m_fontHeight = qMax(m_fontHeight, qCeil(m_fontMetrics.boundingRect(QString::fromUtf8("AHIyg\xe3\x81\x82\xe4\xbd\xa0\xeb\xa7\x90")).height())); | ||||
983 | } | 986 | } | ||
984 | 987 | | |||
985 | void KateRenderer::updateMarkerSize() | 988 | void KateRenderer::updateMarkerSize() | ||
986 | { | 989 | { | ||
987 | // marker size will be calculated over the value defined | 990 | // marker size will be calculated over the value defined | ||
988 | // on dialog | 991 | // on dialog | ||
989 | 992 | | |||
990 | m_markerSize = spaceWidth() / (3.5 - (m_doc->config()->markerSize() * 0.5)); | 993 | m_markerSize = spaceWidth() / (3.5 - (m_doc->config()->markerSize() * 0.5)); | ||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | 1002 | { | |||
1112 | 1115 | | |||
1113 | l->endLayout(); | 1116 | l->endLayout(); | ||
1114 | 1117 | | |||
1115 | lineLayout->setLayout(l); | 1118 | lineLayout->setLayout(l); | ||
1116 | } | 1119 | } | ||
1117 | 1120 | | |||
1118 | // 1) QString::isRightToLeft() sux | 1121 | // 1) QString::isRightToLeft() sux | ||
1119 | // 2) QString::isRightToLeft() is marked as internal (WTF?) | 1122 | // 2) QString::isRightToLeft() is marked as internal (WTF?) | ||
1120 | // 3) QString::isRightToLeft() does not seem to work on my setup | 1123 | // 3) QString::isRightToLeft() does not seem to work on my setup | ||
anthonyfieroni: Can you use functor here, instead of string. | |||||
1121 | // 4) isStringRightToLeft() should behave much better than QString::isRightToLeft() therefore: | 1124 | // 4) isStringRightToLeft() should behave much better than QString::isRightToLeft() therefore: | ||
1122 | // 5) isStringRightToLeft() kicks ass | 1125 | // 5) isStringRightToLeft() kicks ass | ||
1123 | bool KateRenderer::isLineRightToLeft(KateLineLayoutPtr lineLayout) const | 1126 | bool KateRenderer::isLineRightToLeft(KateLineLayoutPtr lineLayout) const | ||
1124 | { | 1127 | { | ||
1125 | QString s = lineLayout->textLine()->string(); | 1128 | QString s = lineLayout->textLine()->string(); | ||
1126 | int i = 0; | 1129 | int i = 0; | ||
1127 | 1130 | | |||
1128 | // borrowed from QString::updateProperties() | 1131 | // borrowed from QString::updateProperties() | ||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |
I think this causes the regression mentioned in
But this part is the raison d'etre for this patch: provide enough font height for non-latin-1 text. Also not considered is glyphs from other scripts, such as Cyrillic, Arabic, ... What could be another solution?