Visio 2007 has an extra space added to every line of composed text inevery text block

A

andy.carver

Has anyone noticed a bug in Visio 2007, that every line of composed
text ("theText") in every text block has a space character at the end,
which cannot be deleted (although it can be selected, and shows up
whenever the text as a whole is selected)? This makes TEXTWIDTH()
return a size that is larger than the actual composed text, by exactly
one space character's width. (I've tested this with several different
fonts and different text sizes.) The extra width at the end of the
text line shows up whether or not there is a char. return at the end
of the line.

I do not know whether this bug shows up in Visio 2003. It does NOT
show up in Visio 2002. Thus, shapes whose dimensions are dependent on
TEXTWIDTH(theText) will appear larger in Visio 2007 than they do in
Visio 2002.

Has anyone reported this bug? Does anyone know if Microsoft is working
on it?

Many thanks,

Andy C.
 
P

Paul Herber

Has anyone noticed a bug in Visio 2007, that every line of composed
text ("theText") in every text block has a space character at the end,
which cannot be deleted (although it can be selected, and shows up
whenever the text as a whole is selected)? This makes TEXTWIDTH()
return a size that is larger than the actual composed text, by exactly
one space character's width. (I've tested this with several different
fonts and different text sizes.) The extra width at the end of the
text line shows up whether or not there is a char. return at the end
of the line.

I do not know whether this bug shows up in Visio 2003. It does NOT
show up in Visio 2002. Thus, shapes whose dimensions are dependent on
TEXTWIDTH(theText) will appear larger in Visio 2007 than they do in
Visio 2002.

Has anyone reported this bug? Does anyone know if Microsoft is working
on it?

Looks fine to me, I've just tried setting a shape's width cell to
"=textwidth(TheText)" and it sizes correctly as far as I can tell.
Have you set the text block margins to 0?
 
A

andy.carver

Looks fine to me, I've just tried setting a shape's width cell to
"=textwidth(TheText)" and it sizes correctly as far as I can tell.
Have you set the text block margins to 0?

Paul,

Yes, I've tried setting the margins to 0; the problem is actually
easier to see if you do that. Because setting the margins to 0 with
the width =textwidth(theText) should make the text flush with the
sides of the shape; but that's not what I get, I get a half-space's
width on either side, as if the margins were not 0. The text still
looks centered, of course.

Is that what you get?

Thanks,
Andy
 
P

Paul Herber

Paul,

Yes, I've tried setting the margins to 0; the problem is actually
easier to see if you do that. Because setting the margins to 0 with
the width =textwidth(theText) should make the text flush with the
sides of the shape; but that's not what I get, I get a half-space's
width on either side, as if the margins were not 0. The text still
looks centered, of course.

Is that what you get?

Yes, I think that's just the normal padding space around the
character. Which font are you using? Are you using Condensed or
Expanded characters? Condensed shows an interesting problem.
If I remove the text then the shape width becomes 0.
 
A

andy.carver

Yes, I think that's just the normal padding space around the
character. Which font are you using? Are you using Condensed or
Expanded characters? Condensed shows an interesting problem.
If I remove the text then the shape width becomes 0.

--
Regards, Paul Herber, Sandrila Ltd.
DFD/SSADM for Visio      http://www.visio-dfd.sandrila.co.uk/- Hidequoted text -

- Show quoted text -

If you do the same thing in Visio 2002, though, it gives you the text
flush, no extra padding. This extra padding is not "normal", as you
can see if you simply move the cursor through the text from one end to
the other-- the cursor never goes flush with the side of the text box,
which theoretically it should do if the margins are set =0 (and if you
haven't messed with the Text Transform section's settings), and which
it clearly does in Visio 2002. Also, in Visio 2002 you don't get the
extra space-character, selected on the end, when you select the text
(e.g. by going into edit mode using F2).

Why extra padding? And how come, if you get TEXTWIDTH() to tell you
how wide the text is in Visio 2007, it tells you exactly the text-
width you get in Visio 2002 after you insert an extra space into the
text? You can test this, if you have Visio 2002 also installed as I
do, by putting =TEXTWIDTH(theText) in some cell (e.g. a Scratch cell)
and looking at the value it returns in each version.

Something's very fishy! If you have Visio 2002 by any chance, you can
see very clearly how the text-block is supposed to work-- which is,
TEXTWIDTH() actually gives you the text width, not the text-width
plus, arbitrarily, an extra whitespace character.

And yes, if you don't have any text at all in the block, the extra
space disappears as well... it only appears when you've typed in at
least one character. This happens with any font I believe.

Further feedback appreciated.

Regards,
Andy
 
P

Paul Herber

If you do the same thing in Visio 2002,

Sorry, earliest I have running now is 2003 and that shows the same
problem. If it's really important that the text extends fully to the
edge of the shape then it can be fixed by setting the text to be
condensed. For 8pt text then setting condensed by -1pt works. Looks
cr*p though.
 
A

andy.carver

Sorry, earliest I have running now is 2003 and that shows the same
problem. If it's really important that the text extends fully to the
edge of the shape then it can be fixed by setting the text to be
condensed. For 8pt text then setting condensed by -1pt works. Looks
cr*p though.

--
Regards, Paul Herber, Sandrila Ltd.
Electronics for Visio        http://www.electronics.sandrila.co.uk/- Hide quoted text -

- Show quoted text -

Hi Paul

Thanks for the suggested workaround. My main concern is not with
getting text to go flush against the side of the shape. It's that when
solution developers write a formula using TEXTWIDTH() to, say, resize
the shape, or to resize up to a certain maximum size, or whatever,
they should be able to depend on TEXTWIDTH() actually giving them the
correct figure for the text-width -- and not some number that's rather
vaguely and seemingly arbitrarily related to, if always significantly
bigger than, the text-width.

That's why I say this "extra padding" of one space character's width
is not a feature, it's a bug. And IMHO, it's a fairly significant
one.

Again, does anyone know if it has already been reported, or if
Microsoft is working on it? Too bad it's now into its second Visio
version...

Regards
Andy
 
W

WapperDude

A workaround to try would be to change your formula to something like width
=TEXTWIDTH(TheText)-Char.Size*0.25. The amount subtracted will always be
proportional to the font size in the text block.

HTH
Wapperdude
 
P

Paul Herber

There is a way around this, it can only be done via the shapesheet
though, the Format -> Text dialog won't allow it.
Open the shape's shapesheet and in the Text Block format section set
the RightMargin cell to -5pt or whatever seems suitable.
 
P

Paul Herber

This is the 1st mentioning of this problem that I'm aware of.

I've not noticed it before, either. Certainly in the shapes that I've
created that resize themselves with the text I have always added a bit
extra on top of the actual text width, like
textwidth(thetext)+5mm
or something similar.
 
A

andy.carver

I've not noticed it before, either. Certainly in the shapes that I've
created that resize themselves with the text I have always added a bit
extra on top of the actual text width, like
textwidth(thetext)+5mm
or something similar.

OK. Thanks very much to you both for your kind feedback and
suggestions. I would only repeat a question someone asked a few days
ago: Does anyone know how to report a bug to Microsoft (for free)?

Andy
 
P

Paul Herber

OK. Thanks very much to you both for your kind feedback and
suggestions. I would only repeat a question someone asked a few days
ago: Does anyone know how to report a bug to Microsoft (for free)?

There are a couple of Microsoft people here occasionally, probably not
before Monday though. I think it's a long holiday weekend in the USA.
Slackers!
 
A

andy.carver

There are a couple of Microsoft people here occasionally, probably not
before Monday though. I think it's a long holiday weekend in the USA.
Slackers!

--
Regards, Paul Herber, Sandrila Ltd.
DFD/SSADM for Visio      http://www.visio-dfd.sandrila.co.uk/- Hidequoted text -

- Show quoted text -

But, while I think fixing the bug would be a definite plus, there is
an easy fix that some people would then have to perform on some
diagrams to update them to the fixed software:

If your diagram has shapes whose width is determined by TEXTWIDTH(),
and if it has a connector(s) glued to such a shape(s), then when the
diagram is first opened in the (prospective) fixed version of Visio
2007 or 2003 (or opened right now in Visio 2002, which didn't have the
bug) you could get a fright, because the connectors will look somewhat
DISconnected from those shapes. However, they're not really
disconnected, it's just that the shapes themselves will be drawn
narrower, given that TEXTWIDTH() now returns an accurate rather than
inflated figure. The easy fix is to press Ctl+A to select the whole
diagram, then nudge the diagram with a single press of an arrow key in
any direction. The seemingly disconnected connectors will immediately
appear reconnected, since the glue will force the connectors to be
redrawn. This is a quick diagram fix that Microsoft might want to
include in explanation-notes of the (prospective) bug fix.

Cheers
Andy
 
W

WapperDude

2nd attempt at this post --

Here's an FYI that I just stumbled across:
http://blogs.msdn.com/visio/archive/2006/08/18/704811.aspx

In the content of this blog is the following comment: "Finally Visio
(starting in 2003) terminates text with a non-visible character. Note that
this final character is not reported when using the Shape.Text property, but
it is reported using Shape.Characters.Text."

It would appear that this is intentional, and not a "bug".

Wapperdude
 
A

andy.carver

2nd attempt at this post --

Here's an FYI that I just stumbled across:  http://blogs.msdn.com/visio/archive/2006/08/18/704811.aspx

In the content of this blog is the following comment:  "Finally Visio
(starting in 2003) terminates text with a non-visible character.  Note that
this final character is not reported when using the Shape.Text property, but
it is reported using Shape.Characters.Text."

It would appear that this is intentional, and not a "bug".

Wapperdude





- Show quoted text -

Very interesting, Wapperdude! However, I doesn't seem to me that it
should be reported by TEXTWIDTH(). That still seems to me a bug.

Thanks much,
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top