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:
If I use fonts.conf
, all dosis become same
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.