Results 1 to 5 of 5

Thread: ClanLib's 2.3 sub-pixel rendering linux freetype bug

  1. #1
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default ClanLib's 2.3 sub-pixel rendering linux freetype bug

    For reference,

    I have created a bug report for the Linux freetype bug that has been around for about 3 years or more.

    If anyone wants to look at fixing it

    https://savannah.nongnu.org/bugs/?33288

  2. #2

    Default

    I have the same problem on Gentoo Linux and Windows when using DejaVuSans.ttf. So I think it's a freetype bug, not Ubuntu's one.

    (Or maybe the glyph itself is somehow broken).

    Anyway this error seems to appear only when the average character width is set to nonzero. For example, it happens when using CL_Font_System on Linux. Default (zero) average width works well with any font size.

    So the simplest workaround would be to always use default average width unless the user specifies otherwise. Eventually it's the width the font has been designed for

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Thanks.

    It has now been confirmed it is a DejaVuSans.ttf bug

    Posted bug report to: https://bugs.freedesktop.org/show_bug.cgi?id=37395

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Again, many thanks toiffel :

    Removed the following code in ClanLib 2.3 svn...
    Code:
    -	// Attempt to convert the point sizes (to match WIN32 with FreeType)
    -	if (average_width==0)	// Unset width
    -	{
    -		if (height <0)
    -		{
    -			average_width = -height;
    -			average_width = (average_width * 80) / 96;
    -		}
    -		else
    -		{
    -			// I do not know why this formula works,  but it seems to obtain the best result
    -			average_width = ( height * 80 * 80 ) / (96 * 96);
    -		}
    -	}
    -
    The font example and fonts in general now work on linux

  5. #5

    Thumbs up

    Good news Now we can use system fonts on linux without any trouble (especially in ClanGUI apps).

Similar Threads

  1. Bad font metrics average width using FreeType
    By genail in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 12-23-2009, 09:37 PM
  2. GUI / Rendering Display
    By Fr3DBr in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 08-22-2009, 11:00 PM
  3. Win32 native fonts: CreateFont vs FreeType
    By kbluck in forum Official ClanLib SDK Forums
    Replies: 7
    Last Post: 09-23-2008, 06:45 PM
  4. Font rendering acceleration in v0.9
    By z42 in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 02-18-2008, 12:09 PM
  5. The fastest way to draw pixel by pixel?
    By Otto (Strange) Halmén in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 12-06-2006, 07:32 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •