Bug 458592 - Incorrect glyph points and missing hinting instructions for U+0079, U+03BC, U+0431, U+2010..2012.
Summary: Incorrect glyph points and missing hinting instructions for U+0079, U+03BC, U...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: liberation-fonts
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Caius Chance
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 459451
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-08-10 16:53 UTC by Sylvain Beucler
Modified: 2008-08-26 19:58 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-08-26 04:30:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Screenshot with LiberationSans 2007 (520.90 KB, image/png)
2008-08-10 16:54 UTC, Sylvain Beucler
no flags Details
Screenshot with LiberationSans 2008 1.0.4 (521.01 KB, image/png)
2008-08-10 16:55 UTC, Sylvain Beucler
no flags Details
1. hinting on (32.68 KB, image/png)
2008-08-11 17:45 UTC, Sylvain Beucler
no flags Details
2. hinting off (89.88 KB, image/png)
2008-08-11 17:46 UTC, Sylvain Beucler
no flags Details
Sample patched 1.04, with 'y' glyph points and hinting instructions 're-cloned' from 1.03. (135.92 KB, application/octet-stream)
2008-08-25 05:22 UTC, Caius Chance
no flags Details

Description Sylvain Beucler 2008-08-10 16:53:27 UTC
Description of problem:
I was using the LiberationSans version from the original announcement at https://www.redhat.com/f/fonts/liberation-fonts-ttf-3.tar.gz (now 404). I replaced it with 1.0.4 from https://fedorahosted.org/liberation-fonts/ . I use this fonts in a game engine that is ported from Windows, and that was using Arial originally. The font rendering is done through SDL_ttf (with style TTF_STYLE_BOLD) which itself called libfreetype6.

The new version of the font has a decreased quality. I attach 2 screenshots with the 2 different versions. Check for example the "y": the top of the letter isn't aligned with the top of the other letters.

Note that the screenshots are taken from Debian Lenny, whose libfreetype6 has  TT_CONFIG_OPTION_BYTECODE_INTERPRETER activated.

Version-Release number of selected component (if applicable):
1.0.4

How reproducible:
Always

Steps to Reproduce:
The game is in development, I don't have a short procedure to install the game right now, but let me know if you're interested in that.

Actual results:
Irregular letters. Apparent regression in font quality.

Expected results:
Improved quality ;)

Additional info:

Comment 1 Sylvain Beucler 2008-08-10 16:54:50 UTC
Created attachment 313895 [details]
Screenshot with LiberationSans 2007

Comment 2 Sylvain Beucler 2008-08-10 16:55:32 UTC
Created attachment 313896 [details]
Screenshot with LiberationSans 2008 1.0.4

Comment 3 Caius Chance 2008-08-11 06:51:10 UTC
Are two results generated on same environment? I don't use libfreetype6 so I couldn't comment if there are any effects from that.

I have used fontforge to compare all points of both 'y' glyphs, tested their interactions with other alphabets in metrics window, also all settings in 'glyph info' but couldn't found any difference on data side.

The 1.03 binaries was produced by original manufacturer WIN32 software. Then the ttfs have been converted into .sfd format by fontforge. FYI, .sfd is fontforge main font format which is open sourced.

Since the conversion, we kept such .sfd files as "original sources" of Liberation Fonts and hosted on public website. However, in fact the original .ttf files from manufacturer contained some proprietary tables or tables that fontforge doesn't read. This might be the factor of losing data. Therefore, we kept the 1.03 binary available on the hosting for those people who preferred 1.03.

It is not feasible for a loss free conversion solution at the moment due to limitation of fontforge and lack of project commitments from the public.

Besides the fonts themselves, the change of rendering engines might be also another reason of this situation.

I have no quick solution right now but suggest you include ver 1.03 as static font in the game package until someone worked out a better solution. BTW, you could test this again on the rawhide (development version Fedora) to keep an eye on if latest changes of the OS fixed this in other ways.

Comment 4 Sylvain Beucler 2008-08-11 17:45:06 UTC
> Are two results generated on same environment?

Yes, exactly the same, except for the font.

> I don't use libfreetype6 so I couldn't
> comment if there are any effects from that.

Note that Fedora has TT_CONFIG_OPTION_BYTECODE_INTERPRETER disabled because of patents treats (while it is activated in Debian and Gentoo, for example).

This prevents the hinting bytecode interpreter to work, and changes the rendering and size quite a bit. However, I only get enabling compatible size when the hinting bytecode interpreter is enabled: under Fedora I couldn't get the same text size than under Windows for the game engine.

I attach 2 screenshots, showing FreeType's 'ftview' utility with size 16 and anti-aliasing disabled (what the game uses). Left is 1.03, right is 1.04. The first screenshot has glyph hinting on, the second has it off.

On the first one you'll see the difference on "y".

This could mean that the hinting bytecode was not or not properly imported in fontforge, which would be embarrassing.

> Therefore, we kept the 1.03 binary available on
> the hosting for those people who preferred 1.03.

Indeed 1.03 doesn't present this issue.

Comment 5 Sylvain Beucler 2008-08-11 17:45:50 UTC
Created attachment 313987 [details]
1. hinting on

Comment 6 Sylvain Beucler 2008-08-11 17:46:15 UTC
Created attachment 313988 [details]
2. hinting off

Comment 7 Caius Chance 2008-08-19 01:35:26 UTC
Possible bug #459451 is discovered in fontforge which avoid me to change glyph point settings on such char in liberation fonts, set this bz depends on that.

Comment 8 Caius Chance 2008-08-21 04:40:45 UTC
Hi Sylvain, I am going to do a triage of bug:

- Install the game on Fedora.
- Install the game on Debian.

Would you please explain the procedures of installation?

Comment 9 Jens Petersen 2008-08-21 05:40:26 UTC
Sylvain, are you able to reproduce the problem on debian or gentoo for other apps?

Comment 10 Jens Petersen 2008-08-21 05:43:18 UTC
Caius, actually I think attachment 313987 [details] is quite clear - so you should be able to
reproduce on Debian with that.

Comment 11 Jens Petersen 2008-08-21 06:35:30 UTC
It is funny how only 'y' based glyphs seem much affected in that screenshot anyway.

I tried on Ubuntu-8.04 but didn't see it there FWIW.

Sylvain, do you know when TT_CONFIG_OPTION_BYTECODE_INTERPRETER was activated:
I mean which package version of freetype?

Comment 12 Sylvain Beucler 2008-08-21 17:52:26 UTC
> Sylvain, do you know when TT_CONFIG_OPTION_BYTECODE_INTERPRETER was activated:
> I mean which package version of freetype?

Probably since 2006:

 freetype  (2.2.1-2) unstable; urgency=low

   * Enable full bytecode interpreter instead of just the
     "non-patented portions".
   * Use $(CURDIR) instead of $(PWD) to build with sudo. Closes: #367579.

 -- Keith Packard <keithp>  Wed, 17 May 2006 00:00:35 -0500 

http://packages.debian.org/changelogs/pool/main/f/freetype/freetype_2.3.7-1/changelog

> Sylvain, are you able to reproduce the problem on debian
> or gentoo for other apps?

With SDL_ttf and freetype2-demos, yes. I think other apps usually turn onanti-aliasing which works-around the issue.

Note that Gentoo disables it in binary packages, but enables it in recompiled packages.

> I tried on Ubuntu-8.04 but didn't see it there FWIW.

I just Tried on gNewSense (Ubuntu) LiveCD and it shows for me.

Procedure:
- 'ftview 16 liberation-fonts-1.04/LiverationSans-Regular.ttf'
- Type 'a'

Comment 13 Jens Petersen 2008-08-21 23:44:32 UTC
Thanks!  Easily reproduced on Ubuntu-8.04 too.

Comment 14 Caius Chance 2008-08-25 02:45:33 UTC
Trying to fix with patched fontforge.

Comment 15 Caius Chance 2008-08-25 05:22:42 UTC
Created attachment 314902 [details]
Sample patched 1.04, with 'y' glyph points and hinting instructions 're-cloned' from 1.03.

Comment 17 Caius Chance 2008-08-25 06:57:26 UTC
Check the whole code map, there are few other glyphs with similar problem:

Incorrect glyph points and missing hinting instructions for U+0079, U+03BC, U+0431, U+2010..2012.

Patched file is available:

https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-1.04.2.zip

https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-1.04.2.tar.gz

https://fedorahosted.org/liberation-fonts/export/877cd82cc8ef4b7f9f1b3645ad0dd54efe60e3fb/trunk/src/LiberationSans-Regular.sfd

Comment 18 Caius Chance 2008-08-26 04:30:09 UTC
Built in rawhide:

http://koji.fedoraproject.org/koji/taskinfo?taskID=785966

Comment 19 Sylvain Beucler 2008-08-26 19:58:37 UTC
Great!

By the way, I saw that this bug was also reported in the Trac instance a couple months ago:
https://fedorahosted.org/liberation-fonts/report/1
https://fedorahosted.org/liberation-fonts/ticket/2

You may want to close it (and possibly disable the bug tracker there).


Note You need to log in before you can comment on or make changes to this bug.