| Summary: | TrueType font which has embedded bitmaps was not properly rendered | ||
|---|---|---|---|
| Product: | SDL_ttf | Reporter: | Kouya Sakamoto <ksr> |
| Component: | misc | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
SDL_ttf.c.patch
render embbeded bitmap/graymap correctly |
||
|
Description
Kouya Sakamoto
2006-04-01 19:41:25 UTC
Created attachment 99 [details]
SDL_ttf.c.patch
Can you attach a link to a test font and a showfont command line, so I can test this out? I'm sorry that should have attached this. Sazanami Font is used well in Linux as Japanese font. http://osdn.dl.sourceforge.jp/efont/10087/sazanami-20040629.tar.bz2 Following command reproduce the issue: showfont sazanami-gothic.ttf There is no problem when you put a "-solid" option to command line. showfont -solid sazanami-gothic.ttf When I set a ptsize to between 8 and 21 with the font, I get a strange result. And I also reproduce the issue with some truetype fonts using generally in Linux as Japanese font, and fonts that come with Windows. We met this bug on Tux Paint(Drawing Program for Children: http://www.newbreedsoftware.com/tuxpaint/), and I confirmed that proposed patch is effective to fix this problem. Until now, with "Kochi" family fonts which has been mostly used as Japanese font on Linux, this bug appears only when relatively small font size (less than 16 point) is specified, so it seems remained unreported. But with "Sazanami" font, which should be alternative to "Kochi" fonts somtime soon, this bug appears up to 21 point, so this will become more serious. Created attachment 155 [details]
render embbeded bitmap/graymap correctly
FT_IS_SCALABLE() means that the font is in outline format,
but does not imply that outline is rendered as 8-bit grayscale,
because embedded bitmap/graymap is preferred (see FT_LOAD_DEFAULT
section of FreeType2 API Reference).
I fixed Load_Glyph() to look at the actual number of depth (bits
per pixel) of rendered bitmap/graymap. This patch includes
additional support for graymap in two- or four-bit per pixel.
(FontForge supports the creation of embedded graymap in TTF).
This is fixed in subversion revision 3284, thanks! |