[Top][All Lists]

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

[ft] Problem rendering V and Y less than 12 pixel text

From: Antonio Bigi
Subject: [ft] Problem rendering V and Y less than 12 pixel text
Date: Wed, 18 Jan 2012 16:33:56 +0100

Hi all,
I'm using freetype2 on an embedded device. When I run my application on device with 7-inch display all the glyphos are rendered fine (as shown in the image above).


If I run the same application on a device with 9-inch or 12-inch display some glyphos (V, v, Y and y) are not rendered correctly. As shown in the image above.


7-inch and 9-inch display has 135 DPI, while 12-inch display has 96 DPI.
The size of the text is set using FT_Set_Pixel_Sizes(fHandler->face, 0, fontH);

In the image above I colored in red the whole canvas and in yellow the bitmap glyph area.


I get the bitmap using the following code:

error = FT_Load_Char(fHandler->face, c, loadFlag);
if (error)
return -1;

FT_GlyphSlot bitmapGlyph = fHandler->face->glyph;
FT_Bitmap& bitmap = bitmapGlyph->bitmap;

Do you have any suggestions on how to resolve this problem?

I approach a dirty solution forcing autohint during load of V and Y characters

if (fontH<12 && strlen(text)==1 && (text[0]=='V'||text[0]=='v' || text[0]=='y'||text[0]=='Y')){


It works on 12-inch display but I think this solution is too specific and dirty to avoid that other problems appear in the future on other display models.
Using always autohint flag the quality of rendering became poor.


reply via email to

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