GSGlyphEditViewProtocol Protocol Reference
Tasks
-
activeLayerproperty required method -
activePositionproperty required method -
scaleproperty required method -
activeIndexproperty required method -
cachedLayerCountproperty required method -
selectedRangeproperty required method -
cachedLayerSelectionRangeproperty required method -
selectedLayerRangeproperty required method -
selectionAnchorLayerIndexproperty required method -
cursorproperty required method -
textStorageproperty required method -
doKerningproperty required method -
doSpacingproperty required method -
zoomTransformerproperty required method -
layoutManagerproperty required method -
– getActiveLocation:required method -
– cachedGlyphAtIndex:required method -
– cachedPositionAtIndex:required method -
– characterIndexForPoint:required method -
– layerIndexForPoint:required method
Properties
activeIndex
The index of the character of the active layer in the string
@property (nonatomic) NSUInteger activeIndexactiveLayer
The active layer
@property (nonatomic, nullable, strong) GSLayer *activeLayerDiscussion
If only one layer is selected it retunes it, otherwise it retunes nil.
In the editview, this is the layer that has a gray info box.
activePosition
The position of the activeLayer
@property (nonatomic) NSPoint activePositionDiscussion
This is in scaled view coordinates.
See Also
cachedLayerCount
number of layers in the view.
@property (nonatomic, readonly) NSUInteger cachedLayerCountDiscussion
This might be difference than the number of characters in the string after the features are applied
cachedLayerSelectionRange
The layer selection range after features have been applied.
@property (nonatomic, readonly) NSRange cachedLayerSelectionRangeDiscussion
Note: This should now return the contents of the new selectedLayerRange property.
layoutManager
The layout manager
@property (strong, nonatomic, nonnull) GSLayoutManager *layoutManagerselectedLayerRange
The layer selection range after features have been applied.
@property (nonatomic) NSRange selectedLayerRangeDiscussion
When setting this property, the selectedRange property should also be set to the corresponding converted character range.
When setting the selectedRange property (except in the case above), this property should be set to {NSNotFound, 0}.
When getting this property, the actual ivar should only be returned if it is not {NSNotFound, 0}. Otherwise, the corresponding converted character range should be returned.
Note: Setting this property should implicitly set selectionAnchorLayerIndex if its length is 0.
selectedRange
the selection range in characters as in the original string
@property (nonatomic) NSRange selectedRangeselectionAnchorLayerIndex
Marks the starting point of selection.
@property (nonatomic) NSUInteger selectionAnchorLayerIndexDiscussion
Note: This property should be set implicitly when selectedLayerRange is set and its length is 0.
Instance Methods
cachedGlyphAtIndex:
Returns the cached layer at index
- (GSLayer *_Nullable)cachedGlyphAtIndex:(NSUInteger)IndexParameters
- Index
The cached index
Return Value
The layer
cachedPositionAtIndex:
Returns the cached position at a layer index
- (NSPoint)cachedPositionAtIndex:(NSUInteger)IndexParameters
- Index
The cached index
Return Value
the position
characterIndexForPoint:
Should pass the given graphical position to layerIndexForPoint: and convert the layer index to a character index.
- (NSUInteger)characterIndexForPoint:(NSPoint)thePointParameters
- thePoint
The graphical position to check, in view coordinates.
Return Value
The index of the character whose bounding box contains the point.
Discussion
Note: This may not be the desired index if a character is comprised of multiple glyphs. Instead, use layerIndexForPoint: directly and set the selectedLayerRange property.