Right-side text limit working erratically while changing the font

조회 수: 5 (최근 30일)
Sreeraj T
Sreeraj T 2022년 5월 5일
답변: DGM 2022년 7월 4일
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.

채택된 답변

DGM
DGM 2022년 7월 4일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by