Setting aside licensing/freedom issues, the MS fonts don't render as well as Liberation/DejaVu with subpixel smoothing turned on.Not sure if this might help you, but did you check out in synaptic the package called: msttcorefonts ?
Setting aside licensing/freedom issues, the MS fonts don't render as well as Liberation/DejaVu with subpixel smoothing turned on.Not sure if this might help you, but did you check out in synaptic the package called: msttcorefonts ?
Hmm, well, I went all through this with FC_DEBUG trying to figure out what was going on.
For one thing, neither Firefox nor evince ever sets the 'anymetrics' flag that I can see. Because of the qual="all" tag on the 'anymetrics' test, if the anymetrics flag does not exist the condition always evaluates to true, whether you are comparing against true or false (because 'all' of the values for anymetrics, of which there are none, evaluate to anything). So I don't think these tests mean what they're supposed to.
In fact, I don't really see how you can do a proper test against a possibly-missing key with this "qual" tag. qual="any" always gives false for any condition if the tag is missing, and qual="all" always gives true.
The only reason the test on anymetrics does anything, as far as I can tell, is that it changes the reference to Nimbus from 'strong' to 'weak', which gives it less precedence. It's almost the same as just commenting it out.
Anyway, it doesn't matter, because without the anymetrics key set there's no way to distinguish the context anyway. I wound up just putting strong bindings directly for DejaVu from Helvetica, Times, and Courier in my fonts.conf, and removing Liberation. I guess if I want evince to work properly, I'll move my .fonts.conf temporarily out of the way before running it.
At least I figured out how to get what I want using just the .fonts.conf and not having to edit /etc/fonts.
EDIT: Also, I don't think your .fonts.conf actually overrides Liberation in Firefox--are you sure that it does? At least, that does not seem to be possible here. The way Firefox asks for the font is different than what 'fc-match' does, and the weak binding in the .fonts.conf doesn't seem to be able to override the strong one for Liberation.
Last edited by incandenza; May 27th, 2008 at 08:33 PM.
incandenza, You're right. With
or withCode:<match target="pattern"> <test name="family"> <string>Times</string> </test> <test name="anymetrics" qual="all" compare="eq"> <bool>true</bool> </test> <edit name="family" mode="assign"> <string>DejaVu Serif</string> </edit> </match>
in ~/.fonts.conf, I get DejaVu Serif in Firefox. WithCode:<match target="pattern"> <test name="family"> <string>Times</string> </test> <edit name="family" mode="assign"> <string>DejaVu Serif</string> </edit> </match>
I get Liberation Serif.Code:<test name="anymetrics" qual="any" compare="eq"> <bool>true</bool> </test>
There are several separate issues here:
- The Nimbus fonts render poorly. This is probably due to a lack of hinting support in legacy Postscript fonts.
- The Nimbus and Liberation fonts are too small by default, effectively much smaller than DejaVu at the same nominal point size (see attached).
- Fontconfig has buggy anymetrics support and/or Fontconfig clients don't consistently provide appropriate anymetrics parameters
Unfortunately, the Nimbus and Liberation fonts seem to be the only metric-compatible replacements for the standard Postscript and Microsoft fonts that are used in many web, PS, and PDF documents, so replacing them with DejaVu fonts universally isn't a good option.
True, it is not really a "good" solution, but it is the best available solution I have at the moment, unless someone can explain to me how to do something better. Switching from Nimbus to Liberation is not a real improvement for me, but just a sideways shift.
I suppose I could just give up and use the msttcorefonts, but I'm not too thrilled about that either.
The thing is, for some reason this worked fine under Gutsy; Firefox never used the Nimbus fonts there. I tried to figure out what changed, even copying my old /etc/fonts directory over, but I could never make it work the same since Hardy.
EDIT: Actually I suspect there is some bug in the fontconfig code itself that causes a slight change in behavior between the Gutsy version and the Hardy version, even with the same config files. Problem is, this whole system is so nightmarishly complex that I doubt many people fully understand what it's supposed to be doing, much less are able to identify a minor change in behavior. If you try to follow through even the choice of a single font through these FC_DEBUG printouts, it's just ridiculous.
Last edited by incandenza; May 27th, 2008 at 10:31 PM.
I came up with an unrelated fix that might be better:
raise the DPI setting in System -> Preferences -> Appearance -> Fonts -> Details and turn on autohinting withThis drastically improves the rendering of the Nimbus and Liberation fonts. They're still too small in Firefox, but at least they aren't hideous to behold.Code:sudo ln -s /etc/fonts/conf.avail/10-autohint.conf /etc/fonts/conf.d
So, when i understand it right, we want to change the Nimbus and Liberation-family to Dejavu (or Bitstream in my case) only for Firefox. I solved it that way:
1) cp /etc/fonts/fonts.conf /etc/fonts/fonts.conf.firefox
2) append the whole configuration on the end of /etc/fonts/config.avail/30-metric-aliases.conf to the new fonts.conf.firefox. that means all between <fontconfig> </fontconfig>.
3) replace in fonts.conf.firefox all
Nimbus Roman No9 L and Liberation Serif to DejaVu Serif or Bitstream Vera Serif
Nimbus Sans L and Liberation Sans to DejaVu Sans or Bitstream Vera Sans
Nimbus Mono L and Liberation Mono to DejaVu Sans Mono or Bitstream Vera Sans Mono
4) edit /usr/bin/firefox and append under #!/bin/sh the row
'export FONTCONFIG_FILE=/etc/fonts/fonts.conf.firefox' (without ')
5) restart firefox
thats it =)
Last edited by m-y-t-h-o-s; August 10th, 2008 at 05:07 AM.
A belated thanks for that last tip. I wasn't aware of the FONTCONFIG_FILE variable. Now I can change the fonts the way I like just for Firefox, and leave everything else alone.
Thanks!
Bookmarks