Localization bug for _TextObject command

If you run the script below in an English Beta, it runs fine. If you run it in French, it fails - don’t know if this is also a problem in other languages, I suspect yes.

The problem is that _Font in the command string is not translated, and after that the whole command string collapses. The result is that it prints “_Font” instead of “Hello World”. If you look at the command line feedback you can see where it is erroring out; a second way to test is just to substitute “Police” for “_Font” in the command string, and then it will work in French at least.

import rhinoscriptsyntax as rs

text="Hello World"

comm_1='! _-TextObject _Height={} _Rotation=0 _Font "Arial"'
comm_1+=' _Italic=_No _Bold=_No _CreateGeometry=_Curves _GroupOutput=_Yes'
comm_1+=' _AllowSingleStrokeFonts=_No _LowerCaseAsSmallCaps=_No'
comm_1+=' _AddSpacing=_No _UseTextCenterToPosition=_No "{}" {}'

comm_str=comm_1.format(1.0,text,rs.coerce3dpoint([0,0,0]))
rs.Command(comm_str)

@cecile_lamborot

Cheers, --Mitch

Since I didn’t get a response on this one, I went ahead and created a youtrack item

1 Like

Thanks for the bug report Mitch

Hi Mitch,

Sorry for the late reply. I wanted to test in another languge but got some problems installing.
I tested it in Spanish and result is the same.

Thanks!

Cécile

Police! RH-43158 should be fixed (peut être) in the latest BETA.

Et peut être pas…

image

(6.0.17354.18411, 20-12-17)

Well merde. Reopening. Thanks Mitch!

RH-43158 is fixed in the latest BETA

Yes, this does appear to be fixed in the latest (6.0.18002.19001, 02-01-18) Beta, thanks!

–Mitch

1 Like