GSGlyph Class Reference
| Inherits from | NSObject |
| Conforms to | NSCoding NSCopying |
Tasks
Properties
-
parentproperty -
nameproperty -
unicodeproperty -
unicodeCharproperty -
noteproperty -
scriptproperty -
categoryproperty -
subCategoryproperty -
storeProductionproperty -
baseGlyphsproperty -
glyphDictproperty -
leftMetricsKeyproperty -
rightMetricsKeyproperty -
leftKerningGroupproperty -
rightKerningGroupproperty -
leftKerningGroupIdproperty -
rightKerningGroupIdproperty -
topKerningGroupIdproperty -
bottomKerningGroupIdproperty -
exportproperty -
colorproperty -
colorIndexproperty -
userDataproperty -
undoManagerproperty -
idproperty -
sortNameproperty -
partsSettingsproperty -
– initWithGlyphDict: -
– saveToFile:compact:doLastChange:error:
Layers
Properties
baseGlyphs
The glyphs the glyph is composed of.
@property (nonatomic, strong, nullable) NSArray<GSGlyphInfo*> *baseGlyphsbottomKerningGroupId
The id of the key glyph for bottom kerning.
@property (copy, nonatomic, nullable) NSString *bottomKerningGroupIdDiscussion
this sould look like this: @MM_B_Name
category
The category of the glyph
@property (nonatomic, copy, nullable) NSString *categoryDiscussion
e.g: letter, number, punctuation … this is set from the internal database.
colorIndex
Returns the index of the color label
@property (assign, nonatomic) NSInteger colorIndexReturn Value
0–11, anything else means no label
glyphDict
The content of the glyph as dictionary to store it in a pList.
@property (unsafe_unretained, readonly) NSDictionary *glyphDictDiscussion
This is used to store the data in the .glyphs file.
id
The glyph key is used to access the glyph.
@property (strong, nonatomic) NSString *idDiscussion
This is used to keep track of the glyph even if is renamed. It is used for the kerning. It could look like this: “FBCA074D-FCF3-427E-A700-7E318A949AE5”
layers
An array of GSLayer objects.
@property (strong, nonatomic) NSDictionary *layersDiscussion
It should have at least the same count than font.fontMasters.
The keys are the id of the font masters and should be the same as the GSLayer.associatedMasterId if the layer that is associated by the key. For ‘master layers’, it should also be equal to the GSLayer.layerId.
leftKerningGroup
The name of the kerning group for left side kerning.
@property (copy, nonatomic, nullable) NSString *leftKerningGroupleftKerningGroupId
The id of the keyglyph for left side kerning.
@property (copy, nonatomic, nullable) NSString *leftKerningGroupIdDiscussion
this sould look like this: @MM_L_Name
leftMetricsKey
The glyphname of the keyglyph for LSB.
@property (copy, nonatomic, nullable) NSString *leftMetricsKeyparent
A pointer to the containing GSFont object
@property (weak, nonatomic, nullable) GSFont *parentpartsSettings
Defines the parameters for Smart Glyphs.
@property (strong, nonatomic, nullable) NSMutableArray *partsSettingsDiscussion
It contains an array of GSPartProperty objects.
rightKerningGroup
The name of the kerning group for right side kerning.
@property (copy, nonatomic, nullable) NSString *rightKerningGrouprightKerningGroupId
The id of the key glyph for right side kerning.
@property (copy, nonatomic, nullable) NSString *rightKerningGroupIdDiscussion
this sould look like this: @MM_R_Name
rightMetricsKey
The glyphname of the keyglyph for RSB.
@property (copy, nonatomic, nullable) NSString *rightMetricsKeyscript
The language/script of the glyph.
@property (nonatomic, copy, nullable) NSString *scriptDiscussion
e.g: latin, cyrillic, greek This is set from the internal database.
sortName
The names is used for sorting.
@property (strong, nonatomic, nullable) NSString *sortNameDiscussion
If set it will be used for sorting inside of
subCategory
The sub category of the glyph
@property (nonatomic, copy, nullable) NSString *subCategoryDiscussion
e.g: lower case, smallcaps … this is set from the internal database.
topKerningGroupId
The id of the key glyph for top kerning.
@property (copy, nonatomic, nullable) NSString *topKerningGroupIdDiscussion
this sould look like this: @MM_T_Name
undoManager
The glyphs undoManager
@property (strong, nonatomic, nullable) NSUndoManager *undoManagerReturn Value
a NSUndoManager object
Discussion
Each GSGlyph object has its own undoManager
See Also
unicode
The unicode value of the glyph. This is normaly set automaticaly on setting the name
@property (nonatomic, copy, nullable) NSString *unicodeunicodeChar
A character code of the glyph of 0 if it has no unicode
@property (nonatomic, readonly) UTF32Char unicodeCharuserData
Place to store custom data. Here it is possible to store something. Please use a unique key. The objects should be able to serialize to a plist. If they are not, they should return all infos to store in description (as String).
@property (nonatomic, strong, nullable) NSMutableDictionary *userDataInstance Methods
countOfLayers
The number of layers in the glyph
- (NSUInteger)countOfLayersReturn Value
The number of layers
initWithGlyphDict:
initialises a glyph with a dictionary loaded from a pList.
- (instancetype)initWithGlyphDict:(NSDictionary *)glyphDictParameters
- glyphDict
A dictionary
interpolate:keepSmart:error:
Generates an interpolated layer
- (GSLayer *)interpolate:(GSInstance *)instance keepSmart:(BOOL)keepSmart error:(NSError *__autoreleasing *)errorParameters
- instance
The instance that defines the interpolation values
- keepSmart
If smart components sould be decomposed before interpolation.
- error
if there is a problem, it returnes an NSError object (by reference) that contains details.
Return Value
The intepolated layer, or nil if something went wrong.
layerForKey:
Returns the a layer loacated at a Index.
- (GSLayer *_Nullable)layerForKey:(NSString *_Nonnull)KeyParameters
- Key
The Id of the layer
Return Value
A GSLayer object or nil if not found
mastersCompatible
Returns if the glyphs has compatibel outlines.
- (BOOL)mastersCompatibleReturn Value
YES if the layers have compatible outlines.
mastersCompatibleForLayerIds:
Returns if the glyphs has compatibel outlines in the layers for all FontMasterIds
- (BOOL)mastersCompatibleForLayerIds:(NSArray *)FontMasterIdsParameters
- FontMasterIds
the Master IDs
Return Value
YES if the layers have compatible outlines.
outlineHasChanges
Is called from other object after changing some of the glyphs properties.
- (void)outlineHasChangesremoveLayerForKey:
Removes the Layer for the key.
- (void)removeLayerForKey:(id)KeyParameters
- Key
The layer key.
replaceLayerWithInterpolation:
Replaces the content of the Layer with an interpolation from the remaining layers.
- (void)replaceLayerWithInterpolation:(GSLayer *)LayerParameters
- Layer
The Layer that should be recalculated
Discussion
This is useful for ‘brace’ layers but also for a default state for middle masters.
saveToFile:compact:doLastChange:error:
@discussionsaves the object to file
- (BOOL)saveToFile:(FILE *)File compact:(BOOL)Compact doLastChange:(BOOL)saveLastChange error:(NSError *__autoreleasing *)errorParameters
- File
a File
- Compact
a bool indecating if it should use a more compact file format
- saveLastChange
Disable the ‘lastChange’ entry in the file
- error
on return an error containig the reason for failiour
Return Value
YES if sucsessful
setLayer:forKey:
Adds the Layer with the key.
- (void)setLayer:(GSLayer *)Layer forKey:(id)KeyParameters
- Layer
The GSLayer object.
- Key
The layer key. For master layers this is the id of the corresponding GSFontMaster.
Discussion
If the Key is a id of a GSFontMaster, it will be a masterlayer, otherwise the associated master ID of the layer should be set to a ID of a master.