It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Graphic Illustrator Forum

how can I write text on full rectangle

how can I write text on full rectangle

Postby oleg.shast on Thu Apr 24, 2008 10:32 pm

i.e. I have width/height of text, which must be written, i.e. 100/300 and I want to write a text "HELLO". How can I write text such as that text will be with width=100 and height=300 ?

I try following:

Illustrator.CharacterStyle curStyle = curDok.CharacterStyles.Add("ColorText");
Illustrator.CharacterAttributes charAttr = curStyle.CharacterAttributes;
charAttr.FillColor = ilColor;
charAttr.Size = Convert.ToInt32(FontSize * 2.5F);
//charAttr.HorizontalScale = charAttr.HorizontalScale;
//charAttr.VerticalScale = charAttr.VerticalScale;
Illustrator.TextFont newFont = null;
if (!string.IsNullOrEmpty(sFont))
foreach (Illustrator.TextFont curFont in appIll.TextFonts)
if (curFont.Name.Contains(sFont))
newFont = curFont;
if (newFont != null)
charAttr.TextFont = newFont;

double dHeight = 0;
double dWidth = 0;

if (!string.IsNullOrEmpty(Text))
{
Illustrator.TextFrame curTextFrame = curDok.TextFrames.Add();
curTextFrame.Contents = Text;
curTextFrame.Top = 0;
//curTextFrame.BlendingMode = Illustrator.AiBlendModes.aiDarken;
if (hScale > 0)
{
curTextFrame.Width = 100;
curTextFrame.Height = 300;
}
curStyle.ApplyTo(curTextFrame.TextRange, false);

dHeight = curTextFrame.Height / 2;
dWidth = curTextFrame.Width / 2;
}


but text is not on fully my rectangle
oleg.shast
 
Posts: 4
Joined: Thu Apr 24, 2008 10:19 pm

Who is online

Users browsing this forum: No registered users and 0 guests