LinuxQuestions.org Member Success StoriesJust spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks to someone from the ubuntu mailing list, i found the issue with the recent builds in firefox wich caused the font config settings not to work... font sizes must be guiven in "pixelsize".
So without delay, my simple and very effective fonts.conf
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>~/.fonts</dir>
<!-- Disable antialiasing of chosen fonts upto a certain size-->
<match target="font" >
<test name="foundry" qual="any" compare="eq">
<string>Microsoft</string>
<string>Adobe</string>
<string>Monotype</string>
<string>Courier</string>
<string>Helvetica</string>
<string>Times</string>
</test>
<test name="pixelsize" compare="less"><double>18</double></test>
<edit mode="assign" name="antialias"><bool>false</bool></edit>
</match>
<!-- Enable antialiasing for all bold fonts from 8pt up -->
<match target="font" >
<test name="pixelsize" compare="more_eq"><double>10</double></test>
<test name="weight" compare="more_eq"><int>200</int></test>
<edit mode="assign" name="antialias"><bool>true</bool></edit>
</match>
<!-- disable antialiasing for some small bold fonts -->
<match target="font">
<test name="family" qual="any" compare="eq">
<string>Verdana</string>
<string>Courier New</string>
</test>
<test name="pixelsize" compare="less"><double>13</double></test>
<test name="weight" compare="more_eq"><int>200</int></test>
<edit mode="assign" name="antialias"><bool>false</bool></edit>
</match>
<!-- Always prefer chosen fonts -->
<alias>
<family>sans-serif</family>
<prefer> <family>Arial</family></prefer>
</alias>
<alias>
<family>serif</family>
<prefer> <family>Times New Roman</family> </prefer>
</alias>
<alias>
<family>Monospace</family>
<prefer> <family>Courier New</family> </prefer>
</alias>
</fontconfig>
As it can be seen, Sans is now Arial, Serif is Times New Roman, and Monospace is Courier New
If you want to keep your old fonts for the rest of the system (ubuntu default is: Bitstream Vera Sans, Bitstream Vera Serif and Bitstream Vera Sans Mono), you might need to change some font preferences in gnome.
I don't understand this local.conf thing. Here are my results.
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- http://www.linuxquestions.org/questions/showthread.php?t=257705-->
<dir>/usr/X11R6/lib/fonts/TTF</dir>
<!-- Let all fonts be fully hinted -->
<match target="font" >
<edit mode="assign" name="hinting" ><bool>true</bool></edit>
</match>
<match target="font" >
<edit mode="assign" name="hintstyle" ><const>hintfull</const></edit>
</match>
<!-- Explicitly declare all fonts to be antialiased, to begin with -->
<match target="font">
<edit mode="assign" name="antialias" ><bool>true</bool></edit>
</match>
<!-- Treat all Microsoft fonts together: comic sans ms, georgia,
tahoma (not part of msttcorefonts), trebuchet ms, verdana,
webdings -->
<match target="font" >
<test name="foundry" qual="any" ><string>Microsoft</string></test>
<!-- <test name="pixelsize" compare="more_eq"><double>1</double></test> -->
<test name="size" compare="more_eq"><double>1</double></test>
<!-- <test name="pixelsize" compare="less_eq"><double>12</double></test> -->
<test name="size" compare="less_eq"><double>10</double></test>
<edit mode="assign" name="antialias"><bool>false</bool></edit>
</match>
Gnumeric - antialiased as per local.conf, Firefox all font sizes antialiased, Abiword all font sizes antialiased. That is, Gnumeric is the only one to accurately observe the local.conf.
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- http://www.linuxquestions.org/questions/showthread.php?t=257705-->
<dir>/usr/X11R6/lib/fonts/TTF</dir>
<!-- Let all fonts be fully hinted -->
<match target="font" >
<edit mode="assign" name="hinting" ><bool>true</bool></edit>
</match>
<match target="font" >
<edit mode="assign" name="hintstyle" ><const>hintfull</const></edit>
</match>
<!-- Explicitly declare all fonts to be antialiased, to begin with
<match target="font">
<edit mode="assign" name="antialias" ><bool>true</bool></edit>
</match>
-->
<!-- Treat all Microsoft fonts together: comic sans ms, georgia,
tahoma (not part of msttcorefonts), trebuchet ms, verdana,
webdings -->
<match target="font" >
<test name="foundry" qual="any" ><string>Microsoft</string></test>
<!-- <test name="pixelsize" compare="more_eq"><double>1</double></test> -->
<test name="size" compare="more_eq"><double>1</double></test>
<!-- <test name="pixelsize" compare="less_eq"><double>12</double></test> -->
<test name="size" compare="less_eq"><double>10</double></test>
<edit mode="assign" name="antialias"><bool>false</bool></edit>
</match>
Gnumeric - antialiased >=15, Firefox antialiased >= (approximate) 15, Abiword all font sizes not antialiased. I have taken out the explicit declaration for all fonts. Note that local.conf says 10, not the 15 that are my results.
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- http://www.linuxquestions.org/questions/showthread.php?t=257705-->
<dir>/usr/X11R6/lib/fonts/TTF</dir>
<!-- Let all fonts be fully hinted -->
<match target="font" >
<edit mode="assign" name="hinting" ><bool>true</bool></edit>
</match>
<match target="font" >
<edit mode="assign" name="hintstyle" ><const>hintfull</const></edit>
</match>
<!-- Explicitly declare all fonts to be antialiased, to begin with
<match target="font">
<edit mode="assign" name="antialias" ><bool>true</bool></edit>
</match>
-->
<!-- Treat all Microsoft fonts together: comic sans ms, georgia,
tahoma (not part of msttcorefonts), trebuchet ms, verdana,
webdings -->
<match target="font" >
<test name="foundry" qual="any" ><string>Microsoft</string></test>
<!-- <test name="pixelsize" compare="more_eq"><double>1</double></test> -->
<test name="size" compare="more_eq"><double>1</double></test>
<!-- <test name="pixelsize" compare="less_eq"><double>12</double></test> -->
<test name="size" compare="less_eq"><double>20</double></test>
<edit mode="assign" name="antialias"><bool>false</bool></edit>
</match>
Gnumeric - antialiased >=21, Firefox antialiased >= (approximate) 21, Abiword all font sizes not antialiased. Again, local.conf says 20, not 21. Note also that I am using size, not pixelsize, but I am still getting firefox to sort of observe local.conf
Does anyone have a local.conf or such like that works for all applications all of the time and can make coffee?
This will give me a Windows 2000 effect on my fonts. I have the BCI (Byte Code Interpreter) enabled version of libfreetype6 installed, and the fonts look sharp. But the reason for me not using is that some of the fonts like Times New Roman, Arial, Tahoma, and Courier New look like they have had some parts of them erased or rubbed off. At least this way it looks really good. Very legiable, but no antialiased.
Does anyone have a local.conf or such like that works for all applications all of the time and can make coffee
Hi Fogwatch.
You have got a syntax error in the second and third of the local.conf files that you posted.
The comment lines that commence "<!-- Explicitly declare all fonts---" are missing the closing bracket (-->) which means that the following piece of XML regarded 'turning on of antialias' is NOT recognized.
I hopes this help you understand what is going on.
Why do you turn hinting off for small font sizes? I thought small font sizes was what hinting was for.
Do you know what "pixelsize" is, because it is not point size? With AA turned off for pixelsize 10-20 inclusive (as per your local.conf) Gnumeric turns off AA for point sizes 8-15 inclusive.
Abiword does not antialiase on my machine with these settings. Yours?
Using the settings for system wide non anti-aliasing AbiWord won't antialias but you will have issues when you type, some letters won't appear on the secreen, though they are visiable on the preview. Firefox also behaves wierd on certain pages like theregister.com you have to put the mouse over headings to make the rest of the body appear. This is why I use Opera instead, Konqueror doesn't seem to have any issues with this neither does Openoffice.org 2.0.1 they work really well.
Why do you turn hinting off for small font sizes? I thought small font sizes was what hinting was for.
Do you know what "pixelsize" is, because it is not point size? With AA turned off for pixelsize 10-20 inclusive (as per your local.conf) Gnumeric turns off AA for point sizes 8-15 inclusive.
Abiword does not antialiase on my machine with these settings. Yours?
On my set up, if I do not turn off hinting for very small fonts like 4,5 and 6 point they appear very 'blocky' and ugly. This setting help so that they are just antialiased.
Yes, about 'pixelsize', I used this instead of 'point' as I read that it was needed for Firefox to take notice of. I had intended it to be roughly equivalent to point sizes 8-15.
I cannot comment on Abiword. I use Openoffice which seems to work fine for me.
Firefox also behaves wierd on certain pages like theregister.com you have to put the mouse over headings to make the rest of the body appear.
Using my settings, I did not seem to see any problems with 'theregister.com' using Firefox. Fonts appeared as I expected and anti-aliased when I expected them to be.
I am still fine tuning this but I have made further changes:
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/usr/local/share/fonts/truetype/</dir>
<!-- Get the DPI of the LCD monitor right -->
<match target="pattern" >
<edit mode="assign" name="dpi" ><double>96</double></edit>
</match>
<!-- It is best for my screen with the following off -->
<match target="font" >
<edit mode="assign" name="rgba" ><const>none</const></edit>
</match>
<!-- First turn on Hinting and Anti-aliasinng for everything -->
<match target="font" >
<edit mode="assign" name="hinting" ><bool>true</bool></edit>
</match>
<match target="font" >
<edit mode="assign" name="hintstyle" ><const>hintfull</const></edit>
</match>
<match target="font" >
<edit mode="assign" name="antialias" ><bool>true</bool></edit>
</match>
<!-- Turn AA off for font size range but leave on for BOLD -->
<match target="font" >
<test compare="more_eq" name="pixelsize" qual="any" ><double>9</double></test>
<test compare="less_eq" name="pixelsize" qual="any" ><double>20</double></test>
<test name="weight" compare="less"><int>200</int></test>
<edit mode="assign" name="antialias" ><bool>false</bool></edit>
</match>
<!-- Turn BCI Hinting off for Bold Type -->
<match target="font"><test name="weight" compare="more_eq"><int>200</int></test>
<edit name="hinting" mode="assign"><bool>false</bool></edit>
</match>
<!-- Turn Native Auto-hinting on for Bold Type -->
<match target="font"><test name="weight" compare="more_eq"><int>200</int></test>
<edit name="autohint" mode="assign"><bool>true</bool></edit>
</match>
<!-- Turn BCI Hinting off for small font sizes -->
<match target="font" ><test compare="less_eq" name="pixelsize" qual="any" >
<double>8</double></test>
<edit mode="assign" name="hinting" ><bool>false</bool></edit>
</match>
<!-- Turn Anti-aliasing on for all Courier font sizes -->
<match target="font"><test name="family" qual="any" compare="eq">
<string>Courier</string></test>
<edit mode="assign" name="antialias"><bool>true</bool></edit>
</match>
</fontconfig>
Main changes:
When the 'Byte code Interpreter' is turned on, TT Bold fonts render very strangely. This can be seen most if you look at Verdana bold. Even more so if you use Freetype version 2.1.10. For bold fonts I have therefore turned OFF the BCI Hinting and turned ON the native Auto-hinter. If you leave the BCI Hinter on and force the native Auto-hinter on, there are weird effects like poor kerning so that is one reason to turn off BCI-hinting.
For the Auto-hinter to work for me anti-aliasing also has to be turned on.
I will almost certainly tune this further and also optimize the XML but the result are very satisfactory for me now.
I feel that many Linux users are drawn into the belief that freetype with bci enabled will make their fonts look awsome. This will only work with certain fonts (bistream family) but don't look very good with fonts like msttcorefonts and others. In reality the bci enabled makes non-antialised fonts look like windows 2000 which I find makes fonts look really well. To get good fonts on linux they would look like they do on apple but that won't happen since they have patented that method. I would enable bci only if you are going to use the non-antialiased option. otherwise there is no point on infringing. BCI does look better then sub-pixel using the standard library, you don't get the three colour hints that you might with bci-disabled freetype.
--- I would enable bci only if you are going to use the non-antialiased option. otherwise there is no point on infringing. BCI does look better then sub-pixel using the standard library, you don't get the three colour hints that you might with bci-disabled freetype----.
I totally agree with what you say.
The .fonts.conf file that I posted above gets me as close to Win 2000/XP as I can get and I personally like that appearance. However, I also have another configuration which makes use of anti-aliasing and a Freetype compiled to include David Chester's 'Smooth Patch' which I don't think made it into the released versions of Freetype. This all produces very beautiful anti-aliased fonts and the screen fonts look just as you would expect the fonts to look like when printed with a good laser printer.
So it all depends what you want. You just need to configure Linux/Freetype appropriately.
This seems contrary to some of the discussion from webterractive.
When I refer to small font sizes, I mean those very small ones of 6pt and below. I find with BCI enable and anti-alias turned off, 8pt and 7pt are both very nicely rendered with the Truetype fonts. If I remember correctly, the smallest font size on Win XP is usually 6pt and it is anti-aliased even in XP to make it remotely acceptable.
Today, I went through all the common fonts on XP and noted exactly at what point anti-aliasing is applied for roman and italic (both regular and bold weight). It is amazing how different the figures are for each font type. I spent most of today writing a 'local.conf' file so that my configuration exactly mimicks Win XP. Quite a long file but it works.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.