How to Make Backwards (Mirrored) Text?

Started by Jennifer, November 29, 2018, 06:22:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jennifer

I would like to be able to create a text box into which I can type text and it will show up backwards (right to left) as in the attached graphic.

I created a text box and entered some text. I first tried to flip it horizontally. Nothing happened. Why doesn't this work?

With the text box selected, I opened the shape sheet and tried to locate the 3D section so I could set the RotationXAngle cell to =180deg. But I couldn't find the 3D section.

Is there a way to do this?

I created the attached example by copying the text box and then pasting it as a picture. Then I was able to flip it horizontally, but this is a pain for every text box.
Using Visio 2019, part of Office 365 on Windows 10

Paul Herber

#1
Ah, you are on Visio 2010, that's why the 3D option didn't work!
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

wapperdude

#2
.txet sdrawkcaB  :o::)   ;)
Visio 2019 Pro

Yacine

#3
If you don't mind using code...

Sub mirrorText()

    Dim shp As Shape

    ActiveWindow.Selection.Copy

    ' Paste the copied shape as a metefile:
    Set shp = ActiveWindow.Page.PasteSpecial(visPasteMetafile, False, False)

    ActiveWindow.Select shp, visSelect    ActiveWindow.Selection.FlipHorizontal

End Sub
Yacine

Visio Guy

#4
If you installed a backwards font, you could also make two text boxes:

1. Takes the normal user input, and has a normal "forwards" font.
2. Takes an "inserted field" and uses the "backwards" font.

You would then have to build a formula that did what wapperdude did above.

<apologies for trying out the "glow effect"> :) :)

If Sheet.1 is the id of the shape that holds the text you type:

User.SourceText      = SHAPETEXT(Sheet.1!TheText)
User.Len                 = LEN(User.SourceText)
User.ReversedText = IFERROR(MID(User.SourceText,User.Len,1),"") & IFERROR(MID(User.SourceText,User.Len-1,1),"") & IFERROR(MID(User.SourceText,User.Len-2,1),"")  //...and on and on and on...

Then you would insert the field User.Reversed text to the shape 2's text, so that it would display the calculated, reversed text.

What User.ReversedText does is take the "mid string" of User.SourceText, starting at the end and going towards the beginning. If the calculated index, User.Len - N, is out of bounds, the IFERROR wrapper catches that and returns "".

Since the smarts behinds shapes is a spreadsheet, it isn't possible to really do procedural calculations. So you'll have to decide on a maximum length of input text, then build a formula that can handle that many characters. For example, this formula can handle the reversing of up to 8 characters:

User.ReversedText =
     IFERROR(MID(User.SourceText,User.Len,1),"") &
     IFERROR(MID(User.SourceText,User.Len-1,1),"") &
     IFERROR(MID(User.SourceText,User.Len-2,1),"") &
     IFERROR(MID(User.SourceText,User.Len-3,1),"") &
     IFERROR(MID(User.SourceText,User.Len-4,1),"") &
     IFERROR(MID(User.SourceText,User.Len-5,1),"") &
     IFERROR(MID(User.SourceText,User.Len-6,1),"") &
     IFERROR(MID(User.SourceText,User.Len-7,1),"") &
     IFERROR(MID(User.SourceText,User.Len-8,1),"")

If you want to support up to 20 characters, then keep extending this block.

One last nerd-note:

If you copy the block above, it WON'T paste successfully into a ShapeSheet cell if you edit "in-line" or with the formula entry bar at the top of the ShapeSheet window.

However, IT WILL WORK if you use the Edit Formula button, which pops up a  formula-editing window. The Edit Formula pop-up appears to do some trimming of spaces and line-feeds before stuffing the result into the ShapeSheet cell.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010