Allow Fixing of Row/Col number, resize window only changes font size.
Description of the new feature
Allow setting the number of rows and columns to fixed numbers. If the user then adjusts the size of the window, font size is adjusted instead of adding more rows or columns.
Proposed technical implementation details
No response
Hello, Like do you want to adjust font size based on window size and when resizing it should automatically adjust font. Correct?
Hi,Yeah that sounds about right.Set the row and column size on load, and then when the window is resized don’t increase or decrease the number of rows or columns, but only change the font size.Does that make sense?On 10 Jan 2025, at 23:14, Nikhil B Patil @.***> wrote: Hello, Like do you want to adjust font size based on window size and when resizing it should automatically adjust font. Correct?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@kalyxnz sorry I am not able to understand it! Can you give a small example?? It would be helpful Also mac and Linux terminal font size changes as we resize window but till certain level! Do you mean that?
@kalyxnz can you explain please?
Hi sorry for the slow reply.
I will describe the intended behaviour:
Set "Columns" and "Rows" in the settings to desired numbers e.g. 100 Columns 40 rows This would be at whatever the "Default Font size" is initially so that the window can open on the screen.
Then, a setting to lock those column/row numbers, so that even when the user resizes the window, the columns or rows do not either increase or decrease. Instead the size of the font either increases (effectively making everything larger looking) or the font size decreases (effectively making everything look smaller).
Hi @space-techy
I created the following GIF to help illustrate what I mean...
Hope this makes it a little clearer?
Thanks!
@kalyxnz yes it makes clearer now! Okay I will work on it! Also do you have any code pointers or area where I can find the code to this? Bcz reading whole lot of documentation is difficult for me! Also about this feature do we need to give an option where this would happen only when we turn it on or provide it universally?
@space-techy Sorry, someone else would have to point you in the right direction of where the relevant code is.|
A check box with something like: "Keep number of rows and columns static, only increase or decrease font size when window is resized"
@space-techy Any luck figuring out how to do this?
I don't know this part of the code base very well, but if I were going to attempt this feature, I'd start by looking at PR #3181, which added the "snap to character grid" functionality. Because I suspect this feature would work in a similar manner.
- You'd need to trap the window resize events.
- You'd then need to calculate the most appropriate font size for the new dimensions.
- You'd also need to adjust the final size, taking the the new font into account, to make sure the window still holds the original number of rows and columns.
Step two could be tricky, because it can't just be the largest font size that fits in the available space - it needs to take into account what kind of change is being made. For example, if I make the window wider, I would expect that to force a larger font, even though it wouldn't fit the current height - the height would have to grow automatically to make it fit.
Another approach that might work would be to allow the width and height to be changed independently, but have the font stretch to whatever aspect ratio best fits the resulting dimensions. However, I suspect that would require some kind of stretching operation in the renderer rather than a font size change, and that may be more complicated.