[GRASS5] [bug #2129] (grass) d.text.freetype: bad rendering

Request Tracker grass-bugs at intevation.de
Wed Sep 24 07:31:52 EDT 2003


this bug's URL: http://intevation.de/rt/webrt?serial_num=2129
-------------------------------------------------------------------------

Subject: d.text.freetype: bad rendering

Platform: GNU/Linux/i386
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: 5.3-cvs & 5.0.3rc

d.text.freetype creates jumbled snow where the letters should be.

Happens on Redhat Redhat 9 & Debian/testing, both with font=luxi* and path=/a/b/c/font.ttf. It doesn't seem to do it on Redhat 7.3 (not very much testing) with path= but I don't have the b&h luxi fonts installed there so font= doesn't exist as an option.

This seems to happen somewhat randomly. It will usually get at least one letter correct though. Resizing the monitor window vertically and redrawing will make other letters 'come in to focus' while letters that were good will frazzle. Resizing the monitor window horizontally doesn't change the it at all. It gets it right about 50% of the time, more when the monitor height is small, less when it is tall.

e.g.
http://bambi.otago.ac.nz/hamish/grass/bad_freetype.png

Notice the letters are almost right, it just seems to be wrapping the right hand side too soon and advancing the pixel buffer too much. At least it seems to be drawing it consistently for a given monitor-window size ..
I'm not sure if the buffer is filled too wide for the drawing-rectangle or the drawing loop is jumping to the next line too soon.

B&H Luxi is a Monospaced font, right? But that shouldn't matter.

I can't find any documentation for src/libes/raster/Raster.c  R_raster_char() or really know how to pull apart draw_character() much more.


Making the following change makes the letters somewhat viewable on my system, but it certainly isn't correct. (note I've removed some white space to stop the patch line wrapping in the bug-input box)



$ cvs diff -u main.c 
Index: main.c
===================================================================
RCS file: /home/grass/grassrepository/grass/src/display/d.text.freetype/main.c,v
retrieving revision 1.41
diff -u -r1.41 main.c
--- main.c      1 Apr 2003 06:51:32 -0000       1.41
+++ main.c      24 Sep 2003 10:39:41 -0000
@@ -998,7 +998,7 @@
     for(i = start_row; i < rows; i++)
         {
             R_move_abs(rect.l + start_col, rect.t + i);
-            R_raster_char(w, 1, 0, buffer + width * i + start_col);
+            R_raster_char(w, 1, 0, buffer + (width+7) * i + start_col);
          }
 
 #ifdef FLUSH_EACH_CHAR




??
Hamish


-------------------------------------------- Managed by Request Tracker




More information about the grass-dev mailing list