Re: Working with Paragraphs in Core Text
Re: Working with Paragraphs in Core Text
- Subject: Re: Working with Paragraphs in Core Text
- From: Ricky Sharp <email@hidden>
- Date: Tue, 8 Jul 2008 18:53:44 -0500
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@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden