S
Stanley Wileman
I've almost finished a version of PIC (of TROFF ancestry) that emits RTF,
but still have a problem fitting a text box to a given string of text (to
control the placement of the text in the picture). I'm using the
GetTextExtentPoint32 API to calculate the text extent, and a text box with 0
internal margins. Does anyone reading this know how Word handles this? How
does the width of the text box lines affect the maximum text extent? Here's
a little sample that (tries to) display 20 capital Ws and a period in a text
box. GetTextExtentPoint32 returns 4560 twips (after appropriate conversion),
and that's what's used in the RTF. Thanks in advance for any assistance!
--Stan Wileman
{\rtf1\ansi\deff0
{\fonttbl
{\f0 Times New Roman;}
}
{\stylesheet
{\s1 \i\fs12\f0 \sbasedon0 My Style;}}
{\pard \par}
{\*\do\dobxcolumn\dobypara\dodhgt9000
\dptxbx\dptxlrtb{\dptxbxtext\pard\plain\ql
\li0
\ri0
\widctlpar
\aspalpha
\aspnum
\faauto
\adjustright
\rin0
\lin0
\itap0
\fs24
\cgrid
{WWWWWWWWWWWWWWWWWWWW.\par}
}\dpx9\dpy420\dpxsize4560\dpysize210\dplinew10
but still have a problem fitting a text box to a given string of text (to
control the placement of the text in the picture). I'm using the
GetTextExtentPoint32 API to calculate the text extent, and a text box with 0
internal margins. Does anyone reading this know how Word handles this? How
does the width of the text box lines affect the maximum text extent? Here's
a little sample that (tries to) display 20 capital Ws and a period in a text
box. GetTextExtentPoint32 returns 4560 twips (after appropriate conversion),
and that's what's used in the RTF. Thanks in advance for any assistance!
--Stan Wileman
{\rtf1\ansi\deff0
{\fonttbl
{\f0 Times New Roman;}
}
{\stylesheet
{\s1 \i\fs12\f0 \sbasedon0 My Style;}}
{\pard \par}
{\*\do\dobxcolumn\dobypara\dodhgt9000
\dptxbx\dptxlrtb{\dptxbxtext\pard\plain\ql
\li0
\ri0
\widctlpar
\aspalpha
\aspnum
\faauto
\adjustright
\rin0
\lin0
\itap0
\fs24
\cgrid
{WWWWWWWWWWWWWWWWWWWW.\par}
}\dpx9\dpy420\dpxsize4560\dpysize210\dplinew10