On Jul 8, 2008, at 6:13 PM, Iain Delaney wrote:

I was having problems with both the creation of the style and the application of it. I think you example will work once I have the style defined, but I'm still not clear on how you make the style.
The documentation is short of examples on this topic.


To create the style, you'd probably have something like this:

CTTextAlignment theAlignment = kCTCenterTextAlignment;

CFIndex theNumberOfSettings = 1;
CTParagraphStyleSetting theSettings[1] =
{
{ kCTParagraphStyleSpecifierAlignment, sizeof(CTTextAlignment), &theAlignment }
};


CTParagraphStyleRef theParagraphRef = CTParagraphStyleCreate(
    theSettings, theNumberOfSettings);


Basically, it looks like you need to build an array of structs (CTParagraphStyleSetting) and populate each one by using appropriate kCTxxx constants. Documentation on those constants then mention the type to use for its value (which are also specified in the struct fields).

___________________________________________________________
Ricky A. Sharp         mailto:[EMAIL PROTECTED]
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to