mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Fix vertical offset of fonts like MinionPro
For some reason, adding a LTR/RTL Override unicode character before a MinionPro string increases the ascent of the line. This creates vertical offset issues when painting if the ascent used as reference is the one of the font. Use the QTextLine ascent instead for better results. This is a followup to1bed76e2a
. Fixes (reopened) ticket #11284. Fixes ticket #10532. Fixes ticket #10767. (cherry picked from commitd8498d4785
)
This commit is contained in:
parent
08100f8b02
commit
e73c0d6387
@ -455,11 +455,10 @@ void GuiPainter::text(int x, int y, docstring const & s,
|
||||
// don't use the pixmap cache
|
||||
setQPainterPen(computeColor(f.realColor()));
|
||||
if (dir != Auto) {
|
||||
shared_ptr<QTextLayout const> ptl =
|
||||
fm.getTextLayout(s, dir == RtL, wordspacing);
|
||||
ptl->draw(this, QPointF(x, y - fm.maxAscent()));
|
||||
}
|
||||
else {
|
||||
auto ptl = fm.getTextLayout(s, dir == RtL, wordspacing);
|
||||
QTextLine const & tline = ptl->lineForTextPosition(0);
|
||||
ptl->draw(this, QPointF(x, y - tline.ascent()));
|
||||
} else {
|
||||
if (font() != ff)
|
||||
setFont(ff);
|
||||
drawText(x, y, str);
|
||||
|
@ -115,6 +115,8 @@ What's new
|
||||
|
||||
- Fix document updating issues with split view (bug 11354).
|
||||
|
||||
- Fix cases where text is offset vertically (bug 10532, 10767).
|
||||
|
||||
|
||||
* INTERNALS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user