Skip to main content

[JAVA2D] Correct Font Kering in Java

1 reply [Last post]
Anonymous

When will Java finally support correct font metrics? Until now,
Java(2D) seems to ignore kerning tables in both PostScript and TrueType
fonts completely. Every high quality, non-monospaced font defines
hundreds of kerning pairs, ignoring them completely results in medium
quality rendering.

I'm not talking about inter character spacing, I'm talking about the
kerning values that are defined for special character pairs (e.g. W-A,
A-V, T-y, ...). Only when these values are taken into account while
rendering, the font is displayed correctly.

Some months ago, I've posted a workaround to this list that uses the
iText library to load the kerning tables from truetype fonts seperately
and then uses these values to correct the glyph vectors. The code is
very simple, only a few lines are needed. This should really make it
somehow into the next java release:

http://www.mail-archive.com/java2d-interest@capra.eng.sun.com/
msg02803.html

Best

J�rg

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Phil Race

there's an open RFE 4339577: Adding kerning to the text layout process

So still in the future. Sorry.

-Phil.

J�rg Lehni wrote:
> When will Java finally support correct font metrics? Until now,
> Java(2D) seems to ignore kerning tables in both PostScript and TrueType
> fonts completely. Every high quality, non-monospaced font defines
> hundreds of kerning pairs, ignoring them completely results in medium
> quality rendering.
>
> I'm not talking about inter character spacing, I'm talking about the
> kerning values that are defined for special character pairs (e.g. W-A,
> A-V, T-y, ...). Only when these values are taken into account while
> rendering, the font is displayed correctly.
>
> Some months ago, I've posted a workaround to this list that uses the
> iText library to load the kerning tables from truetype fonts seperately
> and then uses these values to correct the glyph vectors. The code is
> very simple, only a few lines are needed. This should really make it
> somehow into the next java release:
>
> http://www.mail-archive.com/java2d-interest@capra.eng.sun.com/
> msg02803.html
>
> Best
>
> J�rg
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help"
> .

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".