<div dir="ltr"><div class="gmail_extra"></div><div class="gmail_extra">Hello Martin,<br><br></div><div class="gmail_extra"><div class="gmail_quote">On Wed, May 18, 2016 at 8:30 AM, Martin Album Ytre-Eide <span dir="ltr"><<a href="mailto:Martin.Album.Ytre-Eide@nrpa.no" target="_blank">Martin.Album.Ytre-Eide@nrpa.no</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="direction:ltr;font-family:Tahoma;color:rgb(0,0,0);font-size:10pt">I am struggling with using the greek letter µ in my d.text from a python script:<br>
<br>
I trying something like this<br>
<br>
Module('d.text',text='µ',at=('85','20') charset='utf8')<br></div></blockquote><div><br></div><div>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:<br></div><div><br>export GRASS_FONT=Ubuntu:Regular<br>d.mon wx0<br>d.text text=θωερτψυιοπασδφγηςκλζχξωβνμάέήίϊΐόύϋΰώ at=5,95<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="direction:ltr;font-family:Tahoma;color:rgb(0,0,0);font-size:10pt">
<br>
I know that the issue is with the encoding of the characters..... but I do not know how to fix it.
<br></div></blockquote><div><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="direction:ltr;font-family:Tahoma;color:rgb(0,0,0);font-size:10pt">
<br>
In the gui i can use µ with add text layer - so I guess this is a python to grass issue.
</div></blockquote></div><br></div><div class="gmail_extra">The behavior is different (for good or bad) - in GUI, d.text is actually not used and wxPython text drawing is used instead.<br><br></div><div class="gmail_extra">Vaclav</div></div>