There are lots of sans fonts in Ubuntu, for example "Liberation Sans", "FreeSans", "Deja Vu Sans", "Noto Sans". But who made the one that is just called "Sans" and which package is it from?

screenshot of the sans font

share|improve this question
    
I see also "Serif" in your screenshot... Which tool are you using? – Gunnar Hjalmarsson Feb 19 '17 at 21:51
    
Maybe fc-match sans is what you need? That command gives me DejaVuSans.ttf: "DejaVu Sans" "Book". – edwinksl Feb 19 '17 at 21:56
up vote 5 down vote accepted

Font names in Ubuntu are managed by library named fontconfig. fontconfig has a notion of aliases; four of those aliases are sans, sans-serif, serif, and monospace. To see what actual fonts are pointed to by those aliases use the command fc-match:

$ fc-match sans-serif
DejaVuSans.ttf: "DejaVu Sans" "Book"
$ fc-match sans
DejaVuSans.ttf: "DejaVu Sans" "Book"
$ fc-match serif
DejaVuSerif.ttf: "DejaVu Serif" "Book"
$ fc-match monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

To modify the meaning of the standard aliases sans, sans-serif, serif and monospace you must create or edit a per-user configuration file, ~/.config/fontconfig/fonts.conf (or ~/.fonts.conf, depending on fontconfig version and system configuration). (You can of course edit the system-wide configuration file, but that would be rude.) For example,

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer><family>Liberation Serif</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Liberation Sans</family></prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer><family>Liberation Sans</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>Liberation Mono</family></prefer>
  </alias>
</fontconfig>

See a worked out example at How to Set Default Fonts on Linux on Season of Code.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.