Bug 503430 - Incorrect Kerning in some applications
Summary: Incorrect Kerning in some applications
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: liberation-fonts
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Caius Chance
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 463036 487581 510174
TreeView+ depends on / blocked
 
Reported: 2009-06-01 01:33 UTC by Cameron Zemek
Modified: 2010-08-03 00:51 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-21 07:21:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
1.04 in comparison with 1.00 (150.44 KB, image/png)
2009-06-26 04:44 UTC, Fyva
no flags Details
1.05.1.20090706.zip on Linux with Abiword and OOo 3.1.0 (30.16 KB, image/png)
2009-07-07 07:10 UTC, Fyva
no flags Details
generating fonts with traditional kerning in fontforge, step one (13.79 KB, image/png)
2009-07-07 13:03 UTC, hdu
no flags Details
generating fonts with traditional kerning in fontforge, step two (13.60 KB, image/png)
2009-07-07 13:04 UTC, hdu
no flags Details
generating fonts with traditional kerning in fontforge, step three (14.99 KB, image/png)
2009-07-07 13:05 UTC, hdu
no flags Details
kerning for Liberation Serif in liberation-fonts-ttf-1.05.1.20090721.zip (9.55 KB, image/png)
2009-07-21 05:36 UTC, Fyva
no flags Details


Links
System ID Private Priority Status Summary Last Updated
OpenOffice.org 103157 0 None None None Never

Description Cameron Zemek 2009-06-01 01:33:59 UTC
Description of problem: The kerning is incorrect in some applications.

How reproducible: Always


Steps to Reproduce:
1. Install the Microsoft Corefonts for comparions (corefonts.sf.net)
2. Load Abiword and type "Test AV fi" on first and second line. Set first line to Arial and second line to Liberation Sans.
3. Repeat step 2 in Openoffice
  
Actual results:
The kerning is incorrect in Openoffice

Expected results:
The kerning should match in Openoffice

Additional info:
The same problems occurs when using the Liberation fonts with Apache FOP (http://xmlgraphics.apache.org/fop/)

Comment 1 Bug Zapper 2009-06-09 16:54:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Fyva 2009-06-26 04:33:40 UTC
The kerning of Liberation Serif font version 1.04 is not working neither on Linux, nor on Windows. Tested with OpenOffice.org.
Liberation Serif Version 1.00 works OK on Linux.
Liberation Serif Version 1.03 works OK on Windows.
Liberation Serif Version 1.04 does not work neither on Linux nor on Windows.

Comment 3 Fyva 2009-06-26 04:44:54 UTC
Created attachment 349507 [details]
1.04 in comparison with 1.00

Comment 4 Caius Chance 2009-07-01 02:52:21 UTC
Zap this bug. Please reopen if bug persists after testing on latest version.

Comment 5 Nicolas Mailhot 2009-07-01 11:07:24 UTC
As an aside, OO.o devs posted on how to generate OO.o-compatible kerning in fontforge here:

http://www.openoffice.org/issues/show_bug.cgi?id=103157

« Liberation 1.00 to 1.03 contained the traditional kern tables, but 1.04 did neither contain them nor 
their newer GPOS.kern counterparts. Version 1.05 provides kerning details only via GPOS, but not via 
the traditional tables. Since 1.05 onyl uses the "pair adjustment" type of GPOS.kern there is no good 
reason they do not also provide the traditional tables.

Especially when considering the OpenType 1.06 specification, which is quite clear on that topic: "Fonts 
intended for cross-platform use or for the Windows platform in general should conform to the 'kern' 
table format". I support this notion.

@fyva: if you use fontforge to create your fonts please do not forget to enable the "Traditional Kerning"
checkbox in File->GenerateFonts->Options->SFNT »

Comment 6 Caius Chance 2009-07-02 23:47:56 UTC
Thanks for info. I am redoing the conversion with your suggestions.

Comment 7 Caius Chance 2009-07-06 05:19:38 UTC
Hi Nicolas, could you do me a favor for taking screenshot on "GenerationFonts window" and "SFNT windows" so I could check correct options when generating the font please? Thanks a lot!

Comment 9 Fyva 2009-07-07 07:10:37 UTC
Created attachment 350739 [details]
1.05.1.20090706.zip on Linux with Abiword and OOo 3.1.0

Version 1.05.1.20090706.zip don't show kerning on Linux and Windows in OpenOffice.org 3.1.0 for Liberation Serif.
Liberation-fonts-ttf-1.05.1.20090706.tar.gz is broken? (liberation-fonts-ttf-1.05.1.20090630.tar.gz too?)
md5sum fb44d8d873d75ea21a8e34a752b33c59  liberation-fonts-ttf-1.05.1.20090630.tar.gz
md5sum 20552f52883a8a1440e13526f3765313  liberation-fonts-ttf-1.05.1.20090706.tar.gz
It gives this error when extracting with tar on Linux:
tar: Skipping to next header
tar: Error exit delayed from previous errors
7-zip on Linux and 7-zip on Windows can't open them too (can open gz, but can't open tar)

On Windows the kerning do not work too for 1.05.1.20090706.zip in OOo 3.1.0.
(Liberation fonts in these archives opened with FontForge (or font preview on Windows) show wrong version number 1.02.)

Comment 10 hdu 2009-07-07 11:11:48 UTC
The new fonts do not contain the traditional kern tables either. I will attach the fontforge screenshots to guide you how to generate them.

Comment 11 hdu 2009-07-07 13:03:33 UTC
Created attachment 350791 [details]
generating fonts with traditional kerning in fontforge, step one

Comment 12 hdu 2009-07-07 13:04:22 UTC
Created attachment 350792 [details]
generating fonts with traditional kerning in fontforge, step two

Comment 13 hdu 2009-07-07 13:05:13 UTC
Created attachment 350793 [details]
generating fonts with traditional kerning in fontforge, step three

Comment 14 Caius Chance 2009-07-08 00:20:27 UTC
(In reply to comment #9)
> On Windows the kerning do not work too for 1.05.1.20090706.zip in OOo 3.1.0.
> (Liberation fonts in these archives opened with FontForge (or font preview on
> Windows) show wrong version number 1.02.)  

Hi, thanks for info.

a. I am doing repack now.
b. I have this one acknowledged. Will file another bug for record.

Comment 15 Caius Chance 2009-07-08 00:20:54 UTC
(In reply to comment #10)
> The new fonts do not contain the traditional kern tables either. I will attach
> the fontforge screenshots to guide you how to generate them.  

Thanks for screenshot!

Comment 16 Caius Chance 2009-07-08 00:25:08 UTC
(In reply to comment #13)
> Created an attachment (id=350793) [details]
> generating fonts with traditional kerning in fontforge, step three  

Is all other checkboxes correct on the screenshot of step three?

I used scripts to utilize fontforge to create TTFs from SFDs. Am I supposed to add 'Old Style kern' in the scripts also?

Comment 17 hdu 2009-07-08 06:59:20 UTC
> Is all other checkboxes correct on the screenshot of step three?

You seem to use *sfd files for editing+managing the fonts and then generate the font files from them? If this is so then it makes sense to keep the checkboxes regarding "PfaEdit Tables" disabled.

If fontforge didn't default to enable the checkbox for "PS Glyph Names" I wouldn't have enabled it either. They only cost a few KB though and maybe other apps have some use for them.

> I used scripts to utilize fontforge to create TTFs from SFDs. Am I supposed to add 'Old Style kern' in the scripts also?

I guess so.

Since you are targeting the fonts also for Windows please be aware of the problem I outlined in http://www.openoffice.org/issues/show_bug.cgi?id=102911#desc16
Just make sure that all glyphs references in kerning pairs have a codepoint inside the unicode baseplane assigned.

Comment 18 Nicolas Mailhot 2009-07-08 07:47:52 UTC
(In reply to comment #17)

> > I used scripts to utilize fontforge to create TTFs from SFDs. Am I supposed
> > to add 'Old Style kern' in the scripts also?
> 
> I guess so.

It seems best practice to include old tables for now as some software does not work properly otherwise (though said software should also fix its font support bugs, we can't make sure every possible font in the distro respects this even if we do try to improve their overall quality)

I don't have the faintest idea how it works scripts-wise. Asking on fontforge lists is probably the right channel (if you need a specific fontforge version for it to work I'm sure our fontforge maintainer will be happy to update it)

Comment 19 Nicolas Mailhot 2009-07-08 07:51:46 UTC
(In reply to comment #17)
> > Is all other checkboxes correct on the screenshot of step three?

> Since you are targeting the fonts also for Windows please be aware of the
> problem I outlined in
> http://www.openoffice.org/issues/show_bug.cgi?id=102911#desc16
> Just make sure that all glyphs references in kerning pairs have a codepoint
> inside the unicode baseplane assigned.  

@hdu please open DejaVu bugs at DejaVu upstream. Also, is this a problem for FLOSS windows apps that go through cairo and fontconfig (as they should nowadays?)

http://behdad.org/text/

Comment 20 hdu 2009-07-10 12:01:40 UTC
> @hdu please open DejaVu bugs at DejaVu upstream

Here we are working on getting the liberation fonts into good shape. Testing them for common problems seen in related fonts (like DejaVu) should be considered to be a valid concern. Else there is that easily avoidable risk that new releases fail on windows with exactly the same symptoms.

> Also, is this a problem for FLOSS windows apps that go through cairo and fontconfig (as they should
> nowadays?)

AFAIK most applications on Windows are not yet ported to to go through cairo or fontconfig for their graphics needs. These could be considered obsolete irrelevant by some but this is probably quite hard to convicnenot the consensus of the users on that platform. If these other apps depend on the Windows GDI call GetKerningPairs() instead they have the same problem. I'm sorry I cannot provide the exact list of every app (be it FLOSS or traditional) and the exact versions that are affected. If somebody else can provide such a list this would be most appreciated. All I'm saying is that this problem would affect every application that relies on the GetKerningPairs() call.

Comment 21 Caius Chance 2009-07-13 06:35:21 UTC
http://koji.fedoraproject.org/koji/taskinfo?taskID=1470687

Tried added fmflags in fontforge script, to include old style kern table during generation from SFDs to TTFs.

Comment 23 hdu 2009-07-13 13:47:45 UTC
> Please check if traditional kern table is are there

Sorry, they are not.

> Could anyone kindly share procedures of test?

The quickest way to check if the table is there is by just doing
   hexdump -C LiberationSans-Regular.ttf 
which will result in something like
00000000  00 01 00 00 00 12 01 00  00 04 00 20 46 46 54 4d  |........... FFTM|
00000010  49 21 dd a2 00 02 0f b0  00 00 00 1c 47 44 45 46  |I!..........GDEF|
00000020  00 27 02 a5 00 01 fe 8c  00 00 00 1e 47 50 4f 53  |.'..........GPOS|
00000030  ec 90 e4 de 00 01 fe fc  00 00 10 b4 47 53 55 42  |............GSUB|
00000040  93 3c 82 4b 00 01 fe ac  00 00 00 50 4f 53 2f 32  |.<.K.......POS/2|
00000050  f7 1a 8b 76 00 00 01 a8  00 00 00 60 63 6d 61 70  |...v.......`cmap|
00000060  1d c3 05 9f 00 00 0c 84  00 00 0b b6 63 76 74 20  |............cvt |
00000070  41 f4 43 ea 00 00 22 1c  00 00 02 14 66 70 67 6d  |A.C...".....fpgm|
00000080  73 d3 23 b0 00 00 18 3c  00 00 07 05 67 61 73 70  |s.#....<....gasp|
00000090  00 18 00 09 00 01 fe 7c  00 00 00 10 67 6c 79 66  |.......|....glyf|
000000a0  93 48 ad 96 00 00 29 70  00 01 b8 f4 68 65 61 64  |.H....)p....head|
000000b0  f2 fb 5b ca 00 00 01 2c  00 00 00 36 68 68 65 61  |..[....,...6hhea|
000000c0  0e 4b 08 a2 00 00 01 64  00 00 00 24 68 6d 74 78  |.K.....d...$hmtx|
000000d0  2e dd 09 42 00 00 02 08  00 00 0a 7c 6c 6f 63 61  |...B.......|loca|
000000e0  50 0f c1 1e 00 00 24 30  00 00 05 40 6d 61 78 70  |P.....$0...@maxp|
000000f0  07 04 07 d0 00 00 01 88  00 00 00 20 6e 61 6d 65  |........... name|
00000100  23 57 ab c2 00 01 e2 64  00 00 07 fb 70 6f 73 74  |#W.....d....post|
00000110  5a cf 99 96 00 01 ea 60  00 00 14 19 70 72 65 70  |Z......`....prep|

The table-name-tags are easily visible in the hexdump. Please note that the "kern" tag is missing in this example as the traditional kern table is missing in the font file.

Try TTX (from http://sourceforge.net/projects/fonttools/) if you don't like the hexdump-method.

Another method to check if the font is directly usable on Windows is to use the GetKerningPairs() API for this font and check the result.

Comment 24 Caius Chance 2009-07-13 23:40:56 UTC
I generated from the SFD to the TTF manually with fontforge (on Fedora 11) and the kern table is there:

$ hexdump -C LiberationSans.ttf |grep kern
000000d0  2e dd 09 42 00 00 02 18  00 00 0a 7c 6b 65 72 6e  |...B.......|kern|

However, I could not make it with my fontforge script. Need to confirm if the fmflags are only working on specific later versions of fontforge.

Comment 26 hdu 2009-07-14 07:22:54 UTC
These fonts have the same problem...

Seeing that the related question regarding fontforge-scripting has been answered in fontforge-devel (http://sourceforge.net/mailarchive/forum.php?thread_name=20090714045412.GA4545%40khaled-laptop&forum_name=fontforge-devel) we're getting close though.

Comment 28 Fyva 2009-07-21 05:36:31 UTC
Created attachment 354434 [details]
kerning for Liberation Serif in liberation-fonts-ttf-1.05.1.20090721.zip

It seems that these fonts work properly (see picture, tested on Linux with OOo310m11).

(BTW, the archives tar.gz are apparently OK. I get the error due to my time settings:
tar: ttf/LiberationMono-BoldItalic.ttf: time stamp 2009-07-21 05:48:21 is 9045.718828424 s in the future )


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