GSFontMaster Class Reference
Inherits from | NSObject |
Conforms to | GSContainerProtocol GSUserDataProtocol NSCoding NSCopying |
Declared in | GSFontMaster.h |
Tasks
Properties
name
id
– disableUpdateInterface
– stopUpdateInterface
– enableUpdateInterface
– isUpdateInterfaceEnabled
defaultAscender
defaultCapHeight
defaultXHeight
– ttStems
defaultItalicAngle
– italicAngleForLayer:
– initFast
Initializing an Font Master
Other Methods
– scaleBy:
– setProperty:value:languageTag:
guides
– countOfGuides
– objectInGuidesAtIndex:
– indexOfObjectInGuides:
– addGuide:
– insertObject:inGuidesAtIndex:
– removeObjectFromGuides:
– removeObjectFromGuidesAtIndex:
customParameters
customParameters
– countOfCustomParameters
– customValueForKey:
– customParameterForKey:
– setCustomValue:forKey:
– removeObjectFromCustomParametersForKey:
Properties
properties
– countOfProperties
– objectInPropertiesAtIndex:
– indexOfObjectInProperties:
– addProperty:
– insertObject:inPropertiesAtIndex:
– removeObjectFromProperties:
– removeObjectFromPropertiesAtIndex:
UserData
Other Methods
Properties
customParameters
The customParameters. A list of customParameters objects
@property (nonatomic, strong)
NSMutableArray<GSCustomParameter*> *customParameters
customValue
The custom value
@property (assign, nonatomic) CGFloat customValue
Discussion
The custom value defines the place of the Fontmaster in the “design space”
defaultAscender
The default ascender. This is kept for compatibilit, for now.
@property (nonatomic, readonly) CGFloat
defaultAscender
name
the name of the FontMaster e.g; “Regular”, “Condensed”, …
@property (nonatomic, strong) NSString *name
properties
The properties. this contains (localisable) names and other font info settings
@property (nonatomic, strong)
NSMutableArray<GSFontInfoProperty*> *properties
userData
Place to store data.
@property (strong, nonatomic, nullable) NSDictionary
*userData
Discussion
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).
weight
The weight tag
@property (copy, nonatomic) NSString *weight
Discussion
Something like Light or Regular
weightValue
The weight value
@property (assign, nonatomic) CGFloat weightValue
Discussion
The weight value defines the place of the Fontmaster in the “design space”
Instance Methods
addProperty:
Adds the property
- (void)addProperty:(GSFontInfoProperty
*)property
Parameters
- property
-
the object to be added
customParameterForKey:
The customParameters where name == Key
- (GSCustomParameter *)customParameterForKey:(NSString
*)key
customValueForKey:
The value of the customParameters where name == Key
- (id)customValueForKey:(NSString *)key
disableUpdateInterface
Delayes redrawing and updates.
- (void)disableUpdateInterface
Discussion
Will record the changes and update once in enableUpdateInterface
.
If you don’t need updates, use stopUpdateInterface
Warning: Always call enableUpdateInterface afterwards
See Also
enableUpdateInterface
Reanables redrawing and updates.
- (void)enableUpdateInterface
Discussion
This only has an effect if disableUpdateInterface was called before
indexOfObjectInGuides:
Returns the index of guide in guides
- (NSUInteger)indexOfObjectInGuides:(GSGuide
*)guide
Parameters
- guide
-
the object
Return Value
the index of the object
indexOfObjectInProperties:
Returns the index of property in properties
- (NSUInteger)indexOfObjectInProperties:(GSFontInfoProperty
*)property
Parameters
- property
-
the object
Return Value
the index of the object
initWithDict:format:
Inits with a dict.
- (instancetype)initWithDict:(NSDictionary *)dict
format:(GSFormatVersion)formatVersion
Parameters
- dict
-
The property list representation
- formatVersion
-
the version of the property list
Return Value
a fontmaster object
insertObject:inGuidesAtIndex:
Inserts the guide at index into guides
- (void)insertObject:(GSGuide *)guide
inGuidesAtIndex:(NSUInteger)idx
Parameters
- guide
-
The object to insert
- idx
-
The index
insertObject:inPropertiesAtIndex:
Inserts the property at index into properties
- (void)insertObject:(GSFontInfoProperty *)property
inPropertiesAtIndex:(NSUInteger)idx
Parameters
- property
-
The object to insert
- idx
-
The index
isUpdateInterfaceEnabled
Check if the updating is enabled
- (BOOL)isUpdateInterfaceEnabled
Return Value
NO if disableUpdateInterface was called
objectInGuidesAtIndex:
Returns object at idx in guides
- (GSGuide
*)objectInGuidesAtIndex:(NSUInteger)idx
Parameters
- idx
-
The index
Return Value
the object at index
objectInPropertiesAtIndex:
Returns object at idx in properties
- (GSFontInfoProperty
*)objectInPropertiesAtIndex:(NSUInteger)idx
Parameters
- idx
-
The index
Return Value
the object at index
propertyListValueFormat:
Returns the content of the object to store it in pList.
- (NSDictionary
*)propertyListValueFormat:(GSFormatVersion)format
Parameters
- format
-
the version of the dict
Discussion
This is used to store the data in the .glyphs file.
removeObjectFromCustomParametersForKey:
Removes the first paramter with then Name
- (void)removeObjectFromCustomParametersForKey:(NSString
*)key
Parameters
- key
-
The name
removeObjectFromGuides:
Removes the guide
- (void)removeObjectFromGuides:(GSGuide
*)guide
Parameters
- guide
-
the object to be removed
removeObjectFromGuidesAtIndex:
Removes the guide at idx
-
(void)removeObjectFromGuidesAtIndex:(NSUInteger)idx
Parameters
- idx
-
The index
removeObjectFromProperties:
Removes the property
- (void)removeObjectFromProperties:(GSFontInfoProperty
*)property
Parameters
- property
-
the object to be removed
removeObjectFromPropertiesAtIndex:
Removes the property at idx
-
(void)removeObjectFromPropertiesAtIndex:(NSUInteger)idx
Parameters
- idx
-
The index
removeUserDataForKey:
Removed the object with this key.
- (void)removeUserDataForKey:(NSString *)key
Parameters
- key
-
The key to remove
scaleBy:
Scales the Font Master Scales the vertical metrics, alignment zones and guide lines
- (void)scaleBy:(CGFloat)scale
Parameters
- scale
-
the scale factor (1 means no scaling.)
setCustomValue:forKey:
Set the value for key
- (void)setCustomValue:(id)value forKey:(NSString
*)key
Discussion
It will look for an existing paramter with the name an overwrite its value, or adds a new parameter
setProperty:value:languageTag:
Adds a new font info value to the array specified by
key
or updates an existing one.
- (void)setProperty:(NSString *)name value:(NSString
*)value languageTag:(nullable NSString
*)languageTag
Parameters
- name
-
The key whose plural form specifies an array property of
GSFontInfoValue
objects on the receiver.
- value
-
The actual value to be added.
- languageTag
-
The language under which the the value should be stored. Defaults to
English
if nil is passed.
setUserData:forKey:
Adds something to the fonts userData.
- (void)setUserData:(nullable id)value
forKey:(nonnull NSString *)key
Parameters
- value
-
The object should be able to serialize to a plist. If they are not, they should return all infos to store in description (as String).
- key
-
Please use an uniqe key that gives some indecation who put it there (e.g. prefix it with your name or project).
Discussion
This also triggers undo/document dirty state.
stopUpdateInterface
Disable redrawing and updates completly.
- (void)stopUpdateInterface
Discussion
Changes will not trigger an update. Only use this calefully and call enableUpdateInterface if you need future updates.
Warning: Always call enableUpdateInterface afterwards
See Also
userDataForKey:
convenience accessor to get to the content of the userData dict
- (NSObject *_Nullable)userDataForKey:(NSString
*)key
Parameters
- key
-
the key
Return Value
the data stored with key