LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just 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


Reply
  Search this Thread
Old 01-25-2006, 10:09 PM   #106
jinacio
LQ Newbie
 
Registered: Feb 2005
Posts: 6

Rep: Reputation: 0

Firefox repeatedly choose to ignore any per-font customization i throw at him...

until i came up with this simple one.

strangely, it doesnt seem to affect the rest of the system and i can still choose in gnome font preferences if i want my other fonts aliased or not

in firefox i use exactly the same settings as the windows defaults.

Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <dir>~/.fonts</dir>

    <!-- Start off disabling antialias -->
    <match target="font" >
        <edit mode="assign" name="antialias"><bool>false</bool></edit>
    </match>


    <!-- Enable antialiasing for bold fonts -->
    <match target="font" >
        <test name="weight" compare="more_eq"><int>200</int></test>
        <edit mode="assign" name="antialias"><bool>true</bool></edit>
    </match>


    <!-- Disable antialiasing of chosen fonts -->
    <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="size" compare="more_eq"><double>6</double></test>
        <test name="size" compare="less_eq"><double>12</double></test>
        <edit mode="assign" name="antialias">
        <bool>false</bool>
        </edit>
    </match>

    <!-- Enable antialiasing any large fonts -->
    <match target="font" >
            <test name="size" compare="more_eq"><double>12</double></test>
        <test name="size" compare="less_eq"><double>100</double></test>
        <edit mode="assign" name="antialias"><bool>true</bool></edit>
    </match>

</fontconfig>
hope it helps,

- iNs4ne
 
Old 01-26-2006, 12:01 AM   #107
jinacio
LQ Newbie
 
Registered: Feb 2005
Posts: 6

Rep: Reputation: 0
- Edited

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.

- iNs4ne

Last edited by jinacio; 01-26-2006 at 06:10 AM.
 
Old 02-16-2006, 07:09 PM   #108
fogwatch
LQ Newbie
 
Registered: Feb 2006
Location: Australia
Posts: 15

Rep: Reputation: 0
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?

Firefox 1.0.7
Abiword 2.4.1
Gnumeric 1.2.13
 
Old 02-17-2006, 01:42 AM   #109
webterractive
Member
 
Registered: Apr 2004
Location: Richmond, Canada
Distribution: Mandriva 2006/XPSP2
Posts: 265

Rep: Reputation: 30
Lightbulb

I have already figured it out, I made my own local.conf and added to my /etc/fonts file.Here is what it looks like:


<?xml version="1.0"?>
<?DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit mode="assign" name="antialias">
<bool>false</bool>
</edit>
</match>
</fontconfig>


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.
 
Old 02-19-2006, 08:44 AM   #110
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
Quote:
Originally Posted by fogwatch
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.

Last edited by Toods; 02-19-2006 at 09:17 AM.
 
Old 02-19-2006, 09:28 AM   #111
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
This is my current local.conf file that I am just about happy with:

Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <dir>/usr/local/share/fonts/truetype/</dir>
 <match target="pattern" >
  <edit mode="assign" name="dpi" >
   <double>96</double>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="rgba" >
   <const>none</const>
  </edit>
 </match>
 <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>
 <match target="font" >
  <test compare="more_eq" name="pixelsize" qual="any" >
   <double>10</double>
  </test>
  <test compare="less_eq" name="pixelsize" qual="any" >
   <double>20</double>
  </test>
<!-- Turn AA off for font size range but leave on for BOLD -->
  <test name="weight" compare="less">
      <int>200</int>
  </test>
  <edit mode="assign" name="antialias" >
   <bool>false</bool>
  </edit>
 </match>
<!-- Turn Hinting off for small font sizes -->
 <match target="font" >
  <test compare="less_eq" name="pixelsize" qual="any" >
   <double>9</double>
  </test>
  <edit mode="assign" name="hinting" >
   <bool>false</bool>
  </edit>
 </match>
<!-- Turn Hinting 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>
 
Old 02-19-2006, 06:04 PM   #112
fogwatch
LQ Newbie
 
Registered: Feb 2006
Location: Australia
Posts: 15

Rep: Reputation: 0
Toods, thanks for pointing out the syntax error and providing your local.conf. I'm using yours too now.

Code:
 <match target="font" >
  <edit mode="assign" name="rgba" >
   <const>none</const>
  </edit>
 </match>
is just for LCD screens isn't it?

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?

Thanks.
 
Old 02-20-2006, 12:42 AM   #113
webterractive
Member
 
Registered: Apr 2004
Location: Richmond, Canada
Distribution: Mandriva 2006/XPSP2
Posts: 265

Rep: Reputation: 30
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.
 
Old 02-20-2006, 01:49 AM   #114
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
Fogwatch, answer your questions:

Quote:
Originally Posted by fogwatch
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.
 
Old 02-20-2006, 01:57 AM   #115
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
Hi Webterractive,


Quote:
Originally Posted by webterractive
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.
 
Old 02-20-2006, 10:34 AM   #116
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
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.
 
Old 02-20-2006, 05:43 PM   #117
webterractive
Member
 
Registered: Apr 2004
Location: Richmond, Canada
Distribution: Mandriva 2006/XPSP2
Posts: 265

Rep: Reputation: 30
Freetype+BCI+Linux

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.
 
Old 02-21-2006, 09:07 AM   #118
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
Quote:
Originally Posted by webterractive
--- 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.
 
Old 02-21-2006, 05:25 PM   #119
fogwatch
LQ Newbie
 
Registered: Feb 2006
Location: Australia
Posts: 15

Rep: Reputation: 0
The following is a quote from http://www.tldp.org/HOWTO/Font-HOWTO/fonts.html about Bitstream fonts.
Quote:
unfortunately their bad hinting can be noted at small sizes.
This seems contrary to some of the discussion from webterractive.
 
Old 02-21-2006, 06:33 PM   #120
Toods
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 12.1
Posts: 249

Rep: Reputation: 32
Quote:
Originally Posted by fogwatch
The following is a quote from http://www.tldp.org/HOWTO/Font-HOWTO/fonts.html about Bitstream fonts.


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.
 
  


Reply

Tags
antialiasing, fonts, howto, openoffice.org, resolution, screen



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xft2 not antialiased fonts look ugly pijulius Linux - Software 0 02-20-2004 09:53 AM
No antialiased fonts in Mozilla 1.6? misfit-x Linux - Software 13 02-10-2004 06:57 AM
Fuzzy antialiased fonts in Slackware 9.0 Kovacs Slackware 1 11-23-2003 08:12 AM
too blurry antialiased fonts oski Mandriva 4 10-12-2003 01:22 PM
How to make the GDM to use the antialiased fonts? Xterminator Conectiva 1 11-22-2002 08:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 07:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration