I'm using wordwrap in the expression dialog to wrap the field "name" after the 12th character (first line) and the 20th character (second line):

 wordwrap( wordwrap("name"),12),20)

So far so good. I could also use the "warp on character"-function in the Format-Dialog in the Layer-Properties. But the first way is the best solution in my case.

But there is one problem: if I use the wordwrap, I'm not able to use the "Alignment" by expression!

enter image description here

For me, it seems like a bug? Is there a other way to align my labels?

  • I can confirm this issue. Please report it on hub.qgis.org/projects/quantum-gis/issues – underdark Dec 7 '14 at 20:30
  • 1
    But calling wordwrap inside wordwrap does not lead to the results you seem to want to achieve because wordwrap affects the whole string anyway and not just the next linebreak. – underdark Dec 7 '14 at 20:33
  • @MAP currently the multiline alignment only works when you use the wrap on character option. I have a fix to get it working using the wrapword function as well. I will issue a pull request on github project. – lrssvt Dec 8 '14 at 16:51
  • Nice! I already placed a bug report: hub.qgis.org/issues/11805 – MAP Dec 8 '14 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.