freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] freetype rendering problems


From: Mauro Conzato
Subject: [ft-devel] freetype rendering problems
Date: Thu, 9 Aug 2012 10:28:01 +0200

Hello,

 

We have a strange rendering issue with freetype library that is driving us to ask an opinion from you.

Our application is using two free true type fonts: DejaVuSans.ttf and DejaVuSans-Bold.ttf, in monochrome bitmap way, with horizontal alignment; the issue basically consists in the following: the ‘r’ character is being displayed in a higher position, on the baseline.  

 

 

Two different versions of freetype library are producing a different result:

-  a relative recent version of ft (2.4.6) is showing the problem

-  an older version of ft (2.3.9) is properly displaying the character

 

 

I have made some debug and discovered the following:

- If I reduce the horizontal bearing Y parameter, the char is properly aligned on the baseline

- the metrics are showing me that there is not difference on the values  that are managing the bitmap glyph, so it seems that the horizontal bearing Y recovered from the font file, through the library are the same. So,  since the code base that is managing the application is the same, I am wondering where the issue is.

 

I have created a prototype application that loads the font, render them in a txt file with a specific char in the pixels that are full of color (‘o’) and also prints out the metrics values. The code is in attachment. The final result is that old version of freetype load the glyph in this way

 

....

OOO.

O...

O...

O...

O...

O...

 

bitmapGlyph->metrics:

bitmapGlyph->metrics.height 7

bitmapGlyph->metrics.horiAdvance 4

bitmapGlyph->metrics.horiBearingX 1

bitmapGlyph->metrics.horiBearingY 7

bitmapGlyph->metrics.vertAdvance 11

bitmapGlyph->metrics.vertBearingX -2

bitmapGlyph->metrics.vertBearingY 3

bitmapGlyph->metrics.width 4

 

 

while the new one:

 

OOO

O..

O..

O..

O..

O..

 

bitmapGlyph->metrics:

bitmapGlyph->metrics.height 7

bitmapGlyph->metrics.horiAdvance 4

bitmapGlyph->metrics.horiBearingX 1

bitmapGlyph->metrics.horiBearingY 7

bitmapGlyph->metrics.vertAdvance 11

bitmapGlyph->metrics.vertBearingX -2

bitmapGlyph->metrics.vertBearingY 3

bitmapGlyph->metrics.width 4

 

 

So I can see a difference on the bitmap, but since the font file is the same, the code is the same, just the freetype libraries are different.

I am wondering if there is another parameter or test that I can do in order to understand what is going on; have you got any suggestions?

 

Thanks in advance for your consideration.

Mauro

Attachment: test.cpp
Description: test.cpp


reply via email to

[Prev in Thread] Current Thread [Next in Thread]