Right-side text limit working erratically while changing the font
9 次查看(过去 30 天)
显示 更早的评论
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/987985/image.jpeg)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/987990/image.png)
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
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!