[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Pitch Smaller Than Bitmap Width + Make Build Errors
From: |
Werner LEMBERG |
Subject: |
Re: [ft] Pitch Smaller Than Bitmap Width + Make Build Errors |
Date: |
Thu, 12 Feb 2009 13:16:25 +0100 (CET) |
>> 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.
>
> 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.
Hehe.
I've now decided to leave the code as-is. The main reason is that the
necessary bitmap conversion routines are in ftbitmap.c, which is an
add-on module not necessary otherwise. Many people use FreeType only
for fonts without embedded bitmaps; calling FT_Bitmap_Convert()
automatically would just increase the code size without gaining any
effect.
Another reason is that the current behaviour actually *is* documented,
sort of:
FT_Render_Mode
...
An enumeration type that lists the render modes supported by
FreeType 2. Each mode corresponds to a specific type of scanline
conversion performed on the outline.
For bitmap fonts the ‘bitmap->pixel_mode’ field in the
FT_GlyphSlotRec structure gives the format of the returned bitmap.
I'll try to improve the description.
Werner