bugThe FreeType Project - Bugs: bug #36593, Monospaced font not rendered...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #36593: Monospaced font not rendered monospaced

Submitter:  Weeble <weeble>
Submitted:  Tue 05 Jun 2012 12:10:19 PM UTC
   
 
Severity:  3 - Normal Item Group:  Incorrect behaviour
Status:  Invalid Privacy:  Public
Assigned to:  wl Open/Closed:  Closed
Planned Release:  None

Fri 08 Jun 2012 02:30:49 PM UTC, comment #5: 

Hi, Werner,

On Fri, Jun 8, 2012 at 6:30 AM, Werner LEMBERG

>
> This report (not the one on LaunchPad) is talking about two special versions
> of FreeMono which don't have the `isFixedPitch' is set. 


Very well, I'm glad to take that view. 
In that case, this report discusses a conflict of development  versions of FreeType with obsolete versions of FreeFont.  So it is just as well the issue be closed here.

> I have explained the
> behaviour of FreeType's auto-hinter which needs this flag be set for correct
> handling of mono-width fonts. 


This was news to me, and is good to know. thank you. 
As I said, the current version of FreeMono binaries have the bit set.

> Due to a chang in FreeType, the problem was
> indeed not visible in earlier FreeType versions.
>

Yes, but there were problems (different) problems on Windows.  For this reason, I have worked hard to resolve the question.

About the meaning of `isFixedPitch', I cite standards, to which the current version of FreeFont complies.  But I've done this elsewhere, and since the present issue is closed, there is no reason to carry it further here.

Thanks!

Steve White <Stevan_White>
Fri 08 Jun 2012 04:30:29 AM UTC, comment #4: 

This report (not the one on LaunchPad) is talking about two special versions of FreeMono which don't have the `isFixedPitch' is set.  I have explained the behaviour of FreeType's auto-hinter which needs this flag be set for correct handling of mono-width fonts.  Due to a chang in FreeType, the problem was indeed not visible in earlier FreeType versions.

About the meaning of `isFixedPitch', I cite John Hudson, a leading font expert and designer:

  "If a font is identified as monospaced,
  then all glyphs in the font
  should have exactly the same advance width.
  This applies even to glyphs
  that are normally zero-width, including combining marks.
  [Combining marks in monospaced fonts need to have
  their width collapsed in GPOS prior to positioning.]"


Werner LEMBERG <wl>
Group administrator
Thu 07 Jun 2012 11:26:17 PM UTC, comment #3: 

Hi Werner,

As I pointed out in the LaunchPad report, "isFixedPitch" is set on in binaries of the current version of FreeMono.

So technically, if that is the problem, the problem is already solved.

However after that is gets extremely messy, involving

  • some awful disgreements about FontForge, and
  • what standards really mean, and evidently,
  • recent changes to FreeType, and an
  • unclear relationship to the original report about PyGame.


It's not clear to me we're even discussing the same thing.  It's such a mess, I can't even think how to start.

I'll sleep on it, but I know there's no easy way out of this.

Steve White <Stevan_White>
Thu 07 Jun 2012 10:26:02 PM UTC, comment #2: 

Thanks for your quick and precise analysis. :) I reported your comments back to the Ubuntu bug. I'm sorry for the confusion. If you aren't following it already, some input from the FreeType project would be appreciated there, as it seems there's some confusion over the meaning and use of isFixedPitch.

Weeble <weeble>
Wed 06 Jun 2012 12:07:49 PM UTC, comment #1: 

Both versions of FreeMono (20090104 and 20100919) are TTFs, the former has hints, the latter has not.  Consequently, FreeType uses the auto-hinter for the latter.

Both fonts don't have the `isFixedPitch' flag set in the `post' table, and this is the very problem.  While the TrueType hints in the 20090104 version take care of the advance width (and FreeType simply obeys), the 20100919 version the font doesn't tell the auto-hinter not to change advance widths.

In the original report, the font `Courier New' has been mentioned.  This font has the `isFixedPitch' flag set.

My conclusion: It is a bug in the font in both versions, but it only shows up if the auto-hinter is used.  So the central question is: Why is the `isFixedPitch' flag set to false in this font?

Werner LEMBERG <wl>
Group administrator
Tue 05 Jun 2012 12:10:19 PM UTC, original submission:  

Originally reported here:

https://bugs.launchpad.net/ubuntu/+source/freetype/+bug/1001033

The FreeMono ttf in this bundle exhibits the problem:

http://ftp.gnu.org/gnu/freefont/freefont-ttf-20100919.tar.gz

When viewed in ftview, it is clear that different characters are rendering with different widths, e.g.:

./bin/ftview -m "hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb" 11 /usr/share/fonts/truetype/freefont/FreeMono.ttf

(This is using current build of FreeType from git.)

This test program shows different advance widths are returned for different characters with this version of FreeMono, although not with others:

Test program:  http://pastebin.com/Jm4XjtNR
Results:  http://pastebin.com/QiwJsy8e
Installed font versions:  http://pastebin.com/4PTaBUpN

From discussion on the Ubuntu bug, we believe the font is not broken. It defines the advance widths consistently, and is hinted and instructed. Interestingly, using FT_LOAD_NO_AUTOHINT causes the test program to return consistent widths.

It seems like this is a FreeType bug, but I really don't have a deep enough understanding of text rendering to know what should or should not be expected from it.

Weeble <weeble>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by Stevan_White (Posted a comment)
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by weeble (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-06-06 wl StatusNone Invalid
        Assigned toNone wl
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code