You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Manuel Mall <ma...@apache.org> on 2007/01/13 06:32:15 UTC
Kerning and hyphenation
While looking into the support for the Soft Hyphen the area of
hyphenation combined with kerning is causing me trouble.
Aside 1: our fonts page claims we don't support kerning but I believe we
do.
Aside 2: Our tests are based on setting the base14kerning flag. I don't
think this flag is documented anywhere on the fop site. Can it be set
in the config file?
I wrote a simple test under fop 0.93 and noticed that the ipd of text
areas with the combination of kerning and hyphenation are not correctly
calculated (at least I think so). With the Base 14 sans-serif font at
20pt we get:
Word "vanda" alone on a line: ipd=53980
Word "vandavanda" alone on a line: ipd=107560 (53980+53980-400)
Word "vandavandavanda" alone on a line: ipd=161140
(53980+53980+53980-400-400)
If we now take the word "vandavandavandavanda" and get it hyphenated
after the 3rd "vanda" the line containing "vandavandavanda-" reports an
ipd of 168800 which is incorrect. I think it should be 161140 + 6660
(width of hyphen) = 167800.
Before I investigate this more can someone else check this and see if
they get similar results.
I have attached the test case I have constructed.
Manuel
Re: Kerning and hyphenation
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 13.01.2007 06:32:15 Manuel Mall wrote:
> While looking into the support for the Soft Hyphen the area of
> hyphenation combined with kerning is causing me trouble.
>
> Aside 1: our fonts page claims we don't support kerning but I believe we
> do.
Yes, we do.
> Aside 2: Our tests are based on setting the base14kerning flag. I don't
> think this flag is documented anywhere on the fop site. Can it be set
> in the config file?
Not yet, no, only through the FopFactory.
> I wrote a simple test under fop 0.93 and noticed that the ipd of text
> areas with the combination of kerning and hyphenation are not correctly
> calculated (at least I think so). With the Base 14 sans-serif font at
> 20pt we get:
>
> Word "vanda" alone on a line: ipd=53980
> Word "vandavanda" alone on a line: ipd=107560 (53980+53980-400)
> Word "vandavandavanda" alone on a line: ipd=161140
> (53980+53980+53980-400-400)
> If we now take the word "vandavandavandavanda" and get it hyphenated
> after the 3rd "vanda" the line containing "vandavandavanda-" reports an
> ipd of 168800 which is incorrect. I think it should be 161140 + 6660
> (width of hyphen) = 167800.
I think you mean it is 168600 (that's what I get) and it should be
167800, which is a difference of 800mpt. 800mpt looks much like two
times 400mpt kerning which are not removed from the area objects's IPD
for the break at a hyphenation point. However, I'd expect a difference
of only 400mpt, not 800mpt. I did fix [1] the behaviour for that
condition so the layout looks correct, but apparently I didn't adjust
the IPD for the area object.
[1] http://svn.apache.org/viewvc?rev=407774&view=rev
> Before I investigate this more can someone else check this and see if
> they get similar results.
>
> I have attached the test case I have constructed.
>
> Manuel
>
>
>
Jeremias Maerki