Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jiggling text and deviations in text cursor position #3900

Open
octaeder opened this issue Dec 6, 2024 · 23 comments
Open

jiggling text and deviations in text cursor position #3900

octaeder opened this issue Dec 6, 2024 · 23 comments

Comments

@octaeder
Copy link
Contributor

octaeder commented Dec 6, 2024

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
@sunderme
Copy link
Member

sunderme commented Dec 8, 2024

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

@sunderme
Copy link
Member

do you still see the issue with rc2 ?

@octaeder
Copy link
Contributor Author

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?

@sunderme
Copy link
Member

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

@octaeder
Copy link
Contributor Author

yes

@octaeder
Copy link
Contributor Author

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

@l-uuz
Copy link

l-uuz commented Dec 29, 2024

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.

@sunderme
Copy link
Member

sunderme commented Jan 1, 2025

are the rendering settings (advanced editor) default ?

@octaeder
Copy link
Contributor Author

octaeder commented Jan 1, 2025

grafik

@octaeder
Copy link
Contributor Author

octaeder commented Jan 1, 2025

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.

@sunderme
Copy link
Member

sunderme commented Jan 1, 2025

no, this is a independent

@octaeder
Copy link
Contributor Author

octaeder commented Jan 1, 2025

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).

@sunderme
Copy link
Member

sunderme commented Jan 1, 2025

have you tried Qt Rendermoder ?

@octaeder
Copy link
Contributor Author

octaeder commented Jan 1, 2025

  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?

@sunderme
Copy link
Member

sunderme commented Jan 1, 2025

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

For 1 , all three settings are necessary?

@octaeder
Copy link
Contributor Author

octaeder commented Jan 1, 2025

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.

@sunderme
Copy link
Member

sunderme commented Jan 1, 2025

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

@octaeder
Copy link
Contributor Author

octaeder commented Jan 1, 2025

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;

@sunderme
Copy link
Member

sunderme commented Jan 2, 2025

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)

@octaeder
Copy link
Contributor Author

octaeder commented Jan 3, 2025

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}

@l-uuz
Copy link

l-uuz commented Jan 6, 2025

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.

@sunderme
Copy link
Member

sunderme commented Jan 7, 2025

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 ?

@l-uuz
Copy link

l-uuz commented Jan 7, 2025

also win10 ?

Yes, see above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants