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.
https://docs.google.com/open?id=0B49ffoLIUA2YZDkwMTAzNmEtYTEyMy00MDVjLThmNTgtMzY4ZTRiYTJhMGEw
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')){
loadFlag |= FT_LOAD_FORCE_AUTOHINT;
}
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.
Thanks,
Antonio