Effacer les filtres
Effacer les filtres

Right-side text limit working erratically while changing the font

8 vues (au cours des 30 derniers jours)
Sreeraj T
Sreeraj T le 5 Mai 2022
Réponse apportée : DGM le 4 Juil 2022
Let me try to explain a slight problem that I am facing.
In this figure, you can see that I have font “Monospaced” with font size 14. The right-hand text limit is place at 75th column. As you can see from the code, the line terminates at 75th position and then goes to the next line.
Now, if I change the font to say, “Comic Sans”, keeping the same font, the ‘right-hand text’ limiting line moves to a new position. But strangely, the text terminates not at the position where the line is shown, but in the same place where initially the ‘right-hand text limit’ was there.
I checked it for other fonts also, but still the problem persists. Any idea of what is happening?
Using Matlab R2021b.
Thanks in advance.

Réponse acceptée

DGM
DGM le 4 Juil 2022
I played around with this in R2019b. Bear in mind that there are two relevant prefs here. The RH text limit is just an indicator line. It doesn't specify where the text gets wrapped. That's actually set under Editor>Language instead. They can be set independently for some reason.
Assuming that they are set to the same width, I wouldn't expect the RH text limit line to be in a useful location if you use a variable-width font. Because the characters are not fixed-width, a line containing 75 characters does not have a fixed length in pixels. Odds are that whatever guess it uses will be wrong.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by