7

I have some Chinese labels to display on a map and I want them to be vertical, as the picture shows.

In another word, I want to rotate the label while keeping each character upright. How could I achieve this?

example

9

If you are using QGIS 3.10 or later, set the orientation to vertical in the Labels > Formatting.

enter image description here

See also the Visual changelog.

Enjoy!

| improve this answer | |
6

For younger than QGIS 3.10 versions, e.g. QGIS 3.4 open 'Layer Properties > Labels > Expression Dialog'

example1

In 'Function Editor' create a new function with such code:

from qgis.core import *
from qgis.gui import *

@qgsfunction(args='auto', group='Custom')
def string_to_list(field, feature, parent):
    field_as_list = list(field)
    field_as_list_rot = []
    for i in field_as_list:
        field_as_list_rot.append(i + '\n')
    return field_as_list_rot

Apply 'Save and Load functions'

function

And then slightly adjust the expression that has to be used as this one

 regexp_replace(array_to_string(string_to_list("Name")),',','')

where array_to_string() and regexp_replace() are native QGIS functions

Click 'Apply' and get the result

result

| improve this answer | |
4

Using QGIS 3.10 you can actually change the text direction under labels > formatting from horizontal to vertical.

enter image description here

| improve this answer | |
  • What should do those who do not understand Deutsch? =) – Taras Mar 30 at 11:54
  • 1
    Since the options are always ordered the same, I think the red box is sufficient guidance for everyone else. – Erik Mar 30 at 11:57
  • lol ... that's an answer ... ach ... – snaileater Mar 30 at 12:00
  • danke schön @Erik – Taras Mar 30 at 12:13

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.