SynthMaker

Label reverses non-text [0.9.3f]

Archive · 2005 12 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

infuzion ·

I was hacking the Toolbox:Maths:Not, & found when I changed the label text in the math symbols, the symbols became reversed.

(note: I changed the module GUI square with FEllipse. Also, the "Area" module behind the "Label" is there only so you can see the text better; it's non-functional.)

Thanks for making some great software 🙂 cheers

malc ·

Hi infuzion,

Well spotted 🙂

This isn't a bug as such. If you go inside the label you'll see a Text component. This has a StringFormat input. This is defined by a String data component (you can also use a StringFormat component). The first parameter in the String represents flags that define how the text is drawn. The number 1 means that right to left reading is defined so change this to 0 to get left to right and all will be find.

I'll make a note to update these modules so that they use the default behaviour. I also need to get some documentation up on this.

Malc.

skOre ·

hehe, stumbeled upon this as well 😉

We would need a better definition for the style component anyways (and on how to use the style flags - is it like binare, 0/1 for the first, 0/2 for the second and 0/4 for the third ???)

malc ·

Yeah, I really do need to write this up. If you hover over the StringFormat component you'll get a brief description.

Basically there are three parts: flags, horizontal alignment and vertical alignement.

Flags can be any combination of: righttoleft, nowrap and vertical or 0 or you can leave it blank. An example would be nowrapvertical (order of strings doesn't matter).

The righttoleft option is as I described in my other post, nowrap keeps all text on the same line and vertical positions text vertically.

Horizontal Alignment can be: left, center or right (or you can use near and far instead of left and right).

Vertical Alignment can be: top, center or bottom (or you can use near and far instead of top and bottom).

skOre ·

Yeah, knew that, but are these comma seperated binary strings, or one Flag number (as I tried to explain in my post above)?

malc ·

The flags part is a combination of strings which are just pasted together. For example:

righttoleftnowrap nowrapvertical vertical nowraprighttoleftvertical

So example StringFormats would be:

0,left,center righttoleft,center,right nowrapvertical,far,top

Not sure if that answers it for you?

infuzion ·

Thanks for the reply malc. Unfortunally, in the exact same textbox, if I type normal text, it will render properly (left -> right) In this example, I copy&pasted a clone:

If you look really close, you can see "abcd" is ok, while "=<" is reversed. cheers

unkargherth ·

Working ok for me on version 0.93g

malc ·

Hi infuzion,

I agree, it looks odd. We're just exposing a flag that is used in GDI+ and we're doing it correctly. I looked up the explanation on MSDN:

When StringFormatFlagsDirectionRightToLeft is set and StringFormatFlagsDirectionVertical is not set, the individual lines of text are horizontal and the reading order is from right to left. This setting does not change the order in which characters are displayed, it simply specifies the order in which characters can be read.

"This setting does not change the order in which characters are displayed" - hmm, except for the case that you've hilighted of course. The big question in my mind is why have an option that makes no difference to the display of the text?

Anyway, everything is sound as far as the code is concerned. If anyone can shed any light on this GDI+ issue I'd be very interested to hear from them.

infuzion ·

hmmm, I'm not sure everyone is seeing what I'm seeing. Let me repost a bigger image:

1) In my example w/ the "ABCD", I copied both String & Label in their entirety. Both have excact same settings:

2) "ABCD" is rendered correctly. 3) "=<" is rendered in mirror image, not reverse order. So the String field has EqualsLESSThan, but the Label renders it as GREATERThanEquals. -- While we're on the subject of the Text module, is there a way we can add ASCII values, so I can add symbols (e.g. "not equals")?

cheers

malc ·

Hi infuzion,

You're right, I hadn't noticed the mirror image bit. However, I still have no idea why it's doing it like this. Either it's a problem with GDI+ or right to left reading requires things to be this way. Unfortunately I just don't know - sorry.

What I can say is that, unless you particularly want your text to be read right to left, just use left to right and all should be fine.

As an aside, is there any reason why you are using 5? This would (and indeed does) work because there are more GDI+ stringformatflags than we expose in SM. A value of 5 would be a combination of StringFormatFlagsDirectionRightToLeft and StringFormatFlagsNoFitBlackBox (see MSDN documentation if you really want to get into this).

infuzion ·

hello malc, I'm not sure why it's 5. I just changed it to 0, & it cleared things up! Now my symbols render as normal.

However, I entered text back into the, String input, & changed the 0 back into 5, & it still renders in normal (fowards) order...

cheers

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.