how to add font in ubuntu

C++
# Copy the fonts to /usr/local/share/fonts or a subfolder
# (such as /usr/local/share/fonts/TTF) and 
# then run sudo fc-cache -fv. There are some graphical programs
# you can install to make this easier, but I've never felt the need
# to try any of them. 
# The Ubuntu wiki page on Fonts here may be of help too.
Source

Also in C++: