How can I change the font size of a printed font using c?
printf ("%c", map[x][y]);
I want to print an array larger than all the other text in the program. Is there a way to just make that statement print larger?
You change the console window, by opening it, and then right clicking on the top bar of the window, and choosing either "Properties" or "Default". They both have the same settings for both color and font, but any change you make will be temporary, (one time only), if you choose "Properties".
Right Click the top bar of the Command Prompt Window (i.e. Right Click the words "Command Prompt" on the top left) and select Properties. There you can change Font, Size, Color and other options. Please let us know the results and if you need further assistance. Was this reply helpful?
To change the font size of AWS CloudShell, click on the gear icon in the upper right corner of the AWS Console. Note: The gear icon is actually called the preferences button. This will show the preferences panel.
Go to the menu in RStudio and click on Tools and then Global Options. Select the Appearance tab on the left. Again buried in the middle of things is the font size. Change this to 14 or 16 to start with and see what it looks like.
Although teppic's answer to use system()
will work, it is rather intensively heavy-handed to call an external program just to do that. As for David RF' answer, it is hard-coded for a specific type of terminal (probably a VT100-compatible terminal type) and won't support the user's actual terminal type.
In C, you should use terminfo capabilities directly:
#include <term.h>
/* One-time initialization near the beginning of your program */
setupterm(NULL, STDOUT_FILENO, NULL);
/* Enter bold mode */
putp(enter_bold_mode);
printf("I am bold\n");
/* Turn it off! */
putp(exit_attribute_mode);
Still, as teppic notes, there is no support for changing the font size. That's under the user's control.
If you are under some unix, you can try to activate and deactivate bold text:
printf("\033[1m%c\033[0m", map[x][y]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With