[GRASS-dev] [bug #5072] (grass) d.text.freetype does not print accented characters

Glynn Clements glynn at gclements.plus.com
Wed Aug 30 12:17:21 EDT 2006


Request Tracker wrote:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=5072
> -------------------------------------------------------------------------
> 
> Subject: d.text.freetype does not print accented characters
> 
> Platform: GNU/Linux/x86
> grass obtained from: CVS
> grass binary for platform: Compiled from Sources
> GRASS Version: cvs_head_20060829
> 
> Using accented characters in d.text.freetype fails for me.
> >From the first accented character onward, nothing is displayed, i.e
> 
> d.text.freetype -n text="Densité de la population" east_north=2,95 size=3 col=black path=/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf
> 
> displays
> 
> Densit 
> 
> This is on Debian testing, with libfreetype6 2.2.1

There is a bug in the built-in ISO-8859-1 -> UCS-4 decoder, which is
only used if iconv() isn't detected.

--- display/d.text.freetype/main.c	30 Aug 2006 02:00:46 -0000	2.11
+++ display/d.text.freetype/main.c	30 Aug 2006 16:14:49 -0000
@@ -799,10 +799,10 @@
 	p2 = *out;
 	for(i = 0; i <= l; i++)
 	{
-		p2[2*i+0] = 0;
-		p2[2*i+1] = 0;
-		p2[2*i+2] = 0;
-		p2[2*i+3] = text[i];
+		p2[4*i+0] = 0;
+		p2[4*i+1] = 0;
+		p2[4*i+2] = 0;
+		p2[4*i+3] = text[i];
 	}
 	ol = l * 4;
 #endif

Note that d.text.freetype requires iconv in order to use encodings
other than ISO-8859-1.

If your version of d.text.freetype was built to use iconv, then I
don't know what the problem is.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list