Hello Martin,

On Wed, May 18, 2016 at 8:30 AM, Martin Album Ytre-Eide <
[email protected]> wrote:

> I am struggling with using the greek letter µ in my d.text from a python
> script:
>
> I trying something like this
>
> Module('d.text',text='µ',at=('85','20') charset='utf8')
>

you need to set GRASS_FONT to some font which supports Greek letters. Use
d.fontlist or d.font -l to get the proper names of fonts. This works for me
in command line on Ubuntu:

export GRASS_FONT=Ubuntu:Regular
d.mon wx0
d.text text=θωερτψυιοπασδφγηςκλζχξωβνμάέήίϊΐόύϋΰώ at=5,95


>
> I know that the issue is with the encoding of the characters..... but I do
> not know how to fix it.
>

I'm not sure which operating system you are using but on Linux, you usually
don't need to set the font, everything is UTF-8.


>
> In the gui i can use µ with add text layer - so I guess this is a python
> to grass issue.
>

The behavior is different (for good or bad) - in GUI, d.text is actually
not used and wxPython text drawing is used instead.

Vaclav
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to