Special

Special Print Closeout!

We're clearing out the remainder of our print issues at fire sale prices -- as much as 75% off! Quantities are extremely limited and only available while supplies last. Hurry to take advantage of this one-time offer.

RBD Magazines

Once these printed back issues are gone, they are gone!

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