Default monospace font

Asked by Bogdan Butnaru on 2007-02-24

Hi! I recently installed some font packages from the Ubuntu repositories --- not because I really needed to, I just happened upon them while searching for other packages.

The problem now is that the monospace font changed, and I can't tell what package did it. The original monospace font (the one that came with the Ubuntu install) was very pretty (according to my tastes), and I got very used to it. The font selector only called it "Monospace", and I never found out what's its real name. The new one is very "thin" and I really dislike the letter shapes.

I'll try to uninstall some of the fonts I added, but I'd really like to know what's the default monospace font and what package provides it.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Bogdan Butnaru
Solved:
2007-02-26
Last query:
2007-02-26
Last reply:
2007-02-26

You probably installed the msttcorefonts. Many web sites set Courier New as their default monospace font. Unfortunately, it is a very spindly font and with the level of anti-aliasing provided by the default font rendering settings or if you have changed the font rendering settings to accommodate an LCD display, the font is unreadable at small and medium sizes.

A solution to replace your monospace font permanently to the one used before you added msttcorefonts, which added Courier New, is to create a file called .fonts.conf in your home directory (note the starting dot, that makes hidden by default) with the following contents:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="pattern" >
  <test name="family" >
   <string>Courier New</string>
  </test>
   <edit mode="replace" name="family" >
   <string>DejaVu Sans Mono</string>
  </edit>
 </match>
</fontconfig>

To create the file, open a terminal window and type

<editor> .font.conf

paste the above text and save. <editor> is your preferred text editor. If using the GNOME desktop, gedit is your best bet. If using KDE, kwrite or kate will do, for XFCE, use mousepad instead.

Best Bogdan Butnaru (bogdanb) said : #2

I did install the msfonts, but that wasn't the exact problem. I wasn't very clear in my description.

In the "Font Preferences" window (there's an applet in the Control Center) you can pick the default "Fixed

Bogdan Butnaru (bogdanb) said : #3

(sorry, I mis-clicked the add-comment button).

I did install the msfonts, but that wasn't the exact problem. I wasn't very clear in my description.

In the "Font Preferences" window (there's an applet in the Control Center) you can pick the default "Fixed width font". By default the font selected there is called simply "Monospace".

I checked after your message, and indeed it seems to be identical to DejaVu Sans Mono. I suppose it might be an alias of some sort, but I have no idea how it works.

My problem was caused by the package ttf-georgewilliams, which happens to contain a font called "Monospace", and which took the place of the default.

So the solution to my problem would be either to remove that package or to pick DejaVu Sans Mono as the fixed-width font.

Incidentally, there is also a family of fonts called just "Sans" (containing the usual normal/bold/italic/bolditalic versions), which is identical to "DejaVu Sans" (that, interestingly, contains stranger varieties like book/oblique/extralight/condensed). I'm curious how that aliasing is done. I couldn't find any like-named links in the fonts folder, nor any files named the way you suggested.

(BTW, the substitution for web pages is a nice trick, I should try that.)

jfbilodeau (jfbilodeau) said : #5

Thank you! Thank you! Thank you!

I could not figure out for the life of me what font cause my monospace to look so ugly. Uninstalling ttf-georgewilliams fixed the problem for me.

I think some more QA may be required with the ttf-georgewilliams.

J-F