0

I'm a newbie in Ubuntu.
And I want to change the fonts, size, color of console of CB. Please help me!

I'm a newbie in Ubuntu. And I want to change the fonts, size, color of console of CB. Please help me!!

PRATAP
  • 21,989
  • 8
  • 59
  • 121
Manh Hai
  • 13
  • 3

1 Answers1

0

I don't think that there is any one specific correct answer for this and it really is all about preference, but here is something I have come up with that might help. This answer is based on this answer that I wrote.

I recommend that you use any of the xterm terminal types. Probably the best one to use is rxvt-unicode

sudo apt install rxvt-unicode

Then in CodeBlocks go to Settings -> Environment... then in the Terminal to launch console programs add the following:

urxvt -T $TITLE -e

enter image description here

Now, to change the colors and the fonts add like the following to your ~/.Xdefaults file at the bottom:

URxvt*background: black
URxvt*foreground: white

Then one of the fonts that I kind of like is a monospace font and you can add it like the following below the above 2 lines:

URxvt*font: xft:Monospace:size=9:antialias=true

Save the .Xdefaults file and now you should get something looking like this:

enter image description here

Or you can change background colors to whatever you want. Here's Cyan with Black text:

URxvt*background: cyan
URxvt*foreground: black

enter image description here

If you want to play around with different fonts that you can run from a terminal window:

fc-list | sort

And it should give you a list of available fonts. Probably best to stick with any of the Mono type fonts.

Hope this helps!

Terrance
  • 39,774
  • 7
  • 116
  • 176
  • My english is not good enough. Could you explain more from " Now, to change the colors and the fonts add like the following to your ~/.Xdefaults file at the bottom...", please.... – Manh Hai Feb 26 '19 at 14:51
  • @ManhHai Try looking at my linked older answer of https://askubuntu.com/questions/882405/how-do-i-change-rxvt-colors-to-white-on-black/882415#882415 where I try to go deeper in details of changing fronts and colors to the terminal. – Terrance Feb 26 '19 at 15:02
  • how can i open ~/.Xdefault file ? – Manh Hai Feb 26 '19 at 15:04
  • @ManhHai Use whatever editor you want like `gedit ~/.Xdefaults` or `nano ~/.Xdefaults` – Terrance Feb 26 '19 at 15:05
  • by the way, could you help me to change the theme and the color on surrounding? – Manh Hai Feb 26 '19 at 15:14
  • @ManhHai I think you are running GNOME and it is just the theme that you choose to change the looks. See: https://wiki.ubuntu.com/UbuntuGNOME/HowTo#Theme I am running Xfce4 as my Desktop Environment so its themes are different and changed differently. You can always ask a new question on this site for changing themes or the look and feel of your desktop. – Terrance Feb 26 '19 at 15:19