Jason,

At 12:00am -0700 00-05-18, Palm Developer Forum digest wrote:
>Subject: Code fro displaying Multiple fonts in a field
>From: "Jason Davidson" <[EMAIL PROTECTED]>
>Date: Thu, 18 May 2000 00:26:24 -0400
>X-Message-Number: 94
>
>I am trying to write an application that can display more than one font
>inside a field.  I am doing this however to no avail.  I guess what I should
>be doing is using WinDrawChars and setting the font before I draw the
>desired characters.  The only problem I am having is consistently handling
>line wrapping and scrolling things that the field normally handles.  If
>anyone could help me, point me in the right direction to get started, or
>anything it would be appreciated.

Line wrapping isn't hard - call FntWordWrap after setting the font, 
and use it to walk through the text that you need to wrap/draw. 
You'll have to be responsible for figuring out when the font changes, 
and to what, of course.

Scrolling gets a bit harder. If you don't have much text, then the 
easy thing to do is to always re-wrap from the start of the text, 
until you reach the first displayable line. After that you continue 
with your normal wrap/draw code. So assuming you've got a bounding 
rectangle and your text/font run info, then the only other two pieces 
of info you'll need are the scroll amount (number of lines "above" 
the top of your bounding rect) and the byte offset to the first 
displayable line.

-- Ken

Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to