Hello all,


I have some invisible characters in a string to use them as marker and in a 
specific configuration of size of characters and window I get an assert when 
GrText() is called.



Example:

Char* MyString="A\nB";

Font proportional   1st character description=0x20   width of A=12pixels   
width of B=12pixels    

Window width= 24pixels

Nano-X V0.92



When GrText() is called, linear8_drawpixel() aborts with 

User assertion failed: "x >= 0 && x < psd->xres", at fblin8.c:55



I think it is due to the test in gen_gettextsize() which is not similar to the 
test in gen_gettextbits() in genfont.c



gen_gettextsize() assumes the size of char '\n' = 0pixel

but gen_gettextbits() assumes char '\n' =1st char = SPACE



I did this modification in gen_gettextsize() of genfont.c 

-      if(c >= pf->firstchar && c < pf->firstchar+pf->size)

        width += pf->width[c - pf->firstchar];



+      /* if char not in font, map to first character by default*/

+      if(c < pf->firstchar || c >= pf->firstchar+pf->size)

+        c = pf->firstchar;

       width += pf->width[c - pf->firstchar];



Regards,

Guy


Reply via email to