GSGlyphEditViewProtocol Protocol Reference
Declared in | GSGlyphEditViewProtocol.h |
Tasks
activeLayer
required methodactivePosition
required methodscale
required methodactiveIndex
required methodcachedLayerCount
required methodselectedRange
required methodcachedLayerSelectionRange
required methodselectedLayerRange
required methodselectionAnchorLayerIndex
required methodcursor
required methodtextStorage
required methoddoKerning
required methoddoSpacing
required methodlayoutManager
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 activeIndex
activeLayer
The active layer
@property (nonatomic, nullable, strong) GSLayer
*activeLayer
Discussion
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 activePosition
Discussion
This is in scaled view coordinates.
See Also
cachedLayerCount
number of layers in the view.
@property (nonatomic, readonly) NSUInteger
cachedLayerCount
Discussion
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
cachedLayerSelectionRange
Discussion
Note: This should now return the contents
of the new selectedLayerRange
property.
layoutManager
The layout manager
@property (strong, nonatomic, nonnull) GSLayoutManager
*layoutManager
selectedLayerRange
The layer selection range after features have been applied.
@property (nonatomic) NSRange selectedLayerRange
Discussion
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 selectedRange
selectionAnchorLayerIndex
Marks the starting point of selection.
@property (nonatomic) NSUInteger
selectionAnchorLayerIndex
Discussion
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)index
Parameters
- index
-
The cached index
Return Value
The layer
cachedPositionAtIndex:
Returns the cached position at a layer index
-
(NSPoint)cachedPositionAtIndex:(NSUInteger)index
Parameters
- 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)point
Parameters
- point
-
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.