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).

[image: test-on-7-inch.png]

https://docs.google.com/open?id=0B49ffoLIUA2YODVjNjFmZDItZjg2Yy00ODZkLTg2MTQtNWFhOTVhZDY2Yjkw



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.

[image: text-with-problem.png]

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.


[image: text-with-problem-boundary.png]
https://docs.google.com/open?id=0B49ffoLIUA2YNzU0NTBiNjktNDAzMC00OWUzLThlZDYtN2E5NTRhZTUxZjBl

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;
}

[image: v-j-autohint.png]

https://docs.google.com/open?id=0B49ffoLIUA2YZGY0MDU4NWEtZDZmMC00MGI0LThlNDQtNzQxYTBiZjdkM2Rh

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

<<test-on-7-inch.png>>

<<v-j-autohint.png>>

<<text-with-problem.png>>

<<text-with-problem-boundary.png>>

_______________________________________________
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype

Reply via email to