[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetype-devel
Subject:    Re: [ft-devel] Free tyep font - query
From:       Werner LEMBERG <wl () gnu ! org>
Date:       2009-12-01 6:09:29
Message-ID: 20091201.070929.180433720.wl () gnu ! org
[Download RAW message or body]


> (1) We couldn't be successful in getting display of more than one
> character.  The characters gets overlapped.

Uh, oh, this is basic programming...  You've modified the source
without thinking:


 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;

-
+  width = bitmap->width;
+  rows = 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;

-      image[j][i] |= bitmap->buffer[q * bitmap->width + p];
+      image[q][p] |= bitmap->buffer[q * bitmap->width + p];  <<<<< wrong!
     }
   }
+
+  printf("\n Bitmap Width %d",width);
+  printf("\n Bitmap Height %d",rows);
+  printf("\n Width %d",p);
+  printf("\n Height %d\n",q);
 }


The marked line causes your problems since you ignore any offset given
by x and y.

> (2) Since height and width of each character gets varied, how the
> starting position of drawing the next character be found.

The original example1.c code works just fine and does the expected!
Why not checking it carefully?  The position of the next glyph is
controlled by the last glyph's advance width (and height).  All these
details are discussed in the tutorial and the other documentation
files.

> It will be helpful if you support us as early as possible.

As others have already mentioned, this attitude is inappropriate for a
library which you are using for free, without any fees, and where
everyone is working as a volunteer in his sparetime.


    Werner


_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic