Updated Answer
A tool specifically developed for such task is pyfontfixer
(This is the tool I actually used and forgot it's name and question is just to find it. Now I found it). It is pretty straightforward. Here is a screenshot of this tool.
Old Answer
One such tool available for Linux is Font-Manager. It can be installed on Ubuntu using command
sudo apt-get install font-manager
or from Software Center. Open up this software and click on the Set Font Preference button on bottom of it and Select Alias Editor
Then on the new window, click on the Add Alias button and type the generic name of the family, such as sans-serif
, then click Add Substitute button and type or select the font name you want to replace with.
It should now replace the generic family sans-serif
with the selected font.