Fonts are mapped to ugly fonts (which also causes problems with OOo)

Bug #41411 reported by Daniel James
78
This bug affects 5 people
Affects Status Importance Assigned to Milestone
fontconfig (Ubuntu)
Incomplete
Medium
Unassigned
Hardy
Invalid
Medium
Unassigned

Bug Description

/etc/fonts/fonts.conf mapps the following fonts:

Times to Nimbus Roman No9 L
Helvetica to Nimbus Sans L
Courier to Nimbus Mono L

The problem with this is that the Nimbus set of fonts renders really badly (on my machine at least). The fonts appear with blue pixels to the right of about 50% of letters.

Can these be changed to map to DejaVu or Bitstream fonts instead? DejaVu and Bitstream map beautifully.

I'll attach screenshots of these current fonts in action.

Tags: patch
Revision history for this message
Daniel James (daniel-netbreeze) wrote : The problem

This is a screenshot of the problem. I've also zoomed a section of the screenshot so that it is easier to see.

Please note that this is on an lcd monitor.. so there is sub-pixel anti-aliasing turned on..

Revision history for this message
Daniel James (daniel-netbreeze) wrote : Proposed Fix

A patch to change the fonts over to the DejaVu set.

Revision history for this message
William Grant (wgrant) wrote : Re: Fonts are mapped to ugly fonts

That's sub-pixel antialising for you. A bit of an odd way to antialias (with the blue), admittedly, but that seems to be what you get.

Revision history for this message
Julien Olivier (julo) wrote :

I've juste noticed the exact opposite on my laptop:

by default, the font configuration is set to "Best Shapes" although I'm on a laptop (is it a bug ?) and the Nimbus Roman font is crippled with blue pixels (exactly like on the picture reported). Then, I selected "Subpixel Smoothing", restarted Abiword and OpenOffice, and noticed that the blue pixels were no longer there.

So, there are two possible bugs:
 - whether the font configuration should be set to "Subpixel Smoothing" automatically when a laptop is detected
 - or the default font should be anything other than Nimbus Roman (at leats on laptops)

Revision history for this message
Daniel James (daniel-netbreeze) wrote :

Sorry guys.. I had *assumed* that sub-pixel antialiasing was on. It was not. After turning it on, firefox and openoffice both render nimbus much more nicely. However!

Epiphany still does not 8-| how weird is that!

May need to file a bug report against epiphany also..

Daniel

Revision history for this message
Matthias Klose (doko) wrote :

> - or the default font should be anything other than
> Nimbus Roman (at leats on laptops)

definitely not. Nimbus is the best free font for printing, so it should stay the default for applications like OOo.

Our default font DejaVu is metric incompatible with fonts like Times, Helvetica, Arial, Verdana, Times Roman, so every time one of these fonts is missing (i.e. in the default installation), we have to have a fallback font, which displays accurately. If you know of a better metric choice, please propose one. DejaVu and Bitstream Vera are not.

Revision history for this message
Daniel James (daniel-netbreeze) wrote :

I suppose my main problem is that it doesn't seem to fall back to nimbus - but it chooses it by default. If I install the MS web fonts, I would prefer to display Timed New Roman instead of Nimbus (I chose to install the MS fonts so I'm not opposed to non-free).

Is this a possibility?

Revision history for this message
Julien Olivier (julo) wrote :

>> - or the default font should be anything other than
>> Nimbus Roman (at leats on laptops)

> definitely not. Nimbus is the best free font > for printing, so it should stay the default for > applications like OOo.

Then, as I said, the font configuration should be set to "Subpixel Smoothing" automatically when a laptop is detected. Without it, Nimbus is really ugly on laptops.

Revision history for this message
Chris Cheney (ccheney) wrote :

Why does Times remap to Nimbus even when Times New Roman is installed? This is causing major problems with formatting in OpenOffice because the sizing is apparently different. I am marking this as hardy targeted since something needs to be done before release. Apparently the liberation fonts are supposed to be perfect matches but they are in multiverse for some reason. I haven't looked into why yet but they are supposedly GPL'd fonts.

Some related bugs:

https://bugs.edge.launchpad.net/ubuntu/+source/openoffice.org/+bug/126784

http://qa.openoffice.org/issues/show_bug.cgi?id=85394

Thanks,

Chris Cheney

Changed in fontconfig:
importance: Medium → High
status: New → Confirmed
Revision history for this message
Chris Cheney (ccheney) wrote :

I'm sorry for the seemingly conflicting opinion on whether Nimbus should be the remapped font for Times on OOo, it appears that since Matthias said that a couple years ago that using that substitution is actually a bad idea due to page layout reasons which have shown up after the change. There is also a bug in that OOo shouldn't be defaulting to using 'Times' as a font since there is no 'Times' font installed which has caused this issue to become a much bigger issue since if a user creates a document with 'Times' on Ubuntu with the Nimbus substitution and then tries to move it to some other system it will not layout the same due to incorrect(?) metrics of Nimbus.

Chris Cheney (ccheney)
Changed in fontconfig:
milestone: none → ubuntu-8.04-beta
Revision history for this message
Chris Cheney (ccheney) wrote :

I saw another Bug 109256 which mentioned that the oo-welcome.odt grew in size between 6.10 and 7.04 and after looking at it uses Nimbus Roman No9 L as the main font. After changing it to Times New Roman (using non-free fonts) it went back to the size it should be (2 pages instead of 3). So did Nimbus Roman No9 L change metrics (or whatever?) since Ubuntu 6.10? Unless something weird is happening in OpenOffice it would seem that would be the most likely cause of both issues.

Revision history for this message
Steve Langasek (vorlon) wrote :

This bug report was originally about a rendering issue with the Nimbus fonts (an issue which I think has been resolved); it would have been less confusing to open a new report for the mapping question.

According to /etc/fonts/conf.d/30-metric-aliases.conf, the preferred mapping for Times is Nimbus Roman No9 L, and only if it's unavailable is a fallback to Times New Roman used. This makes sense to me, as Times and Times New Roman are not the same font. I'm not sure why you're expecting Times to map to Times New Roman instead of to Nimbus?

The Liberation fonts are also not given preference over Nimbus for the "Times" family, only for the "Times New Roman" family. This seems consistent to me.

> There is also a bug in that OOo shouldn't be defaulting to using 'Times' as a font
> since there is no 'Times' font installed which has caused this issue to become
> a much bigger issue since if a user creates a document with 'Times' on Ubuntu
> with the Nimbus substitution and then tries to move it to some other system it
> will not layout the same due to incorrect(?) metrics of Nimbus.

What are these other systems using to implement "Times"?

I'm not sure how this bug can be resolved, either in OpenOffice or in fontconfig. It looks to me like it's a bug in other systems for assuming Times == Times New Roman, and that they're metric-compatible. You could change the OOo package to default to Times New Roman instead of Times to address this assumption elsewhere, but it looks like we would still have the problem that we don't have any TNR fonts installed by default, so the resulting documents would still render differently on systems with TNR than on those without. Until/unless we can resolve that, I think the current behavior of both OOo and fontconfig is probably correct, since in that case the document is at least rendered correctly on the *author's* computer even if it's mis-rendered elsewhere.

Revision history for this message
Lex Ross (lross) wrote :

I have noticed the same problem with fonts rendering on my Asus F5N laptop regardless "Best shapes" (default) or subpixel dithering settings. It is especially noticeable in Terminal and OpenOffice, and gives real strain on my eyes. Reboot into 7.10, and the fonts are all smooth and beautiful. I wonder if its the new X server, nVidia driver or anything else, as blue pixels appear only for menu font, and not against white background, and I do not observe /etc/fonts/fonts.conf mappings described in the original post.

Revision history for this message
Lex Ross (lross) wrote :

Also noticed that same 10pt fonts are way too big in Hardy. Had to change them to 9pt to make fonts look comparable to 7.10
Now attaching screenshots, as the problem is definitely with rendering. First, look at enlaged screenshot form 7.10

Revision history for this message
Lex Ross (lross) wrote :

And now how it looks in Hardy (with all updates installed). Notice the shadows that were not present in Gutsy. Also, there is no real subpixel dithering now (both screenshots are with "Subpixel smoothing" option turned on). Fonts are pure black, just blurred. I put correct DPI for my LCD panel for nVidia driver in /etc/X11/xorg.conf as I had to do in Gutsy but it did not help this time.

Revision history for this message
Keenan Pepper (keenanpepper) wrote :
Revision history for this message
Lex Ross (lross) wrote :

Thanks, Keenan. Thought using gnome-terminal as an example was a bad idea. Actually, Open Office has exact same problem with all its fonts, both menu and within documents. Firefox is also hit producing bad fonts on pages that use Arial, Tahoma and Courier New font-family style sheets. Wrong size for fonts to start with (1pt bigger than they should be). So what do you think is the root cause for the fonts not being rendered correctly?

Revision history for this message
Chris Cheney (ccheney) wrote :

Ok, well if Times and Times New Roman are different sizes then there definitely is a bug somewhere else that maybe just looked like it was solved due to 'mismapping' of Times -> Nimbus. Sorry for the confusion, and yes there are other fontconfig related problems with OOo, maybe some of those will cause the apparent problem with sizing to be resolved.

Revision history for this message
Steve Langasek (vorlon) wrote :

unmilestoning; based on last comment from Chris, this doesn't appear to be the bug that's causing problems for OpenOffice.

Changed in fontconfig:
importance: High → Medium
milestone: ubuntu-8.04-beta → none
Revision history for this message
jkuhnert (jkuhnert) wrote :

I must admit that it was a bit of a shocker today upgrading to hardy and attempting to visit my favorite web sites (or not so favorite applications I have to work on) to discover that many of them were defaulting to this hideous unknown font if one was not explicitly set that the default hardy install likes.

For instance, visiting this web site should make the ugly font in question very obvious:

http://planetapache.org/

The creator of that particular blog-roll package (and site maintainer) even mentions this casually here:

http://www.intertwingly.net/blog/2008/03/21/Hardy-Heron-Beta-on-T61P

I'm sure everyone is well aware of the differences in rendering. Maybe a small set of common aliases for things like verdana,arial,helvetica,etc were there in fiesty but not in hardy. If that is the case - I might suggest that this decision be re-thought. There are a ~lot~ of web sites I browse in my daily crawls that revert to said ugly font and it's doubtful all of them will notice my pain and change their css stylesheets to reflect this. (though I can fix my own ugliness at tapestry.apache.org thankfully)

I don't even remember what the default font setup was like in feisty anymore because after installing whatever black magic is contained here - http://ubuntuforums.org/showthread.php?t=343670 - I never had to think about it again.

Don't get me wrong, the fonts look ok enough but the differences between the default rendering here and that in os x/windows/etc is enough to make me seriously consider moving to a different platform for my dev box just to be on the safe side. (i've tried ms true type fonts on many occasions with many different distros and have never liked the results. the letter spacing is always wrong even if the the characters are rendered correctly individually) Thankfully my code editor was already using Bitstream Vera Sans which is still around so that part of my day hasn't been traumatized too much.

sorry if I sound negative, am only sharing pragmatic facts and such. think you guys are doing a great job and will hope for the best

Revision history for this message
jkuhnert (jkuhnert) wrote :

Nevermind...I've discovered that through the wonderous powers of scp it is possible to simply copy over all fonts you would like to have available to your "~/.fonts" directory and run "fc-cache -fv ~/.fonts" to have your fontconfig update your cache configurations. Only fonts that you have purchased or are free of course, don't even think about scp'ing those macbook or windows *.ttf files over - because that wouldn't be legal - even if it does work.

Revision history for this message
Dan McGuirk (incandenza) wrote :

Has something changed here between Gutsy and Hardy? In Gutsy, I seemed to have all DejaVu fonts in Firefox. In Hardy, I'm getting the Nimbus fonts for the fonts mentioned (Times, Helvetica, Courier), which look pretty bad.

Strangely, even if I copy my Gutsy /etc/fonts back over, it still wants to go to Nimbus (and yes, I cleared the cache, etc.). The only way I've found to get rid of the Nimbus fonts is to completely remove the /usr/share/fonts/type1/gsfonts directory.

I don't know if it's truly correct and proper to use the DejaVu fonts here or not; all I know is the Nimbus ones look terrible on my screen.

Revision history for this message
Jan Jergus (janjergus) wrote :

While the fonts with correct metrics might be the best option for OpenOffice & printing, they look much worse in small sizes on screen. See the attached image for comparison, both with and without subpixel smoothing. I believe DejaVu should be default, with possible exception of OpenOffice and other DTP applications.

Revision history for this message
Chris Conway (cconway) wrote :

I've started a thread on the forums (http://ubuntuforums.org/showthread.php?t=804242) asking for a work-around for this problem. In particular, I'd like to set up the fonts on my system so that Nimbus is not displayed on screen (or, at the very least, in Firefox) unless it is explicitly asked for. If anybody subscribed to this bug has a solution, I'd love to hear it.

Revision history for this message
Chris Conway (cconway) wrote :

The attached patch seems like a reasonable solution to me. Nimbus fonts should only be chosen if metric-compatibility with the Postscript fonts is required.

Revision history for this message
Tobias Wolf (towolf) wrote :

Shouldn't you break the link between Arial and Helvetica instead? Those aren't metric compatible. And If someone requests a match for "Helvetica" it is likely that they expect a PostScript Type1 font.

Revision history for this message
jbatista (jmnbatista) wrote :

I've installed Intrepid about a month ago, and began populating my comp with packages outside of the Canonical repo.

My personal preference goes to FreeSans and FreeSerif instead of the Nimbus fonts. So, after some searching here and there, I've found that if I add/edit a file in /etc/fonts/local.conf with entries similar to /etc/fonts/fonts.conf, I can replace (at least in OOo 2.4.1) the fonts not only in Writer (which is possible through OOo's Preferences menu) but also in other components. See appended local.conf.

Revision history for this message
jbatista (jmnbatista) wrote :

Oops, the Attach doesn't work too well... I'm pasting it here instead and hoping for the best.
Edit the file with sudo gedit /etc/fonts/local.conf and wait about 30 seconds before trying with OOo. As always, Your Mileage May Vary but I hope this benefits/helps others.

<!-- /etc/fonts/local.conf -->
<fontconfig>

<!-- Change the default Sans and Serif fonts in OpenOffice.org to the fonts from the ttf-freefont package. -->
 <match target="pattern">
  <test qual="any" name="family"> <string>Nimbus Sans L</string> </test>
  <edit name="family" mode="assign"> <string>FreeSans</string> </edit>
 </match>
 <match target="pattern">
  <test qual="any" name="family"> <string>Nimbus Roman No9 L</string> </test>
  <edit name="family" mode="assign"> <string>FreeSerif</string> </edit>
 </match>

</fontconfig>

Revision history for this message
Forest (foresto) wrote :

Tobias Wolf wrote:
> Shouldn't you break the link between Arial and Helvetica instead?
> Those aren't metric compatible.

How far off is Arial from Helvetica? This wikipedia page says they have identical widths.
http://en.wikipedia.org/wiki/Helvetica#Similar_typefaces

> And If someone requests a match
> for "Helvetica" it is likely that they expect a PostScript Type1 font.

What makes you think that? I run into web pages pretty regularly which request Helvetica followed by Arial, and since Ubuntu maps Helvetica to Nimbus Sans L, Arial is ignored and the page looks like hell. (It's even worse for me because I disabled antialiasing and enabled real hinting to make the MS fonts look crisp, which exposes the full ugliness of Nimbus.) Here's an example of such a web page:

http://code.google.com/appengine/
http://code.google.com/css/codesite.pack.01312008.css

I'll take Arial over Nimbus Sans L for screen rendering any day of the week, as (I suspect) would many other desktop users. Sadly, it took hours of reading, searching, trial and error to figure out how to make it happen. I doubt most users would have the patience; more likely they'd just live with the awful fonts and quietly blame Ubuntu for a job poorly done.

For the record, my temporary workaround was to put this in ~/.fonts.conf :

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <alias binding="same">
        <family>Helvetica</family>
        <prefer><family>Arial</family></prefer>
    </alias>
</fontconfig>

Revision history for this message
Dmik (dmik-for-maillists) wrote :

May I ask why is this bug still unassigned? Isn't it necessary to move it to karmik where the situation is still the same? These Nimbus fonts are really anti-aesthetic (to my taste, no matter anti-aliased or not) and there is no clean way to uninstall them which I'd really prefer.

Revision history for this message
LoonyPhoenix (loonyphoenix) wrote :

Get rid of the Nimbus aliases. Please! These fonts are ugly, very ugly.

Daniel Hahler (blueyed)
Changed in fontconfig (Ubuntu):
status: Confirmed → Triaged
tags: added: patch
Revision history for this message
Felix Geyer (debfx) wrote :

This is how Nimbus Sans L looks like with font size = 11px in Firefox on Kubuntu.
It is practically impossible to read websites that use Helvetica and a small font size.

Is it really worth keeping those rules that map fonts to Nimbus?

Revision history for this message
Felix Geyer (debfx) wrote :

The attached patch removes the Nimbus mapping rules.

Revision history for this message
Felix Geyer (debfx) wrote :

Here is another screenshot that shows packages.ubuntu.com which surprisingly prefers Microsoft fonts ("Verdana,arial,helvetica,sans-serif").
Verdana and arial aren't found on the system so helvetica is used which is mapped to Nimbus.

Revision history for this message
Hannes Kuhnert (hannes-kuhnert) wrote :

Of course if Helvetica isn’t installed, it has to be mapped to Nimbus Sans, because Nimus Sans is a clone of Helvetica etc.

Font rendering doesn’t seem to be well configured on your machine (respecitvely in the application from which you’ve taken the screenshot). Maybe the hinting is too strong.

I attached a better-looking screenshot of Nimbus Sans in small size.

Revision history for this message
Hannes Kuhnert (hannes-kuhnert) wrote :

again the screenshot, now hopefully with correct MIME type

Revision history for this message
Felix Geyer (debfx) wrote :

Proposed debdiff to fix this bug:

fontconfig (2.8.0-2ubuntu2) lucid; urgency=low

  * add debian/patches/08_no_nimbus_mapping.patch: remove mapping to
    Nimbus fonts as they are rendered very poorly (LP: #41411)

 -- Felix Geyer <email address hidden> Fri, 19 Mar 2010 11:29:39 +0100

Revision history for this message
Felix Geyer (debfx) wrote :

@Hannes:
The screenshots are from Firefox 3.6 on Kubuntu Lucid (both with default configuration).

Nimbus renders very poorly on a small font size.
Please take another screenshot with font size 11px.
For example: http://debfx.fobos.de/nimbus.htm

Revision history for this message
Tobias Wolf (towolf) wrote :

Firefox in Lucid has broken font rendering at the moment, so these screenshots are not suitable examples.

Revision history for this message
Felix Geyer (debfx) wrote :

I haven't noticed any font rendering issues in Firefox but in Konqueror Nimbus Sans L looks exactly the same.

Revision history for this message
Hannes Kuhnert (hannes-kuhnert) wrote : Re: [Bug 41411] Re: Fonts are mapped to ugly fonts (which also causes problems with OOo)

Here are screenshot of your Nimbus Sans page in Konqueror 4.4.1, one without
and one with light hinting.

Felix Geyer (debfx)
Changed in fontconfig (Ubuntu):
status: Triaged → Incomplete
Changed in fontconfig (Ubuntu Hardy):
status: Confirmed → Incomplete
Revision history for this message
Chris Cheney (ccheney) wrote :

This is at least partially fixed by adding ttf-liberation to the ubuntu-netbook, kubuntu-desktop, kubuntu-netbook seeds, so that the Microsoft fonts will always have sane font substitution.

Revision history for this message
Marcin Kulik (sickill) wrote :

@Forest: thx for the workaround, works perfectly!

Revision history for this message
James (james-ellis-gmail) wrote :

@Forest note on user level font.conf works around the Nimbus rendering issues.

just run fc-cache -f -v to update the fontconfig cache afterwards and refresh your browser page.

Oddly this problem only appears in Firefox 3&4. Both Chrome and Opera correctly detect that Helvetica is not installed and default to the backup fonts (usually Arial, Verdana, Tahoma etc in the case of CSS - " font-family : Helvetica, Arial, Tahoma, Verdana, sans-serif; ")

The trouble with this default aliasing to Nimbus is that for CSS authors who specify Helvetica as a first level font choice on their sites, any users with the default setup viewing the site will get Nimbus font rendering. The replacement of Helvetica with Nimbus fools Firefox into thinking that Helvetica is installed on the system.
Comparing Helvetica on a Mac with 'Helvetica (Nimbus)' in FF/kUbuntu is no contest and there is no way that Nimbus is a valid replacement for Helvetica.

Taking out the Helvetica rule in CSS using Firebug in FF3 and 4 will 'fix' the font as it will fallback to backup fonts like Arial or Verdana which are part of the MS font pack.

Revision history for this message
shankao (shankao) wrote :

Thank you for reporting this bug to Ubuntu. Hardy reached EOL on May 9, 2013.
See this document for currently supported Ubuntu releases: https://wiki.ubuntu.com/Releases

Changed in fontconfig (Ubuntu Hardy):
status: Incomplete → Invalid
Revision history for this message
Jean-Pierre Rupp (xenog) wrote :

I learned that the system was mapping Times and Helvetica to Nimbus equivalents, and that was messing up some websites. On-screen display of Nimbus fonts in Linux is not ideal, even if I disable hinting. They have a way to look awful. I changed the mappings to use Liberation fonts, and the result is much more harmonious text on websites. Nimbus can look really bad on small sizes.

To post a comment you must log in.