Ubuntu – The font in Ubuntu which is just called “Sans”

fonts

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

Best Answer

  • 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.

  • Related Question