Grasshopper

algorithmic modeling for Rhino

Grasshopper (somehow) is a (visual) programming language, and commenting is one of the most important part of any programming language. I think most of grasshopper users, use “panel” component to explain their algorithms.

But there are some issues using “RTL” languages (Like Persian and Arabic) in panel component (and generally in everywhere in grasshopper). Especially with “bidirectional” texts.

  • Problems with punctuation characters:
    • If a Line starts with a punctuation character (Like brackets or quotation):

  • If a Line ends with a punctuation character (Like dot or exclamation mark):

  • Problems with bidirectional texts:
    • Using “LTR” words in a “RTL” text:

  • Using “RTL” words in “LTR’ text cause no problem:

All of these problems could have been easily solved, if the “panel” component had supported “RTL” text direction.

I guess “panel” component already supports “RTL”, because if you press CTRL+ SHIFT in the “Panel Properties window”, everything looks fine, but when you press “Ok” button, everything becomes “LTR” again.

Grasshopper has so many Persian, Arabic and other "RTL" languages users. I hope these problems could be solved soon.

Thanks.

Views: 1256

Replies to This Discussion

Hi Mahdiyar,

I'm using standard windows text rendering calls to draw the panels, which is supposed to have support for RTL text through formatting options. I'm currently not setting any of that, so presumably once I do these characters should appear correct on screen.

Can you upload the file with all the panels so I can test any changes I make?

Hi David,
Thank you for your prompt reply.
Here I've attached the file.

Attachments:

So bad news, setting the RightToLeft option fixes some things but ruins other.

This is with the default formatting:

And this is with RightToLeft enabled:

As you can see the first two are now correct, but the others are wrong.

So if there is a solution within GDI text rendering, it's not as straightforward as I thought. I'll need to talk to Curtis, he knows a lot more about culture specific stuff than me and we'll also have to discuss how we can make this work properly for GH2.

I think the third one is correct too.

I guess, If user himself could choose the text direction, everything would be solved.

Something like this:

  • LeftToRight:
  • RightToLeft:

I can probably add that on a per-panel basis to GH1 for Rhino6. I'll let you know when it's operational.

Thank you David, So glad to hear it.

Thanks a lot.

Option added, still trying to find a reliable way to detect a sensible default for when panels are created directly from the popup.

This is awesome.

What about pressing CTRL+Shift? User can press CTRL+Right Shift, if he want to change the text direction to RTL. (and CTRL+Left Shift, for LTR). This is how popup already works, but the problem is, when user press enter, text direction automatically changes to LTR:

This is the standard (and sometimes the only) method to change the text direction in most applications (like Microsoft notepad).

+1

it sounds great.

+

+1

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service