No tabs possible in text?
-
Hi,
I have a string = "t\tt"
In console it prints:t t
But ents.add_text string, [0,0,0]
Gives 'tt'why??
Is there a magic workaround whose existence I'm not aware ?Thnx guys!!
Liquid
-
hm.. I see the same thing. And I can't even add tabs to a Text entity using the native tool...
-
The 'newline'
\n
will work OK... BUT a\t
doesn't.
So you can't 'align' Sketchup's 2d Text using tabs.
Tabs are rendered as 'empty characters'.
You can of course replace any 'tabs' in the string with some spaces before using it - e.g.
text.gsub!(/\t/,' ')
for three spaces...
Tab\t
does work OK in the UI.messagebox methods. -
@tig said:
Tab
\t
does work OK in the UI.messagebox methods....but it does not work in contextual menu texts, to right-align the short text. I think it was broken in v8.
Fredo
-
@unknownuser said:
...but it does not work in contextual menu texts, to right-align the short text. I think it was broken in v8.
By "short text" are you referring to accelerator keystrokes ??
They are not supposed to be specified in the menu item text. The OS adds them to the menu item, after an accelerator is assigned to the
UI::Command
object, that is in turn assigned to the menu item. -
finally, something that actually works on a mac, but not on a PC?
` > tab=("t\tt")
t tcoordinates = [0, 0, 0]
model = Sketchup.active_model
entities = model.entities
point = Geom::Point3d.new coordinates
text = entities.add_text tab, point
#Sketchup::Text:0x1c013cec`
the screen text has the tab...john
-
Thanks guys. It seems this is a PC only bug. So far no reason to buy a mac..
Advertisement