texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

jiggling text and deviations in text cursor position

Open octaeder opened this issue 1 year ago • 25 comments

Environment

  • TeXstudio: This is not in 4.8.4, but in current dev
  • Qt: 6.8.0
  • OS: Windows(10)
  • TeX distribution: miktex

Expected behavior

cursor mark should be positioned correctly, text should not move

Actual behavior

see images below, I assume that this is introduced with Qt6.8.

How to reproduce

It seems to be a random effect, difficult to reproduce. First I set the cursor at the beginning of diam near start oft the first line. Character d and the mark fit closely. Then I set cursor mark to the same word near end of the second line. The mark is about 1/3 of character width mispositioned to the left (this can be quite irritating). I select the word (ctrl+d) and deselect the word (macro with ctrl+q). Be aware of the movement of the following text (2px, character width 7px). Font used is JetBrains Mono in size 9. Maybe there's another change for fonts like I fixed in #3548.

jigglingText

jigglingTextMagnified

random text used Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et

octaeder avatar Dec 06 '24 14:12 octaeder

works fine on ubuntu. qt6.8.1 will come up soon.

sunderme avatar Dec 08 '24 15:12 sunderme

do you still see the issue with rc2 ?

sunderme avatar Dec 10 '24 17:12 sunderme

indeed, I tested with portable version after copying my .ini file: TeXstudio 4.8.5 (git 4.8.5rc2) Using Qt Version 6.8.1, compiled with Qt 6.8.1 R

Maybe you are talking about Qt6.8.2 announced for 23.01.2025?

octaeder avatar Dec 10 '24 18:12 octaeder

so, you still,see the issue with txs 4.8.5rc2?

sunderme avatar Dec 10 '24 19:12 sunderme

yes

octaeder avatar Dec 10 '24 19:12 octaeder

I updated my msys2 to Qt6.8.1. Same issue. Let's hope for 6.8.2

octaeder avatar Dec 10 '24 19:12 octaeder

I can confirm this problem. Just installed 4.8.5 with Qt 6.8.1, also Windows 10. The font is "Noto Sans Mono" at size 10.

GIF 29 12 2024 18-51-48

Edit: Problem does not occur on 4.8.4 (Qt 6.7.2). Some additional data may help:

  • Windows 10 22H2
  • Display Resolution: 2560x1440px, 100% scale
  • Noto Sans Mono was selected, version 2.014 is installed with the variable font TTF.

l-uuz avatar Dec 29 '24 17:12 l-uuz

are the rendering settings (advanced editor) default ?

sunderme avatar Jan 01 '25 16:01 sunderme

grafik

octaeder avatar Jan 01 '25 16:01 octaeder

Starting txs with a new profile (and changing style to windowsvista) I see this

grafik

Are these style dependent? I see no reaseon why I should have changed these settings.

octaeder avatar Jan 01 '25 17:01 octaeder

no, this is a independent

sunderme avatar Jan 01 '25 17:01 sunderme

it still appears with default settings as above. More observations: When the first (column 0) character of the line is not a whitespace the missbehavour appears when you select any single character of the line. Otherwise a character in column 64 or higher (independent of the number of blanks at the beginning) has to be selected.

Changing font family to FixedSys (or some other mono fonts) helps. But it happens also with Jokerman which isn't monospaced).

octaeder avatar Jan 01 '25 17:01 octaeder

have you tried Qt Rendermoder ?

sunderme avatar Jan 01 '25 18:01 sunderme

  1. This setting solves the problem: grafik
  2. This setting solves the problem: grafik
  3. This solves the problem but whitespaces (leading or trailing) are no longer shown as dots or arrows (Option Show Whitespace) grafik

What is your recommendation?

octaeder avatar Jan 01 '25 21:01 octaeder

1 or 3, depending whether you need the space symbols.

For 1 , all three settings are necessary?

sunderme avatar Jan 01 '25 22:01 sunderme

ad 1) I only tested the two cases where exactly one of the first two is set. I didn't check what happens when 3rd option is disabled (cache of rendered lines) in these cases. But I can test it.

octaeder avatar Jan 01 '25 22:01 octaeder

I am only interested in the first two options. So, both need to be active ?

sunderme avatar Jan 01 '25 23:01 sunderme

yes, both are needed.

For the three Disable ... options also the following combination works: grafik

I didn't uncheck 3rd option at first, because this options seemed to be default (see 2nd image). But the default should be unchecked:

registerOption("Editor/Hack Disable Line Cache", &editorConfig->hackDisableLineCache, false, &pseudoDialog->checkBoxHackDisableLineCache);

Ok, this seems to be overwritten in latexeditorview.cpp:

#if defined( Q_OS_LINUX ) || defined( Q_OS_WIN )
	hackDisableLineCache = true;

octaeder avatar Jan 01 '25 23:01 octaeder

the work-around indicates that the font is not truly mono spaced (or not all variants of the fonts are installed and are replaced by similar fonts)

sunderme avatar Jan 02 '25 10:01 sunderme

The site claims that these are mono fonts. I reinstalled all 32 fonst from the zip package. A simple document shows the issue with current msys2 build or released portable version 4.8.5 (both Qt 6.8.1), but not with installed 4.8.4 (Qt 6.7.2).

I found an interesting detail. Type a text which starts at column 0 with no whitespace and such that the line contains a math env that ends before column 64. When you mark any character before the env then all the characterters from the marked up to the character before the first $ jiggle. Right of the env jiggling happens when you mark a character in column 63 or higer.

image1

Nothing happens when marking column 62: image2

image3

Test File
\documentclass[11pt,a4paper]{article}
\begin{document}
Lorem ipsum dolor sit amet, consetetur $a$ sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
\end{document}

octaeder avatar Jan 03 '25 05:01 octaeder

are the rendering settings (advanced editor) default ?

Yes, for me too. :-)

I also observed that the rendering is different. Look at the following screenshot from 4.8.5:

grafik

This is from 4.8.6:

grafik

Look at "sit amet" in the bold headline. The settings from https://github.com/texstudio-org/texstudio/issues/3900#issuecomment-2567146876 (suggestion 1) fix the jiggling text but not the strange rendering. Suggestion 3 leads to problems while selecting text, e.g. highlighting the wrong lines, showing text black on blue instead of white.

l-uuz avatar Jan 06 '25 20:01 l-uuz

are the rendering settings (advanced editor) default ?

Yes, for me too. :-)

I also observed that the rendering is different. Look at the following screenshot from 4.8.5:

grafik

This is from 4.8.6:

grafik

Look at "sit amet" in the bold headline. The settings from #3900 (comment) (suggestion 1) fix the jiggling text but not the strange rendering. Suggestion 3 leads to problems while selecting text, e.g. highlighting the wrong lines, showing text black on blue instead of white.

also win10 ?

sunderme avatar Jan 07 '25 17:01 sunderme

also win10 ?

Yes, see above

l-uuz avatar Jan 07 '25 18:01 l-uuz

The issue remains with Qt6.8.2 with this setup:

Image

octaeder avatar Feb 04 '25 23:02 octaeder

I am having the same issue using: TeXstudio 4.8.6 (git 4.8.6) Using Qt Version 6.8.2, compiled with Qt 6.8.2 R on macOS 15.3.1 on Apple Silicon. I have also turned off all inline spell checking. Unfortunately, this makes editing text using TeXstudio impossible, as words can overlap when displayed in the editor despite separation by a whitespace character. Thanks.

nmadani avatar Mar 09 '25 15:03 nmadani