Re: Text size relative to shape
From: Chris Roth [ Visio MVP ] (visioguy_at_reallyreallywarmmail.com)
Date: 11/29/04
- Previous message: ChristianH: "Re: Search and replace shapes"
- In reply to: Gary Shell: "Re: Text size relative to shape"
- Next in thread: Gary Shell: "Re: Text size relative to shape"
- Reply: Gary Shell: "Re: Text size relative to shape"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 29 Nov 2004 09:48:49 +0100
You could use a SETF formula to change the text size until it is small
enough, but this might fire everytime you type a character. SETF allows you
to jam a formula or a result into another cell. By reducing the font size in
increments, you'd probably end up triggering a loop, which is something that
a spread*** really isn't designed to do. IE: I wouldn't bet it would be
officially suppored by MS, could be unsupported in the next version, yada,
yada, yada.
This works:
User.setFont
=IF(TEXTWIDTH(TheText)>Width,SETF(GetRef(Char.Size),MAX(Char.Size-1 pt,2
pt)),0)
What it does is diminished Char.Size by 2 pt untio the IF statement fails.
It makes a loop in the Shape***, and your font size gets tinier as you
type too much text into the shape.
What it doesn't do is make the text bigger when you delete text. I tried
putting a SETF on the other side of the IF statement as well, to make the
font bigger. It worked, but very very s l o w l y.
It might be better to add an Action cell to manually reset the font size.
Also, this won't work if the user makes multiple formatting.
If possible, it's probably better to do this with code. I did a project for
a customer where I created a dummy User cell with the TextWidth formula. I
then reduced font size until the TextWidth was small enough. This worked
fine, and didn't put weird stuff in the shape.
-- Hope this helps, Chris Roth Visio MVP "Gary Shell" <gshell@fuse.net> wrote in message news:uJixM6m0EHA.3596@TK2MSFTNGP12.phx.gbl... > To answer my own question, yes there is! I used Chris' second formula all > by itself and it did let me set the width of the cell, place the text in > place and the height of the shape adjusts itself. Thanks, Chris. > > I still would like to understand how could adjust the font size to fit the > shape. I think I know how to adjust it I can't figure out how to tell > WHEN > I need to. > > Gary > > > "Gary Shell" <gshell@fuse.net> wrote in message > news:Orz80SX0EHA.1932@TK2MSFTNGP09.phx.gbl... >> Yes that gets me started. But is there any way to place the text into a >> shape, let it do it's own character returns, and THEN determine the >> height >> of the text? >> >> I'd like to keep the shape size and adjust the font to force the text to >> fit. While I may have to use "Shape to Text", I'd prefer to do "Text to >> Shape". >> >> Thanks, >> Gary >> >> "Chris Roth [ Visio MVP ]" <visioguy@reallyreallywarmmail.com> wrote in >> message news:O1IdRwU0EHA.1292@TK2MSFTNGP10.phx.gbl... >> > Here's Shape To Text 101: >> > >> > Width = Guard(TextWidth(TheText)) >> > Height = Guard(TextHeight(TheText,Width)) >> > >> > The width and height of this shape will change to accomodate the text. >> > You'll have to force character returns manually. >> > >> > You can mix and match. If you only use the Height formula, then you can >> > manually resize the width of the shape. I call this the "Paragraph > shape" >> or >> > the "Pagemaker Shape" You fill it with text, choose the column width, > and >> > get the height for free! >> > >> > >> > -- >> > >> > Hope this helps, >> > >> > Chris Roth >> > Visio MVP >> > >> > >> > "Gary Shell" <gshell@fuse.net> wrote in message >> > news:uZ5p34S0EHA.1652@TK2MSFTNGP11.phx.gbl... >> > > Is there any way to resize the text to fit a shape or resize a shape > to >> > > fit >> > > text? >> > > >> > > I have some Swim lane diagrams (aka cross functional process charts) >> where >> > > I >> > > place a process shape in a lane and then set it's text. Sometimes >> > > the >> > > text >> > > overflows the shape. I'd like to force the text to fit the shape and > or >> > > vice versa. >> > > >> > > I think I can use the SpaceLine property set to a percentage to >> > > adjust >> the >> > > text. And have figured out how to do that. But can't figure out how > to >> > > tell >> > > when I NEED to adjust the text. >> > > >> > > How can I tell if the text has overflowed outside the bounds of the >> > > process >> > > shape? If I can do that I can adjust the text or adjust the shape > size. >> > > >> > > Or is there some command I can use to accomplish this? >> > > >> > > Thanks, >> > > Gary >> > > >> > > >> > >> > >> >> > >
- Previous message: ChristianH: "Re: Search and replace shapes"
- In reply to: Gary Shell: "Re: Text size relative to shape"
- Next in thread: Gary Shell: "Re: Text size relative to shape"
- Reply: Gary Shell: "Re: Text size relative to shape"
- Messages sorted by: [ date ] [ thread ]