You are not logged in.

#1 2010-03-17 20:36:17

mos98
Member
Registered: 2010-02-07
Posts: 24

Help needed for setting up a proper font config for GNOME

Hi I'm using a Nvidia 7600 GT agp card and an eizo s2110W TFT monitor @ 1680x1050

I configured archlinux to use the cleartype font and I switched on the anti aliasing feature but still the font rendering is
very poor and reading through long text passages keeps hurting my eyes. Is there anything that I can do to improve the rendering?



http://img403.imageshack.us/img403/5240/screenshotw.png

Here's another example

http://img245.imageshack.us/img245/4230 … hot1xn.png

You see how washed out and blurred the font gets rendered?



Or here

screenshot2de.png

Last edited by mos98 (2010-03-17 21:18:28)

Offline

#2 2010-03-17 23:34:41

smakked
Member
From: Gold Coast , Australia
Registered: 2008-08-14
Posts: 420

Re: Help needed for setting up a proper font config for GNOME

Have a look at http://wiki.archlinux.org/index.php/Font_Configuration
I personally use the ubuntu patched files as i find they work well with thw Droid font


Certified Android Junkie
Arch 64

Offline

#3 2010-03-18 03:11:37

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: Help needed for setting up a proper font config for GNOME

smakked wrote:

Have a look at http://wiki.archlinux.org/index.php/Font_Configuration
I personally use the ubuntu patched files as i find they work well with thw Droid font

I'll try that too. So far I have replaced the truetype fonts by the lcd versions and I turned on light hinting and sub-pixel smoothing in gnome via System.. Appearance.. etc

This is how the font rendering looks like now

http://img6.imageshack.us/img6/9763/screenshotmx.png

http://img249.imageshack.us/img249/2716 … hot1jk.png


Even the rendering of the open button text of gnome's open dialog seems to be very blurry imo

http://img411.imageshack.us/img411/6027 … enfile.png


So I'm still not  happy with the result . Must I explicitly turn on the anti-aliasing for the lcd types or  is this done by default?
And if so should I do this in gnome or in /etc/fonts/local.conf ? They same question goes for the hinting feature. Should I  activate hinting in local.conf or in gnome or in both?

Thank you.

Offline

#4 2010-03-18 03:27:29

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Help needed for setting up a proper font config for GNOME

Follow that tutorial, if I must say, it's very well done.  Be sure to read the part to match your Gnome font preferences to your font configuration file (~/.fonts.conf) or (local.conf) whichever you decide to choose.  From your first pictures, I'd say your problems are with the rgb filter.  Be sure to get the correct monitor type selected.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#5 2010-03-18 11:51:01

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: Help needed for setting up a proper font config for GNOME

Gen2ly wrote:

Follow that tutorial, if I must say, it's very well done.  Be sure to read the part to match your Gnome font preferences to your font configuration file (~/.fonts.conf) or (local.conf) whichever you decide to choose.  From your first pictures, I'd say your problems are with the rgb filter.  Be sure to get the correct monitor type selected.

I followed the tutorial very closely I think. 

This is my current configuration. I additionally added the whole section of example2 of the tutorial to this.

 <match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
  </match>


<match target="font">
  <edit name="antialias" mode="assign">
    <bool>true</bool>
  </edit>
</match>

 <match target="font">
    <edit name="hinting" mode="assign">
      <bool>true</bool>
    </edit>
  </match>


 <match target="font">
    <edit name="hintstyle" mode="assign">
      <const>hintslight</const>
    </edit>
  </match>

 <match target="font">
    <edit name="rgba" mode="assign">
      <const>rgb</const>
    </edit>
  </match>

This is how my conf.d directory looks like


[root@mo-pc conf.d]# ls
total 4.0K
   0 00-user.conf          0 10-antialias.conf            0 20-unhint-small-vera.conf
   0 60-latin.conf         0 57-dejavu-sans.conf          0 20-fix-globaladvance.conf
   0 51-local.conf         0 30-urw-aliases.conf          0 53-monospace-lcd-filter.conf
   0 45-latin.conf         0 30-cjk-aliases.conf          0 11-lcd-filter-lcddefault.conf
   0 30-defoma.conf        0 57-dejavu-serif.conf         0 90-ttf-thai-tlwg-synthetic.conf
   0 69-unifont.conf       0 65-fonts-persian.conf        0 25-ttf-arphic-uming-render.conf
   0 10-hinting.conf       0 64-ttf-thai-tlwg.conf        0 35-ttf-arphic-uming-aliases.conf
   0 65-nonlatin.conf      0 10-sub-pixel-rgb.conf        0 20-unhint-small-dejavu-sans.conf
   0 40-nonlatin.conf      0 30-metric-aliases.conf       0 90-ttf-arphic-uming-embolden.conf
   0 10-autohint.conf      0 10-hinting-slight.conf       0 20-unhint-small-dejavu-serif.conf
   0 90-synthetic.conf     0 64-ttf-arphic-uming.conf     0 20-unhint-small-dejavu-sans-mono.conf
   0 80-delicious.conf     0 57-dejavu-sans-mono.conf  4.0K README
   0 49-sansserif.conf     0 41-ttf-arphic-uming.conf
[root@mo-pc conf.d]#

And this is how I setup Gnome
screenshotfontrendering.png

The result of all of this is still very poor imo

http://img89.imageshack.us/img89/9146/screenshot2g.png

OR

http://img245.imageshack.us/img245/6213 … hot3zu.png


Now I have these ugly looking colored fringes around the fonts as well.

Last edited by mos98 (2010-03-18 12:49:40)

Offline

#6 2010-03-18 18:32:26

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: Help needed for setting up a proper font config for GNOME

Update: I've copied all my  Win 7 fonts to /usr/share/fonts/TTF according to http://www.sharpfonts.com/ and installed their configuration files to /etc/fonts

But now I'm not only having yellow color fringes around browser fonts but also around my terminal font. Which looks much much uglier then before,because now
it's a ttf font too. I played around with all the settings in System.. Preference.. Appearance.. Fonts.. to no avail.

Is there no way to for a clean looking font ?

Offline

#7 2010-03-19 15:28:15

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: Help needed for setting up a proper font config for GNOME

deleted

Last edited by mos98 (2010-03-19 15:38:58)

Offline

#8 2010-03-19 16:54:39

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Help needed for setting up a proper font config for GNOME

Gosh, Hmm, they don't look at all bad.  Anyways I'll toss a this out in case you're interested: 

1) Your font config is missing it's Heading.
2) Create a fonts.conf with your Gnome preferences, then edit it from there (so as to not get overwritten.
3) MS font need some special love.  I've got some of them figured out thanks to brebs.  Here's my fontconfig configuration, if it will help you:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>

<fontconfig>

 <!-- General Settings -->

 <match target="pattern" >
  <edit mode="assign" name="dpi" > <!-- Dots per Inch (DPI) -->
   <double>96</double>
  </edit>
 </match>

 <match target="font" >
  <edit mode="assign" name="rgba" >
   <const>rgb</const>
  </edit>
 </match>

 <match target="font" >
  <edit mode="assign" name="antialias" >
   <bool>true</bool>
  </edit>
 </match>

 <match target="font" >
  <edit mode="assign" name="hinting" >
   <bool>true</bool>
  </edit>
 </match>

<match target="pattern" >
  <edit mode="assign" name="autohint" >
   <bool>true</bool>
  </edit>
 </match>

 <match target="font" >
  <edit mode="assign" name="hintstyle" >
   <const>hintslight</const>
  </edit>
 </match>

 <match target="font" >
  <edit mode="assign" name="lcdfilter">
   <const>lcddefault</const>
  </edit>
 </match>

 <!-- Fixes - MS Fonts calibrations -->

 <!-- Consolas and Inconsolata are fuzzy -->
 <match target="font">
  <test compare="eq" name="family">
   <string>Consolas</string>
  </test>
  <edit mode="assign" name="hintstyle">
   <const>hintmedium</const>
  </edit>
 </match>

 <match target="font">
  <test compare="eq" name="family">
   <string>Inconsolata</string>
  </test>
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>

 <!-- Calibri fix for jaggedness -->
  <!-- http://forums.fedoraforum.org/showthread.php?p=1045807#post1045807 -->
 <match target="font" >
  <edit mode="assign" name="embeddedbitmap" >
   <bool>false</bool></edit>
 </match>

 <!-- Arial and Impact fuzzy fix -->
 <match target="font">
  <test compare="eq" name="family">
   <string>Arial</string>
  </test>
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <const>hintfull</const>
  </edit>
  <edit mode="assign" name="autohint">
   <bool>true</bool>
  </edit>
  <test compare="less" name="weight">
   <const>medium</const>
  </test>
 </match>

 <match target="font">
  <test compare="eq" name="family">
   <string>Impact</string>
  </test>
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <const>hintfull</const>
  </edit>
  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>
 </match>

 <!-- Font Replacements -->

 <!-- Replace bitmap fonts -->
 <selectfont>
  <rejectfont>
   <pattern>
    <patelt name="scalable">
     <bool>false</bool>
    </patelt>
   </pattern>
  </rejectfont>
 </selectfont>

</fontconfig>

4) Be good to people, it always comes back big_smile


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#9 2010-03-19 19:21:40

eirika
Member
From: New York
Registered: 2009-09-14
Posts: 65

Re: Help needed for setting up a proper font config for GNOME

I would say, really, font configuration is in the top 10 list of the most painful things in Linux for me.
There are just so many things to learn, and sometimes you thought you figured things out, but
it doesn't work.

The article in the arch wiki is very nice, but as I think it lacks some info that I found useful. So I
post some part of my .fonts.conf. Anyway it strongly depends on personal taste. I use the package
ttf-ms-fonts, so you'll see a lot of Microsoft fonts in the config file. I will just post sans-serif
related parts here as the full .fonts.conf file is too lengthy.

This tells XFT about the fonts you have for sans-serif faces:

<alias>
    <family>Trebuchet MS</family>
    <family>DejaVu Sans</family>
    <family>Arial</family>
    <family>Comic Sans MS</family>
    <family>Tahoma</family>
    <family>Verdana</family>
    <family>Arial Unicode MS</family>
    <default>
      <family>sans-serif</family>
    </default>
</alias>

The following tells XFT your preference for sans-serif fonts. The order is important here
as XFT will match the first one in the list. For example, if you use firefox and the web
page requests a sans-serif font, then XFT will use Trebuchet MS as shown below.
(this can be overriden by other things, so it may not work.). The idea here is that most
programs just specify something as general as serif/sans-serif/monospace and don't
specify any detailed font. So by putting the following preference
list in .fonts.conf I can use the same set of fonts everywhere without tuning individual
programs.

  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Trebuchet MS</family>
      <family>DejaVu Sans</family>
      <family>Verdana</family>n
      <family>Comic Sans MS</family>
      <family>Arial</family>
      <family>PMingLiU</family>
      <family>Arial Unicode MS</family>
    </prefer>
  </alias>

So if you specify

gtk-font-name = "Sans 10"

then firefox will use Trebuchet MS as its menu font(this can be overriden by using custom
stylesheets).

Here is my default for all Microsoft fonts, usually hinting info from the font gives
you better result than autohint, and autohint probably gives you better result
than no hinting at all. But again, this is just presonal preference.

  <match target="font" >
    <test name="foundry" qual="any" >
      <string>microsoft</string>
    </test>
    <edit mode="assign" name="antialias" >
      <bool>true</bool>
    </edit>
    <edit mode="assign" name="autohint" >
      <bool>false</bool>
    </edit>
    <edit mode="assign" name="hinting" >
      <bool>true</bool>
    </edit>
    <edit mode="assign" name="hintstyle" >
      <const>hintfull</const>
    </edit>
  </match>

The following setting is specific to Trebuchet MS. For pixelsize between 7 and 16 I turn
antialias off as this will cause XFT to make use of embedded bitmap font in it. If you feel
frustrated by the blurred font rendering, you can find truetype fonts with embedded bitmap
font and tell XFT to use it. You need to tune it for every font and for every weight.
So Trebuchet MS and Trebuchet MS Bold/Italic/Bold Italic can have different specifications.
Most parts of my .fonts.conf are things like the following, for various fonts.

The reason I choose ttf-ms-fonts is that there are a lot of embedded bitmap fonts
in MS truetype fonts.

  <!--
     Trebuchet MS
    -->
  <match target="font" >
    <test name="family" >
      <string>Trebuchet MS</string>
    </test>
    <test compare="eq" name="weight" >
      <const>regular</const>
    </test>
    <test compare="eq" name="slant" >
      <const>roman</const>
    </test>
    <test compare="more_eq" name="pixelsize" >
      <double>7</double>
    </test>
    <test compare="less_eq" name="pixelsize" >
      <double>16</double>
    </test>
    <edit mode="assign" name="antialias" >
      <bool>false</bool>
    </edit>
    <edit mode="assign" name="autohint" >
      <bool>false</bool>
    </edit>
    <edit mode="assign" name="hinting" >
      <bool>true</bool>
    </edit>
    <edit mode="assign" name="hintstyle" >
      <const>hintfull</const>
    </edit>
  </match>

That's it. There are still a lot of small tricks. A useful place to look at is

man fonts.conf

As I think that document contains everything for tuning font apperance. You just need a lot of
experience. If you read the font matching section in it, it tells you that when XFT matches fonts,
the foundry property takes the highest priority. So the following hack

  <match target="pattern" >
    <test name="family" >
      <string>monospace</string>
    </test>
    <edit mode="assign" name="foundry" >
      <string>bitstream</string>
    </edit>
  </match>

makes the monospace face has the foundry property 'bitstream'. And fonts from bitstream will then
take precedence, in this example you might probably get Bitstream Vera Sans Mono whenever something
requests a monospace font. I use this hack because chatset has higher priority than family(but
lower than foundry), and as I use the locale zh_CN.utf8, XFT defaults a lot of font requests to
some Chinese font even if the program just plays with plain English.

Most of the above info comes from (in Simplified Chinese)

http://www.linuxsir.org/bbs/showthread.php?t=266659

There is a sample .fonts.conf file in the above post(as well as a lot of useful info), which is the starting point of my conf file.

Last edited by eirika (2010-03-19 19:24:06)

Offline

#10 2010-03-20 09:25:15

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Help needed for setting up a proper font config for GNOME

Good tips, eirika.  Good tutorial.  Careful about setting the font family part as it will have your fonts become sans-serif smile.  It's a bit old too so if you use the vista fonts (Calibre, Consolas), you'll need to specify those as 'autohinting.  To test the fonts, take a look at http://www.typetester.org/ which will allow to to choose different fonts and sizes.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

Board footer

Powered by FluxBB