Okay, I think I see what's happening.

Here's a C program that shows the behaviour only using FreeType:
http://pastebin.com/Jm4XjtNR

Example:

$ gcc fonttest.c `freetype-config --cflags --libs` -o fonttest
$ ./fonttest freefont-20090104-FreeMono.ttf abcdefg
a:448
b:448
c:448
d:448
e:448
f:448
g:448
$ ./fonttest freefont-20100919-FreeMono.ttf abcdefg
a:448
b:384
c:448
d:384
e:448
f:384
g:384

The output widths are in 64ths of a pixel.

Now, if you change FT_LOAD_DEFAULT to FT_LOAD_NO_AUTOHINT or
FT_LOAD_NO_HINTING, everything becomes the same width. Does FreeMono
have hinting? It seems the FreeType's auto-hinting algorithm is rounding
some glyphs up and some glyphs down. But it only appears to kick in for
the 20100919 version, not the earlier ones. If you use
FT_LOAD_FORCE_AUTOHINT then even the earlier FreeMono versions get
inconsistent sizes.

As I don't know much about font rendering, I can't really answer these
questions:

1. Is this expected behaviour from FreeType? Is it reasonable for hinting to 
cause a monospace font to have different advance widths for different glyphs?
2. Is FreeMono supposed to provide its own hints?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1001033

Title:
  Monospaced font is not monospaced

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ttf-freefont/+bug/1001033/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to