freetype
[Top][All Lists]
Advanced

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

Re: [ft] about setting character sizes


From: harshagomes
Subject: Re: [ft] about setting character sizes
Date: Thu, 9 Apr 2009 00:17:02 -0700 (PDT)

my need is to display names of streets and roads in maps...

the problem am getting right now is, the characters of names appear
crumpled...

i am currently getting 4-byte values from the face->glyph->bitmap
as shown below:

code snippet:

//declarations
unsigned char OutputBuffer[240][268];
height = 268;
width = 240;

//the function
void draw_bitmap( FT_Bitmap*  bitmap, FT_Int x, FT_Int y )
{
    FT_Int  i, j, p, q;
    FT_Int  x_max = x + bitmap->width;
    FT_Int  y_max = y + bitmap->rows;

    for ( i = x, p = 0; i < x_max; i++, p++ )
    {
      for ( j = y, q = 0; j < y_max; j++, q++ )
      {
         if ( i < 0      || j < 0       ||
              i >= width || j >= height )
                         continue;
        else
        { 
                BYTE r = bitmap->buffer[q * bitmap->width + p];
                BYTE g = bitmap->buffer[q * bitmap->width + p];
                BYTE b = bitmap->buffer[q * bitmap->width + p];
                BYTE a = 255;
                RGBQUAD colorbit = { r,g,b,a }; 
                OutputBuffer[ i ][ j ] = colorbit;   
        }
      }
   }
}



as explained, if i try to blit the 'OutputBuffer' onto the window DC, am
gettin the texts crumpled..

i really cant figure out the reason why am getting like this..
am struck up with this for quite some time... 
so pls help...                   

thanks.


Werner LEMBERG wrote:
> 
> 
>> the demo programs works fine...
> 
> Then the problem lies on your side :-)
> 
>> and using wingdi renderer
> 
> What's this?
> 
>> after loading each character glyphs...  am copying the
>> face->glyph->bitmap buffer onto the window DC by blitting it...
> 
> What about using the ft2demos code as a template, fitting it to your
> needs step by step?
> 
> 
>     Werner
> 
> 
> _______________________________________________
> Freetype mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/freetype
> 
> 

-- 
View this message in context: 
http://www.nabble.com/about-setting-character-sizes-tp22944331p22965658.html
Sent from the Freetype - User mailing list archive at Nabble.com.





reply via email to

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