12

How do I use non-regular variant of a font in Ubuntu?

Simply stating, I was trying to use light variant of a font. However, I couldn't. Every time I select those light variant, Ubuntu reluctantly used the same regular one.

For example, Today, I was trying to use Dosis font. When I choose this using Ubuntu-Tweak (or Unity-Tweak-Tool), Ubuntu selected the light one. I wanted to use Medium one, since that was giving more contrast. But selecting Dosis-Medium gave the save light rendering!!

Lastly, I tried using fonts.conf in .config/fontconfig directory. I've put these lines in that file. Putting these lines forces Ubuntu to display medium variant, but then Every Dosis fonts become Medium. There is no way to use Light variant anymore.

  <match>
    <test name="family"><string>Dosis</string></test>
    <edit name="style" mode="assign" binding="strong">
      <string>Medium</string>
    </edit>
  </match>

In short, How can I select or use different variant of a font in Ubuntu. A solution using fonts.conf is also okay.

Output of fc-list 'Dosis'

    /usr/share/fonts/opentype/dosis/Dosis-Light.otf: Dosis:style=Light
    /usr/share/fonts/opentype/dosis/Dosis-SemiBold.otf: Dosis:style=SemiBold
    /usr/share/fonts/opentype/dosis/Dosis-Bold.otf: Dosis:style=Bold
    /usr/share/fonts/opentype/dosis/Dosis-Book.otf: Dosis:style=Book
    /usr/share/fonts/opentype/dosis/Dosis-ExtraBold.otf: Dosis:style=ExtraBold
    /usr/share/fonts/opentype/dosis/Dosis-ExtraLight.otf: Dosis:style=ExtraLight
    /usr/share/fonts/opentype/dosis/Dosis-Medium.otf: Dosis:style=Medium

Output of fc-match 'Dosis'

    Dosis-Medium.otf: "Dosis" "Medium"

Output of fc-match 'Dosis-Medium'

    Dosis-Medium.otf: "Dosis" "Medium"

Screenshot of Dosis font selecting light variant:

Dosis using light variant

If I use fonts.conf, all dosis become same

enter image description here

4
  • Have you tried copying the font file you want to use to another name and then using that one? E.G. sudo cp /usr/share/fonts/opentype/dosis/Dosis-Light.otf /usr/share/fonts/opentype/anwar.otf and then using font anwar?
    – Fabby
    Jun 30, 2015 at 8:43
  • No, I haven't. But as far as i know, font file name does nothing if font file include name within
    – Anwar
    Jun 30, 2015 at 11:29
  • @AnwarShah you might as well try.
    – Tim
    Jul 2, 2015 at 21:24
  • @Tim That didn't do anything
    – Anwar
    Jul 4, 2015 at 11:41

2 Answers 2

1

Testing here using Ubuntu 14.04, Ubuntu Tweak and the fonts-dosis package works. Selecting light, medium, bold all show different results. Although the light and medium look similar at 11pt even with my sharp eyes.

My desktop did however close itself and restart in a rather aggressive manor once a new font selection was made and I had to log back in again.

So I would delete your font.conf file and make your selections making sure to note how the font looks in the bottom font preview box of the selector window and not the distracting larger fonts in the list. Increase the size as needed. Select and then restart.

5
  • That was I saying. Medium and Light are exactly the same
    – Anwar
    Sep 5, 2015 at 8:07
  • They're not exactly the same, although they might look the same at certain resolutions and certain sizes. Sep 5, 2015 at 20:37
  • I have tested today with another font. when light variation is present, it picks up that one instead of medium variant. I checked this by setting medium variant as font, and then deleting the light one. after deletion and running fc-cache fonts immediately changed to medium.
    – Anwar
    Sep 6, 2015 at 11:47
  • 1
    Interesting test. Please report it as a bug help.ubuntu.com/community/ReportingBugs including all the details here. I do report it working on 14.04 Ubuntu so include that detail too. Sep 10, 2015 at 0:27
  • Will do in a while. I think, you also test this and support the bug if you can.
    – Anwar
    Sep 10, 2015 at 4:54
0

Fonts usually come compressed in several files, depending on the variations it includes: light, bold, medium, italic, italic-bold, etc.

If you're using a new font (e.g., a font not regularly packed in Ubuntu), you should install all its variations so you don't find any problems using them later.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .