Re: hyphenationFactor in typesetter and layout manager
Re: hyphenationFactor in typesetter and layout manager
- Subject: Re: hyphenationFactor in typesetter and layout manager
- From: Aki Inoue <email@hidden>
- Date: Mon, 6 Oct 2008 11:21:09 -0700
Ross,
The hyphenation factor can be set for both NSATSTypesetter and
NSLayoutManager. My tests indicate that it is sufficient to send
setHyphenationFactor: to the typesetter alone (and simpler, if a
document has multiple layouts). Is that correct, or must each layout
manager's hyphenation factor also be set?
The typesetter-level API is intended to be invoked by the controller
object in the text layout process, usually NSLayoutManager, for
configuring a particular typesetting session.
It's usually reset to whatever NSLayoutManager has inside -
layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:.
Also, if the typesetter's hyphenation factor is set to a non-zero
value, what is the best way to disable hyphenation at the paragraph
level? Because NSParagraphStyle -setHyphenationFactor:0 causes the
typesetter's hyphenation factor to be used, is it appropriate to use
a very small value, such 0.01, for the paragraph's hyphenation factor?
Since the very purpose of the document-level hyphenation factor
accessible via NSLayoutManager is to provide the default setting when
NSParagraphStyle is not specifying the hyphenation factor (by default
value, 0.0), there is no clear way to disable it from the paragraph-
level setting.
If you need to have paragraph-level control, I'd suggest sticking to
the NSParagraphStyle API exclusively.
Aki
On 2008/10/05, at 14:24, Ross Carter wrote:
The hyphenation factor can be set for both NSATSTypesetter and
NSLayoutManager. My tests indicate that it is sufficient to send
setHyphenationFactor: to the typesetter alone (and simpler, if a
document has multiple layouts). Is that correct, or must each layout
manager's hyphenation factor also be set?
Also, if the typesetter's hyphenation factor is set to a non-zero
value, what is the best way to disable hyphenation at the paragraph
level? Because NSParagraphStyle -setHyphenationFactor:0 causes the
typesetter's hyphenation factor to be used, is it appropriate to use
a very small value, such 0.01, for the paragraph's hyphenation factor?
The question arises because I would like to allow users to set a
hyphenation factor for the entire document, but to override that
value as desired at the paragraph level.
_______________________________________________
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
_______________________________________________
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