NSLayoutManager jagapen@smithlab.chem.wisc.edu mhanni@sprintmail.com rfm@gnu.org The text layout manager class 1999 Free Software Foundation, Inc. Software documentation for the NSLayoutManager class AppKit/NSLayoutManager.h

A layout manager handles layout and glyph management for a text storage. A glyph is a symbol draewn to a display, and while there is usually a one to one correspondence between glyphs and characters in the text storage, that is no always the case.

Sometimes a group of characters (a unicode composed character sequence) can represent a single glyph, sometimes a single unicode character is represented by multiple glyphs.

eg. The text storage may contain the unichar o-umlaut and the glyph stream could contain the two glyphs "o" and umlaut. In this case, we would have two glyphs, with different glyph indexes, both corresponding to a single character index.

Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. Description forthcoming. addTextContainer: obj Adds a container to the layout manager. backgroundLayoutEnabled Returns flag to say if text should get laid out in the background when the run lopp is idle. boundingRectForGlyphRange: glyphRange inTextContainer: aTextContainer Description forthcoming. characterIndexForGlyphAtIndex: glyphIndex Returns the character index for the specified glyphIndex.
If there are invalidated ranges (gaps) in the glyph stream before glyphIndex, this will cause glyph generation to fill them.
characterRangeForGlyphRange: glyphRange actualGlyphRange: actualGlyphRange Returns the range of characters that generated the glyphs in glyphRange. Sets actualGlyphRange (if non-nul) to the range of glyphs generated by those characters. delegate Description forthcoming. deleteGlyphsInRange: aRange Removes all the glyphs in aRange from the glyph stream, causing all subsequent glyphs to have their index decreased by aRange.length drawsOutsideLineFragmentForGlyphAtIndex: glyphIndex Description forthcoming. extraLineFragmentRect Description forthcoming. extraLineFragmentTextContainer Description forthcoming. extraLineFragmentUsedRect Description forthcoming. firstUnlaidCharacterIndex Description forthcoming. firstUnlaidGlyphIndex Description forthcoming. getFirstUnlaidCharacterIndex: charIndex glyphIndex: glyphIndex Description forthcoming. getGlyphs: glyphArray range: glyphRange This returns a nul terminated array of glyphs... so glyphArray should contain space for glyphRange.length+1 glyphs. glyphAtIndex: index Returns the glyph at the specified index .
Causes any gaps (areas where glyphs have been invalidated) before this index to be re-filled.
Raises an exception if the index is out of range.
glyphAtIndex: index isValidIndex: flag Returns the glyph at the specified index .
Causes any gaps (areas where glyphs have been invalidated) before this index to be re-filled.
Sets the flag to indicate whether the index was found... if it wasn't the returned glyph is meaningless.
glyphIndexForPoint: aPoint inTextContainer: aTextContainer Description forthcoming. glyphIndexForPoint: aPoint inTextContainer: aTextContainer fractionOfDistanceThroughGlyph: partialFraction Description forthcoming. glyphRangeForBoundingRect: aRect inTextContainer: aTextContainer Description forthcoming. glyphRangeForBoundingRectWithoutAdditionalLayout: bounds inTextContainer: aTextContainer Description forthcoming. glyphRangeForCharacterRange: charRange actualCharacterRange: actualCharRange Returns the range of glyphs that are generated from the characters in charRange. Sets actualCharRange (if non-nul) to the full range of characters which generated those glyphs. glyphRangeForTextContainer: aTextContainer Description forthcoming. init Sets up this instance. We should in future find a glyph generator and a typesetter to use with glyphs management, but for now we just set up the glyph storage. insertGlyph: aGlyph atGlyphIndex: glyphIndex characterIndex: charIndex Used by the internal glyph generation system to insert aGlyph into the glyph stream athe the specified glyphIndex and charIndex.
Invariants...
a) Glyph chunks are ordered sequentially from zero by character index.
b) Glyph chunks are ordered sequentially from zero by glyph index.
c) Adjacent glyphs may share a character index.
insertTextContainer: aTextContainer atIndex: index Inserts a new text container at index. intAttribute: attribute forGlyphAtIndex: glyphIndex Returns the value for the attribute at the glyphIndex. invalidateDisplayForCharacterRange: aRange Causes redisplay of aRange, but does not lose the alyout information. invalidateDisplayForGlyphRange: aRange Causes redisplay of aRange, but does not lose the alyout information. invalidateGlyphsForCharacterRange: aRange changeInLength: lengthChange actualCharacterRange: actualRange This determines the glyph range corresponding to aRange and marks the glyphs as invalid. It adjusts the character locations of all glyphs beyond this by lengthChange. It returns the actual character range corresponding to the invalidated glyphs if actualRange is non-nul. invalidateLayoutForCharacterRange: aRange isSoft: flag actualCharacterRange: actualRange This invalidates glyph positions for all glyphs corresponding to the specified character range.
If flag is YES then the layout information needs to be redone from scratch, but if it's NO, the layout manager may try to optimise layout from the old information.
If actualRange is non-nul, returns the actual range invalidated.
lineFragmentRectForGlyphAtIndex: glyphIndex effectiveRange: lineFragmentRange Description forthcoming. lineFragmentUsedRectForGlyphAtIndex: glyphIndex effectiveRange: lineFragmentRange Description forthcoming. locationForGlyphAtIndex: glyphIndex Description forthcoming. notShownAttributeForGlyphAtIndex: glyphIndex Description forthcoming. numberOfGlyphs Returns the number of glyphs in the glyph stream... causing generation of new glyphs to fill gaps and to extend the stream until all characters in the text storage have had glyphs generated. rangeOfNominallySpacedGlyphsContainingIndex: glyphIndex Description forthcoming. rectArrayForCharacterRange: charRange withinSelectedCharacterRange: selChareRange inTextContainer: aTextContainer rectCount: rectCount Description forthcoming. rectArrayForGlyphRange: glyphRange withinSelectedGlyphRange: selectedGlyphRange inTextContainer: aTextContainer rectCount: rectCount Description forthcoming. removeTextContainerAtIndex: index Removes the text container at index. replaceGlyphAtIndex: index withGlyph: newGlyph Replaces the glyph at index with newGlyph without changing character index or other attributes. replaceTextStorage: newTextStorage Replaces the test storage with a new one.
Takes care (since layout managers are owned by text storages) not to get self deallocated.
setAttachmentSize: attachmentSize forGlyphRange: glyphRange Description forthcoming. setBackgroundLayoutEnabled: flag Sets flag to say if text should get laid out in the background when the run lopp is idle. setCharacterIndex: charIndex forGlyphAtIndex: glyphIndex Sets the glyph at glyphIndex to correspond to the character at charIndex. setDelegate: aDelegate Description forthcoming. setDrawsOutsideLineFragment: flag forGlyphAtIndex: glyphIndex Description forthcoming. setExtraLineFragmentRect: aRect usedRect: usedRect textContainer: aTextContainer Description forthcoming. setIntAttribute: attribute value: anInt forGlyphAtIndex: glyphIndex This method modifies the attributes of an existing glyph at glyphIndex. It only deals with the existing attribute types... if you subclass and add new attributed, you must replace this method with one which can store your new attributes. setLineFragmentRect: fragmentRect forGlyphRange: glyphRange usedRect: usedRect Description forthcoming. setLocation: aPoint forStartOfGlyphRange: glyphRange Description forthcoming. setNotShownAttribute: flag forGlyphAtIndex: glyphIndex Description forthcoming. setShowsControlCharacters: flag Description forthcoming. setShowsInvisibleCharacters: flag Description forthcoming. setTextContainer: aTextContainer forGlyphRange: glyphRange Description forthcoming. setTextStorage: aTextStorage Sets the text storage for the layout manager. Use -replaceTextStorage: instead as a rule. - this method is really more for internal use by the text system. Invalidates the entire layout (should it] setUsesScreenFonts: flag Description forthcoming. showsControlCharacters Description forthcoming. showsInvisibleCharacters Description forthcoming. substituteFontForFont: originalFont Description forthcoming. textContainerChangedGeometry: aContainer Invalidates the layout of all glyphs in aContainer and all containers following it. textContainerChangedTextView: aContainer Notifies the layout manager that one of its text containers has changed its view and an update of the display is needed. textContainerForGlyphAtIndex: glyphIndex effectiveRange: effectiveRange Returns the text container in which the glyph at glyphIndex is laid. If effectiveRange is non-nul, returns the range of all glyphs in the container. textContainers Return the text containers textStorage Returns the text storage for this layout manager. textStorage: aTextStorage edited: mask range: newCharRange changeInLength: lengthChange invalidatedRange: invalidatedRange This method is used to handle an editing change to aTextStorage. The mask value indicates whether characters or attribuytes or both have changed.
If characters have not changed, the lengthChange argument is ignored.
The newCharRange is the effected range currently in the storage, while invalidatedRange is the original range effected.
usedRectForTextContainer: container Description forthcoming. usesScreenFonts Description forthcoming.
Software documentation for the NSLayoutManager(NSTextViewSupport) category AppKit/NSLayoutManager.h Description forthcoming. _charIndexForInsertionPointMovingFromY: position bestX: wanted up: upFlag textContainer: tc Description forthcoming. drawBackgroundForGlyphRange: glyphsToShow atPoint: origin Description forthcoming. drawGlyphsForGlyphRange: glyphsToShow atPoint: origin Description forthcoming. drawUnderlineForGlyphRange: glyphRange underlineType: underlineVal baselineOffset: baselineOffset lineFragmentRect: lineRect lineFragmentGlyphRange: lineGlyphRange containerOrigin: containerOrigin Description forthcoming. firstTextView Description forthcoming. hyphenationFactor Description forthcoming. layoutManagerOwnsFirstResponderInWindow: window Description forthcoming. rulerAccessoryViewForTextView: view paragraphStyle: style ruler: ruler enabled: isEnabled Description forthcoming. rulerMarkersForTextView: view paragraphStyle: style ruler: ruler Description forthcoming. setHyphenationFactor: factor Description forthcoming. textViewForBeginningOfSelection Description forthcoming. underlineGlyphRange: glyphRange underlineType: underlineVal lineFragmentRect: lineRect lineFragmentGlyphRange: lineGlyphRange containerOrigin: containerOrigin Description forthcoming. Software documentation for the NSObject(NSLayoutManagerDelegate) informal protocol AppKit/NSLayoutManager.h Description forthcoming. layoutManager: layoutManager didCompleteLayoutForTextContainer: textContainer atEnd: layoutFinishedFlag Description forthcoming. layoutManagerDidInvalidateLayout: sender Description forthcoming.