Draft Text and non-latin characters messing up

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
Willi2006
Posts: 18
Joined: Sun Jan 31, 2021 10:56 pm

Draft Text and non-latin characters messing up

Post by Willi2006 »

Copying the following code into the Python console creates a new document and a line of text with latin and non-latin characters.

Code: Select all

doc = FreeCAD.newDocument()
text = 'latin ไทย русский Ελληνικά 中国人'
tp = Draft.make_text(text, FreeCAD.Vector(0,0,0))
tp.Text = text
FreeCADGui.SendMsgToActiveView('ViewFit')
.
The View Property Font Name is Arial. The text in the 3D view looks fine.
The View Property Font Name is Arial. The text in the 3D view looks fine.
DraftTextNon-latin1.png (39.86 KiB) Viewed 1477 times
.
But the Property Text is messed up.
But the Property Text is messed up.
DraftTextNon-latin2.png (33.83 KiB) Viewed 1477 times
.
When deleting the character 'n' in the Property Text, the text in the 3D view is messed up too.
When deleting the character 'n' in the Property Text, the text in the 3D view is messed up too.
DraftTextNon-latin3.png (35.12 KiB) Viewed 1477 times
.

Code: Select all

tp.Text = text
.
After setting the text again by copying this code to the Python console we are back at step 1.
After setting the text again by copying this code to the Python console we are back at step 1.
DraftTextNon-latin4.png (33.86 KiB) Viewed 1477 times
.
It seems there's no problem with non-latin characters with scripting but with the GUI.
.
OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: German/Germany (de_DE)
Post Reply