Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrueType font which has embedded bitmaps was not properly rendered #3

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: unspecified
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2006-04-01 19:41:25 +0000, Kouya Sakamoto wrote:

Hi,

SDL_ttf can't properly render some size of TrueType font which has embedded bitmaps
in case of using TTF_Render..._Shaded() or TTF_Render..._Blended() function.
As its result, we get block images filled noise.

Attached patch prevent this problem by loading only outlined glyph
if it was called from above functions with scaled font.

Regards.

On 2006-04-01 19:44:43 +0000, Kouya Sakamoto wrote:

Created attachment 99
SDL_ttf.c.patch

On 2006-05-01 05:39:25 +0000, Sam Lantinga wrote:

Can you attach a link to a test font and a showfont command line, so I can test this out?

On 2006-05-06 22:39:58 +0000, Kouya Sakamoto wrote:

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.

On 2006-07-21 00:08:21 +0000, TOYAMA Shin-ichi wrote:

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.

On 2006-07-29 23:52:15 +0000, KANOU Hiroki wrote:

Created attachment 155
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).

On 2007-07-14 23:18:52 +0000, Sam Lantinga wrote:

This is fixed in subversion revision 3284, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant