Vertical Text in Labels

Post Reply
Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Vertical Text in Labels

Post by Jor'Mox »

Is there a way to orient text vertically instead of horizontally inside a label, or any other object that could be used in such a manner?

I'm trying to have a value written on a vertical gauge, but it looks ridiculous (and gets cut off) unless I make the gauge extremely wide.

User avatar
kevutian
Posts: 217
Joined: Fri Aug 20, 2010 8:18 pm
Location: United Kingdom
Contact:

Re: Vertical Text in Labels

Post by kevutian »

This may or may not work within Mudlet and I am unable to test, but try this:
Code: [show] | [select all] lua
border: 1px solid white;
border-radius: 3px;
background-color: white;
qproperty-alignment: AlignCenter;
qproperty-text: 'My words to align';
qproperty-wordWrap: true;

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Vertical Text in Labels

Post by Vadi »

So the text goes top to bottom or bottom to top instead of left to right? If you'd like text alignment within the label and wordwrap, see: http://wiki.mudlet.org/w/Manual:Geyser# ... de_a_label

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Vertical Text in Labels

Post by Jor'Mox »

So, I tried various strategies with QT alignment and word wrap, none of which worked as they don't break up a word. I also tried a few different HTML based strategies which also didn't work. In the end, the only thing that I have had any success with has been inserting <br> between each character of the string I want to display. Extremely ugly, but at least it works.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Vertical Text in Labels

Post by Vadi »

I recommend posting to Qt's mailing list in regards to this: http://lists.qt-project.org/mailman/listinfo/interest, they could know.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Vertical Text in Labels

Post by Jor'Mox »

The current solutions for QT for writing text vertically involve rotating the painter that is being used to draw the text. I'm fairly certain I don't have access to the painter in Mudlet, and I tested to see if the suggested "rotation" property would work with a label anyway. It does not. Other suggestions are... inserting <br> between letters.

It does look like someone is experimenting with something to allow vertical text with QT, but that will no doubt be in a future version.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Vertical Text in Labels

Post by Vadi »

Alright, good to know. The painter indeed is inaccessible.

Ginga Giri Giri
Posts: 11
Joined: Mon Dec 17, 2012 2:58 am

Re: Vertical Text in Labels

Post by Ginga Giri Giri »

Have you considered just breaking up your words with newlines (\n), or does that not work on labels?

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Vertical Text in Labels

Post by Jor'Mox »

For some reason it was treating those as spaces instead of line breaks. But, from my end, inserting anything between letters is all the same. So putting in "\n" is no easier or harder than putting in "<br>", or even just " ". The only solutions that wouldn't require changing the original text would be a form of word wrap that would break words up (instead of only wrapping on white space), or rotating the text to write from top to bottom instead of left to right.

Post Reply