Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 192720 - media-libs/freetype-2.3.4-r2 - wrong spacing with serif font
Summary: media-libs/freetype-2.3.4-r2 - wrong spacing with serif font
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Fonts Team
URL: http://img517.imageshack.us/my.php?im...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-16 18:25 UTC by Dylan
Modified: 2007-09-17 05:57 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dylan 2007-09-16 18:25:35 UTC
Having followed the Gentoo HOWTO_Xorg_and_Fonts recommendations, I now have anti-aliasing and sub-pixel hinting but terrible font tracking (i.e. inter-letter spacing). Unsure how to revert back to previous setup.

Reproducible: Always

Steps to Reproduce:
1. Follow the gentoo Fonts howto.
2. Start up firefox. 
3. Point it to www.google.com or www.gmail.com
Actual Results:  
After loading the appropriate page, the output has ugly spacing particularly after an "m"

Expected Results:  
Improved fonts.... actually they seem to have gotten worse.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-09-16 21:05:49 UTC
Maybe if you posted freetype version and relevant config files, someone could help. Sorry but we cannot guess.
Comment 2 Dylan 2007-09-16 23:03:58 UTC
Freetype version 2.3.4-r2, the config files follow (and are exactly as in the HOWTO with the BCI recommendations). Either BCI gives significantly better output, but has this tracking glitch.

-------------------------------------------------------
/etc/fonts/local.conf reads:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->

<fontconfig>

<!-- Enable sub-pixel rendering -->

<!--
        <match target="font">
                <test qual="all" name="rgba">
                        <const>unknown</const>
                </test>
                <edit name="rgba" mode="assign"><const>rgb</const></edit>
        </match>
-->

 
<!-- Use the Autohinter -->

	<match target="font">
       	<edit name="autohint" mode="assign"><bool>false</bool></edit>
       </match>

<!-- Disable Autohinting for bold fonts -->

	<match target="font">
   		<test name="weight" compare="more">
			<const>medium</const>
		</test>
   		<edit name="autohint" mode="assign"><bool>false</bool></edit>
	</match>
 
<!-- Exclude/Include a range of fonts for Anti Aliasing -->

<!--

<match target="font">
	<test qual="any" name="size" compare="more">
                <double>9</double>
        </test>
        <test qual="any" name="size" compare="less">
                <double>14</double>
        </test>
        <edit name="antialias" mode="assign">
                <bool>true</bool>
        </edit>
</match>

-->


<!-- And/Or disable Anti Aliasing for a range on pixel-based size.
     Disabling this using both methods seems to fix Firefox. -->

<!--

<match target="font">
        <test compare="less" name="pixelsize" qual="any">
                <double>20</double>
        </test>
        <edit mode="assign" name="antialias">
                <bool>false</bool>
        </edit>
</match>

-->


</fontconfig>
-------------------------------------------------------

xorg.conf has:

< cut >

   FontPath    "/usr/share/fonts/misc:unscaled"
   FontPath    "/usr/share/fonts/Type1"
   FontPath    "/usr/share/fonts/TTF"
   FontPath    "/usr/share/fonts/corefonts"
   FontPath    "/usr/share/fonts/freefonts"
   FontPath    "/usr/share/fonts/sharefonts"
   FontPath    "/usr/share/fonts/terminus"
   FontPath    "/usr/share/fonts/ttf-bitstream-vera"
   FontPath    "/usr/share/fonts/unifont"
   FontPath    "/usr/share/fonts/75dpi:unscaled"
   FontPath    "/usr/share/fonts/100dpi:unscaled"
   FontPath    "/usr/share/fonts/artwiz"

< cut >

Comment 3 Dylan 2007-09-16 23:04:17 UTC
Freetype version 2.3.4-r2, the config files follow (and are exactly as in the HOWTO with the BCI recommendations). Either BCI gives significantly better output, but has this tracking glitch.

-------------------------------------------------------
/etc/fonts/local.conf reads:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->

<fontconfig>

<!-- Enable sub-pixel rendering -->

<!--
        <match target="font">
                <test qual="all" name="rgba">
                        <const>unknown</const>
                </test>
                <edit name="rgba" mode="assign"><const>rgb</const></edit>
        </match>
-->

 
<!-- Use the Autohinter -->

	<match target="font">
       	<edit name="autohint" mode="assign"><bool>false</bool></edit>
       </match>

<!-- Disable Autohinting for bold fonts -->

	<match target="font">
   		<test name="weight" compare="more">
			<const>medium</const>
		</test>
   		<edit name="autohint" mode="assign"><bool>false</bool></edit>
	</match>
 
<!-- Exclude/Include a range of fonts for Anti Aliasing -->

<!--

<match target="font">
	<test qual="any" name="size" compare="more">
                <double>9</double>
        </test>
        <test qual="any" name="size" compare="less">
                <double>14</double>
        </test>
        <edit name="antialias" mode="assign">
                <bool>true</bool>
        </edit>
</match>

-->


<!-- And/Or disable Anti Aliasing for a range on pixel-based size.
     Disabling this using both methods seems to fix Firefox. -->

<!--

<match target="font">
        <test compare="less" name="pixelsize" qual="any">
                <double>20</double>
        </test>
        <edit mode="assign" name="antialias">
                <bool>false</bool>
        </edit>
</match>

-->


</fontconfig>
-------------------------------------------------------

xorg.conf has:

< cut >

   FontPath    "/usr/share/fonts/misc:unscaled"
   FontPath    "/usr/share/fonts/Type1"
   FontPath    "/usr/share/fonts/TTF"
   FontPath    "/usr/share/fonts/corefonts"
   FontPath    "/usr/share/fonts/freefonts"
   FontPath    "/usr/share/fonts/sharefonts"
   FontPath    "/usr/share/fonts/terminus"
   FontPath    "/usr/share/fonts/ttf-bitstream-vera"
   FontPath    "/usr/share/fonts/unifont"
   FontPath    "/usr/share/fonts/75dpi:unscaled"
   FontPath    "/usr/share/fonts/100dpi:unscaled"
   FontPath    "/usr/share/fonts/artwiz"

< cut >

Comment 4 Ryan Hill (RETIRED) gentoo-dev 2007-09-17 00:51:00 UTC
(In reply to comment #3)
> Freetype version 2.3.4-r2, the config files follow (and are exactly as in the
> HOWTO with the BCI recommendations). Either BCI gives significantly better
> output, but has this tracking glitch.

Just as a reminder, that HOWTO is unofficial.  And I don't agree with some of the stuff in it. ;)
 
> -------------------------------------------------------
> /etc/fonts/local.conf reads:
> 
> <?xml version="1.0"?>
> <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
> <!-- /etc/fonts/local.conf file to configure system font access -->
> 
> <fontconfig>
> 
> <!-- Enable sub-pixel rendering -->
> 
> <!--
>         <match target="font">
>                 <test qual="all" name="rgba">
>                         <const>unknown</const>
>                 </test>
>                 <edit name="rgba" mode="assign"><const>rgb</const></edit>
>         </match>
> -->
> 

I actually get better results turning off subpixel rendering, but this depends on the display.

> 
> <!-- Use the Autohinter -->
> 
>         <match target="font">
>         <edit name="autohint" mode="assign"><bool>false</bool></edit>
>        </match>

This does the opposite of what the comment says.  But if you build freetype with USE="-bindist", the autohinter isn't built anyways (which is generally a good thing).

> 
> <!-- Disable Autohinting for bold fonts -->
> 
>         <match target="font">
>                 <test name="weight" compare="more">
>                         <const>medium</const>
>                 </test>
>                 <edit name="autohint" mode="assign"><bool>false</bool></edit>
>         </match>

Redundant since you shut off the autohinter for all fonts above

> 
> <!-- Exclude/Include a range of fonts for Anti Aliasing -->
> 
> <!--
> 
> <match target="font">
>         <test qual="any" name="size" compare="more">
>                 <double>9</double>
>         </test>
>         <test qual="any" name="size" compare="less">
>                 <double>14</double>
>         </test>
>         <edit name="antialias" mode="assign">
>                 <bool>true</bool>
>         </edit>
> </match>
> 
> -->
> 
> 
> <!-- And/Or disable Anti Aliasing for a range on pixel-based size.
>      Disabling this using both methods seems to fix Firefox. -->
> 
> <!--
> 
> <match target="font">
>         <test compare="less" name="pixelsize" qual="any">
>                 <double>20</double>
>         </test>
>         <edit mode="assign" name="antialias">
>                 <bool>false</bool>
>         </edit>
> </match>
> 
> -->

You have these commented out so they aren't doing anything.  Maybe this was for testing?  Anyways, try just something like

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

but i don't think this is where the problem lies.

> </fontconfig>
> -------------------------------------------------------
> 
> xorg.conf has:
> 
> < cut >
> 
>    FontPath    "/usr/share/fonts/misc:unscaled"
>    FontPath    "/usr/share/fonts/Type1"
>    FontPath    "/usr/share/fonts/TTF"
>    FontPath    "/usr/share/fonts/corefonts"
>    FontPath    "/usr/share/fonts/freefonts"
>    FontPath    "/usr/share/fonts/sharefonts"
>    FontPath    "/usr/share/fonts/terminus"
>    FontPath    "/usr/share/fonts/ttf-bitstream-vera"
>    FontPath    "/usr/share/fonts/unifont"
>    FontPath    "/usr/share/fonts/75dpi:unscaled"
>    FontPath    "/usr/share/fonts/100dpi:unscaled"
>    FontPath    "/usr/share/fonts/artwiz"
> 
> < cut >

This won't affect firefox.

Try turning on hinting with something like the following.  I seem to remember running into this myself previously.

  <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>
Comment 5 Ryan Hill (RETIRED) gentoo-dev 2007-09-17 01:10:04 UTC
also, have you changed any of firefox's default font-related settings, in the dialog or about:config?  i'm trying to reproduce this but i'm having some trouble.
Comment 6 Dylan 2007-09-17 01:39:10 UTC
Firstly, thanks for looking at this.

The reason I included the font.conf with all of the bits still commented out is that the first reply said I'd failed to include the config files. The point is that I used exactly the config files from the Gentoo HOWTO.

Now, I've tried to make this a little easier for you to try reproduce. Maybe this will help, if I have the following local.conf (an essentially empty one)

=============================================
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->

<fontconfig>


</fontconfig>
=============================================

Then the spacing issue goes away. It does change the mozilla firefox font however, so that even the title bar and dialog boxes have a taller/skinnier font. (Which is rather ugly.)

The simplest local.conf to produce the weird spacing after the m's is:
=============================================
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->

<fontconfig>

<match target="font">
<edit name="autohint" mode="assign"><bool>false</bool></edit>
</match>

</fontconfig>
=============================================

Should I attach an fc-list, or the fonts.conf, or the contents of the conf.d directory?



Comment 7 Dylan 2007-09-17 01:43:05 UTC
I forgot to mention. This isn't just a firefox problem. I changed by fluxbox theme to use "serif" in the title bar. With the "blank" config there is no weird spacing, but the autohint=false config, there is the extra space with the m's.

How can the font that mozilla/gtk apps use for menus change in height because autohint is explicitly turned off?

Comment 8 Ryan Hill (RETIRED) gentoo-dev 2007-09-17 03:08:05 UTC
hmm, i still can't seem to reproduce it.  my unhelpful advice would be if disabling autohint gives you funky looking fonts, then don't disable it. :P
Comment 9 Dylan 2007-09-17 05:57:40 UTC
(In reply to comment #8)
> hmm, i still can't seem to reproduce it.  my unhelpful advice would be if
> disabling autohint gives you funky looking fonts, then don't disable it. :P
> 

Indeed. Except there are funky looking fonts either way. One has these menu characters that are a good 2px larger than they should be, and the other is perfect but messes up the spacing after "m's". I don't understand how the font size can change with toggling autohint!