Re: Printing formatted text
- From: "alanglloyd@xxxxxxx" <alanglloyd@xxxxxxx>
- Date: 31 Aug 2006 03:06:11 -0700
GD1 wrote:
<snip>
how can I make it without using several
TextOut instructions (along with several Printer.Canvas.Font.Style
switches and related positioning matters)?
You can't, that's what it takes to do what you want <g>.
1 Split sting into elements of differing fonts by using the bold or
italic indicators as delimiters.
2 Get length of each element allocating fonts as necessary and using
Canvas.TextWidth.
3 Sum text widths and calculate spacing to justify (if fully justified)
4 Use DrawText API to send each element to canvas with appropriate
alignment for each element. Keep an incrementing variable to hold the X
coordinate.
5 Move to next line
6 GoTo 1
Alan Lloyd
.
- Follow-Ups:
- Re: Printing formatted text
- From: DB-1
- Re: Printing formatted text
- From: GD1
- Re: Printing formatted text
- References:
- Printing formatted text
- From: GD1
- Re: Printing formatted text
- From: Maarten Wiltink
- Re: Printing formatted text
- From: GD1
- Re: Printing formatted text
- From: Maarten Wiltink
- Re: Printing formatted text
- From: GD1
- Printing formatted text
- Prev by Date: Re: Printing formatted text
- Next by Date: Re: Printing formatted text
- Previous by thread: Re: Printing formatted text
- Next by thread: Re: Printing formatted text
- Index(es):
Relevant Pages
|