freetype
[Top][All Lists]
Advanced

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

Re: [ft] Pitch Smaller Than Bitmap Width + Make Build Errors


From: Mickey Gabel
Subject: Re: [ft] Pitch Smaller Than Bitmap Width + Make Build Errors
Date: Wed, 11 Feb 2009 13:05:42 +0200
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Werner LEMBERG wrote:
I did not realize that even when I ask (and usually get) 8bpp
anti-aliased bitmaps, it seems that FT2 can still occasionally give
me 1bpp bitmaps.  I guess this is an embedded bitmap? I just assumed
that FT2 would convert it to 8bpp because I said
FT_RENDER_MODE_NORMAL.

I think either the docs are misleading or this is a bug.

Basically, it's a bug.  Theoretically, I could fix this by making
FT_Render_Glyph() call FT_Bitmap_Convert().  However, for backwards
compatibility, I fear this might not be a good idea, but I'm unsure.

Opinions, please.


    Werner

My two cents (haven't been using FT2 long enough to have an actual dollar):

1) If one is writing a string rendering routine, previously they would have to support both 8bpp and 1bpp bitmaps. If suddenly FT2 stops giving 1bpp bitmaps, then all that means is that the code path for 1bpp is not used anymore. The routine still works. I bet many people like me already stumbled on this case, shrugged, and implemented the 1bpp code path, assuming this is correct behaviour.


2) Actively asking FT for 8bpp rendering, yet still EXPECTING 1bpp bitmap on purpose seems like a very strange to do. I mean, if I ask for 8bpp, at the very least I should handle the case where I get what I asked for :) From an API standpoint, it seems a good change unless someone is doing something rather strange.

3) The biggest issues seems to me that there is performance AND memory consideration, as the additional conversion would require more memory than before, and would take more time to render.

4) Maybe change the meaning of FT_RENDER_MODE_NORMAL?
It could mean: "FT2 gives you 8bpp when we render, and occasionally 1bpp embedded bitmaps". Then you could add a flag for FT_RENDER_MODE_FORCE_8BIT, for those people who really insist on 8bpp and don't want to write the 1bpp code path? The problem with this idea is that it's kind of taking the default, easy option. Like, "we don't really change anything, so you get the old (bad) behaviour unless you manually turn on the magic damn-you-get-it-right flag."

Disclaimer: I am a new user of FT2, and I use it only for rendering, so obviously there are things I have not considered,

Mickey





reply via email to

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