- Inherits from:
- NSObject
- Package:
- com.apple.yellow.application
An NSLayoutManager coordinates the layout and display of characters held in an NSTextStorage object. It maps Unicode character codes to glyphs, sets the glyphs in a series of NSTextContainers, and displays them in a series of NSTextViews. In addition to its core function of laying out text, an NSLayoutManager coordinates its NSTextViews, provides services to those NSTextViews to support NSRulerViews for editing paragraph styles, and handles the layout and display of text attributes not inherent in glyphs (such as underline or strikethrough). You can create a subclass of NSLayoutManager to handle additional text attributes, whether inherent or not.
These constants specify how a glyph is laid out relative to the previous glyph.
Constants | Description |
GlyphInscribeBase |
Description forthcoming. |
GlyphInscribeBelow |
Description forthcoming. |
GlyphInscribeAbove |
Description forthcoming. |
GlyphInscribeOverstrike |
Description forthcoming. |
GlyphInscribeOverBelow |
Description forthcoming. |
Description forthcoming
Constants | Description |
GlyphAttributeSoft |
Description forthcoming. |
GlyphAttributeElastic |
Description forthcoming. |
GlyphAttributeInscribe |
Description forthcoming. |
- Constructors
- NSLayoutManager
- Setting the text storage
- setTextStorage
- textStorage
- replaceTextStorage
- Setting text containers
- textContainers
- addTextContainer
- insertTextContainerAtIndex
- removeTextContainerAtIndex
- Invalidating glyphs and layout
- invalidateGlyphsForCharacterRange
- invalidateLayoutForCharacterRange
- invalidateDisplayForCharacterRange
- invalidateDisplayForGlyphRange
- textContainerChangedGeometry
- textStorageChanged
- Turning background layout on/off
- setBackgroundLayoutEnabled
- backgroundLayoutEnabled
- Accessing glyphs
- insertGlyphAtGlyphIndex
- glyphAtIndex
- replaceGlyphAtIndex
- glyphsInRange
- deleteGlyphsInRange
- numberOfGlyphs
- Mapping characters to glyphs
- setCharacterIndexForGlyphAtIndex
- characterIndexForGlyphAtIndex
- characterRangeForGlyphRange
- glyphRangeForCharacterRange
- Setting glyph attributes
- setGlyphAttributeForGlyphAtIndex
- glyphAttributeForGlyphAtIndex
- Handling layout for text containers
- setTextContainerForGlyphRange
- glyphRangeForTextContainer
- textContainerForGlyphAtIndex
- usedRectForTextContainer
- Handling line fragment rectangles
- setLineFragmentRectForGlyphAtIndex
- lineFragmentRectForGlyphAtIndex
- lineFragmentUsedRectForGlyphAtIndex
- setExtraLineFragmentRect
- extraLineFragmentRect
- extraLineFragmentUsedRect
- extraLineFragmentTextContainer
- setDrawsOutsideLineFragmentForGlyphAtIndex
- drawsOutsideLineFragmentForGlyphAtIndex
- Layout of glyphs
- setLocationForStartOfGlyphRange
- locationForGlyphAtIndex
- rangeOfNominallySpacedGlyphsContainingIndex
- rectArrayForCharacterRange
- rectArrayForGlyphRange
- boundingRectForGlyphRange
- glyphRangeForBoundingRect
- glyphRangeForBoundingRectWithoutAdditionalLayout
- Display of special glyphs
- setNotShownForGlyphAtIndex
- notShownAttributeForGlyphAtIndex
- setShowsInvisibleCharacters
- showsInvisibleCharacters
- setShowsControlCharacters
- showsControlCharacters
- Controlling hyphenation
- setHyphenationFactor
- hyphenationFactor
- Using screen fonts
- setUsesScreenFonts
- usesScreenFonts
- substituteFontForFont
- Handling rulers
- rulerAccessoryViewForTextView
- rulerMarkersForTextView
- Managing the responder chain
- layoutManagerOwnsFirstResponderInWindow
- firstTextView
- textViewForBeginningOfSelection
- Drawing
- drawBackgroundForGlyphRange
- drawGlyphsForGlyphRange
- drawUnderlineForGlyphRange
- underlineGlyphRange
- Setting the delegate
- setDelegate
- delegate
public NSLayoutManager()
public void addTextContainer(NSTextContainer aTextContainer)
See Also: insertTextContainerAtIndex, removeTextContainerAtIndex, textContainers, invalidateGlyphsForCharacterRange, invalidateLayoutForCharacterRange
public boolean backgroundLayoutEnabled()
true
if
the receiver generates glyphs and lays out text when the application's
run loop is idle, false
if it only
performs glyph generation and layout when necessary.See Also: setBackgroundLayoutEnabled
public NSRect boundingRectForGlyphRange(
NSRange glyphRange,
NSTextContainer aTextContainer)
Performs glyph generation and layout if needed.
See Also: glyphRangeForTextContainer, drawsOutsideLineFragmentForGlyphAtIndex
public int characterIndexForGlyphAtIndex(int glyphIndex)
Performs glyph generation if needed.
public NSRange characterRangeForGlyphRange(
NSRange glyphRange,
NSMutableRange actualGlyphRange)
null
, expands the requested range
as needed so that it identifies all glyphs mapped to those characters
and returns the new range by reference in actualGlyphRange.Suppose
the text store begins with the character "Ö
"
and the glyph cache contains "O
"
and "¨
". If you
get the character range for the glyph range {0, 1} or {1, 1}, actualGlyphRange is
returned as {0, 2}, indicating that both glyphs are mapped to the
character "Ö
".
Performs glyph generation if needed.
See Also: characterIndexForGlyphAtIndex, glyphRangeForCharacterRange
public Object delegate()
See Also: setDelegate
public void deleteGlyphsInRange(NSRange glyphRange)
This method is for use by the glyph generation mechanism, and doesn't perform any invalidation or generation of the glyphs or layout. You should never directly invoke this method.
See Also: insertGlyphAtGlyphIndex
public void drawBackgroundForGlyphRange(
NSRange glyphRange,
NSPoint containerOrigin)
Background marks are such things as selection highlighting, text background color, and any background for marked text.
Performs glyph generation and layout if needed.
See Also: drawGlyphsForGlyphRange, glyphRangeForTextContainer, textContainerOrigin (NSTextView)
public void drawGlyphsForGlyphRange(
NSRange glyphRange,
NSPoint containerOrigin)
Performs glyph generation and layout if needed.
See Also: drawBackgroundForGlyphRange, glyphRangeForTextContainer, textContainerOrigin (NSTextView)
public void drawUnderlineForGlyphRange(
NSRange glyphRange,
int underlineType,
float baselineOffset,
NSRect lineRect,
NSRange lineGlyphRange,
NSPoint containerOrigin)
NSAttributedString.SingleUnderlineStyle
,
but subclasses can define their own underline styles. baselineOffset indicates
how far below the text baseline the underline should be drawn; it's
usually a positive value. lineRect is
the line fragment rectangle containing the glyphs to draw underlining
for, and lineGlyphRange is the range
of all glyphs within that line fragment rectangle. containerOrigin is
the origin of the line fragment rectangle's NSTextContainer in
its NSTextView.This method is invoked automatically by underlineGlyphRange; you should rarely need to invoke it directly.
See Also: textContainerForGlyphAtIndex, textContainerOrigin (NSTextView)
public boolean drawsOutsideLineFragmentForGlyphAtIndex(int glyphIndex)
true
if
the glyph at glyphIndex exceeds the
bounds of the line fragment where it's laid out, false
otherwise. This
can happen when text is set at a fixed line height. For example,
if the user specifies a fixed line height of 12 points and sets
the font size to 24 points, the glyphs will exceed their layout
rectangles.Glyphs that draw outside their line fragment rectangles aren't considered when calculating enclosing rectangles with the rectArrayForCharacterRange and rectArrayForGlyphRange methods. They are, however, considered by boundingRectForGlyphRange
Performs glyph generation and layout if needed.
public NSRect extraLineFragmentRect()
NSRect.ZeroRect
if there
is no such rectangle.See Also: extraLineFragmentUsedRect, extraLineFragmentTextContainer, setExtraLineFragmentRect
public NSTextContainer extraLineFragmentTextContainer()
null
if
there is no extra line fragment rectangle. This
rectangle is used to display the insertion point for the insertion point
at the end of a text (either in an empty text or after a final paragraph
separator).See Also: extraLineFragmentRect, extraLineFragmentUsedRect, setExtraLineFragmentRect
public NSRect extraLineFragmentUsedRect()
NSRect.ZeroRect
if
there is no extra line fragment rectangle.The extra line fragment used rectangle is twice as wide (or tall) as the NSTextContainer's line fragment padding, with the insertion point itself in the middle.
See Also: extraLineFragmentRect, extraLineFragmentTextContainer, setExtraLineFragmentRect
public NSTextView firstTextView()
public int firstUnlaidCharacterIndex()
public int firstUnlaidGlyphIndex()
public float fractionOfDistanceThroughGlyphForPoint(
NSPoint aPoint,
NSTextContainer aTextContainer)
public int glyphAtIndex(int glyphIndex)
Performs glyph generation if needed. To avoid an exception with glyphAtIndex you must first check the glyph index against the number of glyphs, which requires generating all glyphs.
See Also: getGlyphs:range:
public int glyphIndexForPoint(
NSPoint aPoint,
NSTextContainer aTextContainer)
public NSRange glyphRangeForBoundingRect(
NSRect aRect,
NSTextContainer aTextContainer)
Performs glyph generation and layout if needed.
See Also: glyphRangeForBoundingRectWithoutAdditionalLayout
public NSRange glyphRangeForBoundingRectWithoutAdditionalLayout(
NSRect bounds,
NSTextContainer container)
Unlike glyphRangeForBoundingRect, this method doesn't perform glyph generation or layout. Its results, though faster, can be incorrect. This method is primarily for use by NSTextView; you should rarely need to use it yourself.
See Also: glyphRangeForBoundingRect
public NSRange glyphRangeForCharacterRange(
NSRange charRange,
NSMutableRange actualCharRange)
null
, expands the requested range
as needed so that it identifies all characters mapped to those glyphs
and returns the new range by reference in actualCharRange.Suppose
the text store contains the characters "n
"
and the glyph cache contains "±
".
If you get the glyph range for the character range {0, 1} or {1,
1}, actualCharRange is returned as
{0, 2}, indicating both of the characters mapped to the glyph "±
".
Performs glyph generation if needed.
See Also: characterIndexForGlyphAtIndex
public NSRange glyphRangeForTextContainer(NSTextContainer aTextContainer)
Performs glyph generation and layout if needed.
public int [] glyphsInRange(NSRange aRange)
public float hyphenationFactor()
See Also: setHyphenationFactor
public void insertGlyphAtGlyphIndex(
int aGlyph,
int glyphIndex,
int charIndex)
This method is for use by the glyph generation mechanism, and doesn't perform any invalidation or generation of the glyphs or layout. You should never directly invoke this method.
See Also: deleteGlyphsInRange, replaceGlyphAtIndex
public void insertTextContainerAtIndex(
NSTextContainer aTextContainer,
int index)
See Also: addTextContainer, removeTextContainerAtIndex, textContainers
public int glyphAttributeForGlyphAtIndex(
int attributeTag,
int glyphIndex)
Subclasses that define their own custom attributes must override this method to access their own storage for the attribute values. Non-negative tags are reserved by Apple; you can define your own attributes with negative tags and set values using setGlyphAttributeForGlyphAtIndex.
public void invalidateDisplayForCharacterRange(NSRange charRange)
public void invalidateDisplayForGlyphRange(NSRange glyphRange)
public void invalidateGlyphsForCharacterRange(
NSRange charRange,
int lengthChange,
NSMutableRange actualCharRange)
null
, actualCharRange is
set to the range of characters mapped to the glyphs just invalidated.
This can be larger than the range of characters given due to the
effect of context on glyphs and layout.You should rarely need
to invoke this method. It only invalidates glyph information, and
performs no glyph generation or layout. Because invalidating glyphs
also invalidates layout, after invoking this method you should also
invoke invalidateLayoutForCharacterRange,
passing charRange as the first argument
and false
as the flag.
public void invalidateLayoutForCharacterRange(
NSRange charRange,
boolean flag,
NSMutableRange actualCharRange)
true
,
attempts to save some layout information to avoid recalculation;
if flag is false
,
saves no layout information. You should typically pass false
for flag. If
non-null
, actualCharRange is
set to the range of characters mapped to the glyphs whose layout
information has been invalidated. This can be larger than the range
of characters given due to the effect of context on glyphs and layout.This method only invalidates information; it performs no glyph generation or layout. You should rarely need to invoke this method.
See Also: invalidateGlyphsForCharacterRange
public boolean isValidGlyphIndex(int glyphIndex)
public boolean layoutManagerOwnsFirstResponderInWindow(NSWindow aWindow)
true
if
the first responder in aWindow is
an NSTextView associated with the receiver, false
otherwise.public NSRect lineFragmentRectForGlyphAtIndex(
int glyphIndex,
NSMutableRange lineFragmentRange)
null
, lineFragmentRange is
set to contain the range for all glyphs in that line fragment.Performs glyph generation and layout if needed.
See Also: lineFragmentUsedRectForGlyphAtIndex, setLineFragmentRectForGlyphAtIndex
public NSRect lineFragmentUsedRectForGlyphAtIndex(
int glyphIndex,
NSMutableRange lineFragmentRange)
If non-null
, lineFragmentRange is
set to contain the range for all glyphs in the line fragment.
Performs glyph generation and layout if needed.
See Also: lineFragmentRectForGlyphAtIndex, setLineFragmentRectForGlyphAtIndex
public NSPoint locationForGlyphAtIndex(int glyphIndex)
Performs glyph generation and layout if needed.
See Also: lineFragmentRectForGlyphAtIndex, lineFragmentUsedRectForGlyphAtIndex
public boolean notShownAttributeForGlyphAtIndex(int glyphIndex)
true
if
the glyph at glyphIndex isn't shown
(in the sense of the PostScript show
operator), false
if
it is. For example, a tab, newline, or attachment
glyph doesn't get shown; it just affects the layout of following
glyphs or locates the attachment graphic. Space characters, however,
typically are shown as glyphs with a displacement, though they leave
no visible marks. Throws a RangeException if glyphIndex is
out of bounds.Performs glyph generation and layout if needed.
See Also: setNotShownForGlyphAtIndex
public int numberOfGlyphs()
public NSRange rangeOfNominallySpacedGlyphsContainingIndex(int glyphIndex)
show
operation;
in other words, glyphs with no pairwise kerning or other adjustments
to spacing.Performs glyph generation and layout if needed.
public NSRect rectArrayForCharacterRange(
NSRange charRange,
NSRange selCharRange,
NSTextContainer aTextContainer)
NotFound
.
To calculate the rectangles for drawing highlighting for charRange,
use a selected character range that contains charRange.The number of rectangles returned isn't necessarily the number of lines enclosing the specified range. Contiguous lines can share an enclosing rectangle, and lines broken into several fragments have a separate enclosing rectangle for each fragment.
The rectangle returned is owned by the receiver, and is overwritten by various NSLayoutManager methods. You should never free it, and should copy it if you need to keep the values or use them after sending other messages to the layout manager.
The purpose of this method is to calculate line rectangles for drawing the text background and highlighting. These rectangles don't necessarily enclose glyphs that draw outside their line fragment rectangles; use boundingRectForGlyphRange to determine the area that contains all drawing performed for a range of glyphs.
Performs glyph generation and layout if needed.
See Also: glyphRangeForTextContainer, characterRangeForGlyphRange, drawsOutsideLineFragmentForGlyphAtIndex
public NSRect rectArrayForGlyphRange(
NSRange glyphRange,
NSRange selGlyphRange,
NSTextContainer aTextContainer)
NotFound
.
To calculate the rectangles for highlighting, use a selected glyph
range that contains glyphRange.The number of rectangles returned isn't necessarily the number of lines enclosing the specified range. Contiguous lines can share an enclosing rectangle, and lines broken into several fragments have a separate enclosing rectangle for each fragment.
The rectangle returned is owned by the receiver, and is overwritten by various NSLayoutManager methods. You should never free it, and should copy it if you need to keep the values or use them after sending other messages to the layout manager.
The purpose of this method is to calculate line rectangles for drawing the text background and highlighting. These rectangles don't necessarily enclose glyphs that draw outside their line fragment rectangles; use boundingRectForGlyphRange to determine the area that contains all drawing performed for a range of glyphs.
Performs glyph generation and layout if needed.
See Also: glyphRangeForTextContainer, drawsOutsideLineFragmentForGlyphAtIndex
public void removeTextContainerAtIndex(int index)
See Also: addTextContainer, insertTextContainerAtIndex, textContainers, invalidateGlyphsForCharacterRange, invalidateLayoutForCharacterRange
public void replaceGlyphAtIndex(
int glyphIndex,
int newGlyph)
This method is for use by the glyph generation mechanism, and doesn't perform any invalidation or generation of the glyphs or layout. You should never directly invoke this method.
See Also: setCharacterIndexForGlyphAtIndex, invalidateGlyphsForCharacterRange, invalidateLayoutForCharacterRange
public void replaceTextStorage(newTextStorage newTextStorage)
public NSView rulerAccessoryViewForTextView(
NSTextView aTextView,
NSParagraphStyle paraStyle,
NSRulerView aRulerView,
boolean flag)
null
. If flag is true
the
accessory view is enabled and accepts mouse and keyboard events; if false
it's
disabled.This method is invoked automatically by the NSTextView object using the layout manager. You should rarely need to invoke it, but you can override it to customize ruler support. If you do this method directly, not that it neither installs the ruler accessory view nor sets the markers for the NSRulerView. You must install the accessory view into the ruler using NSRulerView's setAccessoryView method. To set the markers, use rulerMarkersForTextView to get the markers needed and then send setMarkers to the ruler.
See Also: horizontalRulerView (NSScrollView)
public NSArray rulerMarkersForTextView(
NSTextView aTextView,
NSParagraphStyle paraStyle,
NSRulerView aRulerView)
This method is invoked automatically by the NSTextView object using the layout manager. You should rarely need to invoke it; but you can override it to add new kinds of markers or otherwise customize ruler support.
See Also: rulerAccessoryViewForTextView
public void setBackgroundLayoutEnabled(boolean flag)
See Also: backgroundLayoutEnabled
public void setCharacterIndexForGlyphAtIndex(
int charIndex,
int glyphIndex)
This method is for use by the glyph generation mechanism, and doesn't perform any invalidation or generation of the glyphs or layout. You should never directly invoke this method.
See Also: characterIndexForGlyphAtIndex, characterRangeForGlyphRange, glyphRangeForCharacterRange
public void setDelegate(Object anObject)
See Also: delegate
public void setDrawsOutsideLineFragmentForGlyphAtIndex(
boolean flag,
int glyphIndex)
This method is used by the layout mechanism; you should never invoke it directly.
See Also: drawsOutsideLineFragmentForGlyphAtIndex
public void setExtraLineFragmentRect(
NSRect aRect,
NSRect usedRect,
NSTextContainer aTextContainer)
This method is used by the layout mechanism; you should never invoke it directly.
See Also: extraLineFragmentRect, extraLineFragmentUsedRect, textContainers
public void setHyphenationFactor(float factor)
See Also: hyphenationFactor
public void setGlyphAttributeForGlyphAtIndex(
int attributeTag,
int anInt,
int glyphIndex)
Subclasses that define their own custom attributes must override this method and provide their own storage for the attribute values. Non-negative tags are reserved ; you can define your own attributes with negative tags and set values using this method.
This method doesn't perform glyph generation or layout. The glyph at glyphIndex must already have been generated.
See Also: glyphAttributeForGlyphAtIndex
public void setLineFragmentRectForGlyphAtIndex(
NSRect fragmentRect,
NSRange glyphRange,
NSRect usedRect)
This method is used by the layout mechanism; you should never invoke it directly.
See Also: lineFragmentRectForGlyphAtIndex, lineFragmentUsedRectForGlyphAtIndex
public void setLocationForStartOfGlyphRange(
NSPoint aPoint,
NSRange glyphRange)
show
operation
(a nominal range). Setting the location for a series of glyphs implies
that the glyphs preceding it can't be included in a single show
operation.Before setting the location for a glyph range, you must specify the text container with setTextContainerForGlyphRange and the line fragment rectangle with setLineFragmentRectForGlyphAtIndex.
This method is used by the layout mechanism; you should never invoke it directly.
See Also: rangeOfNominallySpacedGlyphsContainingIndex
public void setNotShownForGlyphAtIndex(
boolean flag,
int glyphIndex)
This method is used by the layout mechanism; you should never invoke it directly.
See Also: notShownAttributeForGlyphAtIndex
public void setShowsControlCharacters(boolean flag)
true
,
it substitutes visible glyphs for control characters if the font
and script support it; if flag is false
it
doesn't.See Also: setShowsInvisibleCharacters, showsControlCharacters
public void setShowsInvisibleCharacters(boolean flag)
true
,
it substitutes visible glyphs for invisible characters if the font and
script support it; if flag is false
it
doesn't.See Also: setShowsControlCharacters, showsInvisibleCharacters
public void setTextContainerForGlyphRange(
NSTextContainer aTextContainer,
NSRange glyphRange)
This method is used by the layout mechanism; you should never invoke it directly.
See Also: textContainerForGlyphAtIndex
public void setTextStorage(NSTextStorage textStorage)
See Also: addLayoutManager (NSTextStorage)
public void setUsesScreenFonts(boolean flag)
See Also: usesScreenFonts, substituteFontForFont
public void showAttachmentCell(
NSCell cell,
NSRect rect,
int attachmentIndex)
public boolean showsControlCharacters()
true
if
the receiver substitutes visible glyphs for control characters if
the font and script support it, false
if
it doesn't.See Also: showsInvisibleCharacters, setShowsControlCharacters
public boolean showsInvisibleCharacters()
true
if
the receiver substitutes visible glyphs for invisible characters
if the font and script support it, false
if
it doesn't.See Also: showsControlCharacters, setShowsInvisibleCharacters
public NSFont substituteFontForFont(NSFont originalFont)
See Also: usesScreenFonts
public void textContainerChangedGeometry(NSTextContainer aTextContainer)
public void textContainerChangedTextView(NSTextContainer aTextContainer)
public NSTextContainer textContainerForGlyphAtIndex(
int glyphIndex,
NSMutableRange effectiveGlyphRange)
null
, effectiveGlyphRange is
set to the range for all glyphs laid out in that text container.Performs glyph generation and layout if needed.
See Also: setTextContainerForGlyphRange
public NSArray textContainers()
See Also: addTextContainer, insertTextContainerAtIndex, removeTextContainerAtIndex
public NSTextStorage textStorage()
See Also: setTextStorage, replaceTextStorage
public void textStorageChanged(
NSTextStorage aTextStorage,
int mask,
NSRange range,
int lengthChange,
NSRange invalidatedCharRange)
Option | Meaning |
TextStorageEditedAttributes |
Attributes were added, removed, or changed. |
TextStorageEditedCharacters |
Characters were added, removed, or replaced. |
range indicates the
extent of characters resulting from the edits. If the TextStorageEditedCharacters
bit
of mask is set, lengthChange gives
the number of characters added to or removed from the original range
(otherwise its value is irrelevant). For example, after replacing
"The" with "Several" to produce the string "Several files
couldn't be saved", range is
{0, 7} and lengthChange is 4. The
receiver uses this information to update its character-to-glyph
mapping and to update the selection range based on the change.
invalidatedRange represents the range of characters affected after attributes have been fixed. For example, deleting a paragraph separator character invalidates the layout information for all characters in the paragraphs that precede and follow the separator.
textStorageChanged messages are sent in a series to each NSLayoutManager associated with the text storage object, so the NSLayoutManagers receiving them shouldn't edit aTextStorage. If one of them does, the range, lengthChange, and invalidatedRange arguments will be incorrect for all following NSLayoutManagers that receive the message.
See Also: invalidateLayoutForCharacterRange
public NSTextView textViewForBeginningOfSelection()
null
if
there's no selection or there isn't enough layout information
to determine the text view.public void underlineGlyphRange(
NSRange glyphRange,
int underlineType,
NSRect lineRect,
NSRange lineGlyphRange,
NSPoint containerOrigin)
NSAttributedString.SingleUnderlineStyle
,
but subclasses can define their own underline styles. lineRect is
the line fragment rectangle containing the glyphs to draw underlining
for, and lineGlyphRange is the range
of all glyphs within that line fragment rectangle. containerOrigin is
the origin of the line fragment rectangle's NSTextContainer in
its NSTextView.This method determines which glyphs actually
need to be underlined based on underlineType.
With NSAttributedString.SingleUnderlineStyle
,
for example, leading and trailing whitespace isn't underlined,
but whitespace between visible glyphs is. A potential word-underline
style would omit underlining on any whitespace. After determining
which glyphs to draw underlining on, this method invokes drawUnderlineForGlyphRange for
each contiguous range of glyphs that requires it.
See Also: textContainerForGlyphAtIndex, textContainerOrigin (NSTextView)
public NSRect usedRectForTextContainer(NSTextContainer aTextContainer)
See Also: containerSize (NSTextContainer)
public boolean usesScreenFonts()
true
if
the receiver calculates layout and displays text using screen fonts
when possible, false
otherwise.See Also: setUsesScreenFonts, substituteFontForFont
public abstract void layoutManagerDidCompleteLayoutForTextContainer(
NSLayoutManager aLayoutManager,
NSTextContainer aTextContainer,
boolean flag)
null
if
there aren't enough containers to hold all the text; the delegate
can use this information as a cue to add another container. If flag is true
, aLayoutManager is
finished laying out its text-this also means that aTextContainer is
the final text container used by the layout manager. Delegates can
use this information to show an indicator or background or to enable
or disable a button that forces immediate layout of text.public abstract void layoutManagerDidInvalidateLayout(NSLayoutManager aLayoutManager)