Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

Print:
PDF:

Beginner's Corner

Text Styling

Working with styled text

Issue: 5.2 (January/February 2007)
Author: Marc Zeedar editor-at-rbdeveloper.com
Article Description: No description available.
Article Length (in bytes): 12,842
Starting Page Number: 34
RBD Number: 5212
Resource File(s):

Download Icon 5212.zip Updated: Monday, January 15, 2007 at 1:16 PM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

For years REALbasic supported styled text in EditFields -- that is, text with various fonts, sizes, and other characteristics like bold and italic -- but there was no easy mechanism for you, the programmer, to access those details. Figuring out styled text was a complicated adventure of parsing the TextStyleData string within a memoryblock -- not for the faint of heart. That changed a few years ago when REALbasic introduced the StyledText class.

For those of you new to the whole concept of styled text, let's explore the medium for a minute. It will greatly help your understanding later.

Now plain text is easy -- it's just a string of characters:

The fast fox flounced across the flooded freeway.

With REALbasic's advanced string handling, you really don't even have to worry about text encoding, like whether some text is double-byte (i.e. Chinese, where each character is represented by a two-byte number). REALbasic's string handling routines handle all that stuff for you, so you just treat text as text and everything just works. (I'll still never get over my amazement when an early user of my Z-Write word processor, in 1999, sent me a screen shot of Z-Write working right-to-left with Hebrew text. I, of course, had done nothing extra to support Hebrew: it just worked.)

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com