1

I'm building a GO game with ncurses, in the game it is about 19 lines.
I want make ncurses adjust font size by size of the window to make it always display 19 lines.
How to do this in ncurses? Thanks

LoranceChen
  • 2,453
  • 2
  • 22
  • 48

1 Answers1

0

ncurses doesn't set the size of the terminal. If the terminal has at least 19 lines, you can set the LINES environment variable, to tell ncurses to use only the first 19 lines of the screen (but expect some clearing/printing outside that range, since that's not the intended use of the variable).

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • thanks.but It just use a block of terminal and font size is same as before. With another opinion, can I change terminal font size when open the process by some system setting which is not ncurses?and then I could init ncurses to make my terminal resize. – LoranceChen Feb 26 '18 at 23:18
  • sure - call `endwin`, then call *whatever* to change the font size and then `refresh`. But that *whatever* would be terminal-specific (and not a programming question any longer). – Thomas Dickey Feb 26 '18 at 23:26
  • Yes, It should be another topic about how to adjust terminal font size in C. I have create a new post in [here](https://stackoverflow.com/q/49000659/4887726).it's enough for ncurses part. – LoranceChen Feb 27 '18 at 03:35