Re: working with styled text records
Re: working with styled text records
- Subject: Re: working with styled text records
- From: "Arthur J. Knapp" <email@hidden>
- Date: Thu, 19 Sep 2002 13:03:48 -0400
>
Date: Thu, 19 Sep 2002 11:16:19 +1000
>
From: Malcolm Fitzgerald <email@hidden>
>
Subject: working with styled text records
>
With Arthur's help I've been able to generate HTML code from styled
>
text. The styled text record contains two bits of info, the text
>
class and the style class. Arthur has used a bit of educated guess
>
work to analyse the style object and figured out bold/italics/etc.
>
For those who've never seen one it looks like this:
>
>
{+class ktxt;:"ho ho", +class ksty;:+data
>
styl000100000000000F000B00030100000B000000000000;}
Shhhhhhhhhh...
Aw, now everyone is going to know... ;-)
>
I want to be able to manipulate the style object. Does anyone know
>
where I can find out what the style data consists of and how I can
>
use it?
I am so lazy. I have been working on and off on a style-object
manipulater for well over a year now, but I keep putting the
project off, (darn that *paying* job of mine, which keeps taking
up so much of my time). ;-)
Here are some links:
<
http://developer.apple.com/techpubs/macosx/Carbon/text/TextEdit/TextEdit/Da
taTypes/STElement.html>
<
http://developer.apple.com/techpubs/macosx/Carbon/text/TextEdit/TextEdit/Da
taTypes/ScrpSTElement.html>
The styl you posted above can basically be broken up like this:
styl 0001 00000000 000F 000B 0003 0100 000B 0000 0000 0000
0001 2 byte count of style-runs in the text
00000000 4 byte offset, (0-based), of this style in the text
000F 2 byte font height, (in this case, 15)
000B 2 byte font ascent, (11)
0003 2 byte font id number, (3). On most Macs: Geneva
0100 2 byte bitmap. The high-byte specifies bold, italic, etc
000B 2 byte font point size, (11)
0000 2 byte red of RGB color
0000 2 byte green of RGB color
0000 2 byte blue of RGB color
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.