Rojj
(Ruggiero Guida)
June 25, 2023, 8:34am
1
I am trying to use a unicode character in a python annotation, but it is being ignored. Am I doing something wrong or it is not possible?
I can see the character in the editor, but it does not show in the view. This is an extract of the python annotation (it is generated by a python script)
["dbT: 23.9°C\nRH: 61.0%\nws: 2.5m/s\nwd: 263.0°(←)",.....][t_index]
As you can see, the arrow symbol ← is there, but it does not show in the view
Any suggestion?
todoooo
(Todd)
June 25, 2023, 1:47pm
2
It should work but the string must contain utf8 characters. Have you checked the encoding?
Rojj
(Ruggiero Guida)
June 25, 2023, 2:40pm
3
Todd:
utf8
I think so. The string is generated by a python script in this way
python_string = (",").join([f"\"dbT: {dbT}°C\\nRH: {rh}%\\nws: {ws}m/s\\nwd: {wd}°({angle_to_arrow(wd)})\"" for dbT, rh, ws, wd in zip(dbTs, rhs, wss, wds)])
pythonAnnotation2.Expression = f"[{python_string}][t_index]"
And I can actually see the symbol in the expression editor
ben.boeckel
(Ben Boeckel (Kitware))
June 25, 2023, 2:48pm
4
I don’t think the embedded fonts in VTK have all of the fancy symbols.
1 Like
Rojj
(Ruggiero Guida)
June 28, 2023, 8:27am
6
Perfect! Thanks @mwestphal
1 Like