[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freetype] FT_Render_Glyph doesn't work well
From: |
jonathan . foster |
Subject: |
Re: [Freetype] FT_Render_Glyph doesn't work well |
Date: |
Sat, 17 May 2003 16:34:55 +0100 |
Hi,
"CHEN LIANG" <address@hidden> wrote:
> I use the FT_Render_Glyph function to render a char from the windows font>
> "arial",but I find there is only outline in the rendered bitmap .The inner
> part is not filled.Why ?
> The following is my test code
[...]
> char* pBitmap;
[...]
> if(pBitmap[i*bitmap_cols+j]>0) printf("1");
> else printf("0");
This looks like a problem with signed chars. A fully-opaque pixel will have
a value of (unsigned char)255 == (signed char)-1. So your test for >0 will
return false, except for the pixels around the edges that have values between
1 and 127.
What happens if you use "unsigned char *pBitmap" rather than "char *pBitmap"?
And/or change "if(pBitmap[i*bitmap_cols+j]>0)" to
"if(pBitmap[i*bitmap_cols+j]!=0)".
Kind regards,
Jon Foster
--