Inherits from NSObject
Conforms to GSContainerProtocol
GSUserDataProtocol
NSCoding
NSCopying
Declared in GSFontMaster.h

Overview

The class defining the fontmaster object

A class extension for legacy properties.

Properties

custom

A custom tag

@property (copy, nonatomic) NSString *custom

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

defaultCapHeight

The capHeight.

@property (nonatomic, readonly) CGFloat defaultCapHeight

defaultItalicAngle

The Italic angle

@property (nonatomic) CGFloat defaultItalicAngle

defaultXHeight

The xHeight.

@property (nonatomic, readonly) CGFloat defaultXHeight

guides

The guides.

@property (nonatomic, strong) NSMutableArray<GSGuide*> *guides

id

The id

@property (copy, nonatomic) NSString *id

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”

width

The width tag

@property (copy, nonatomic) NSString *width

Discussion

Something like Condensed or Extended

widthValue

The width value

@property (assign, nonatomic) CGFloat widthValue

Discussion

The width value defines the place of the Fontmaster in the “design space”

Instance Methods

addGuide:

Adds the guide

- (void)addGuide:(GSGuide *)guide

Parameters

guide

the object to be added

addProperty:

Adds the property

- (void)addProperty:(GSFontInfoProperty *)property

Parameters

property

the object to be added

countOfCustomParameters

The count of customParameters

- (NSUInteger)countOfCustomParameters

countOfGuides

The number of guides

- (NSUInteger)countOfGuides

countOfProperties

The number of properties

- (NSUInteger)countOfProperties

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

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

initFast

// list of alignment zones

- (instancetype)initFast

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

italicAngleForLayer:

The Italic angle

- (CGFloat)italicAngleForLayer:(GSLayer *)layer

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

Parameters

value

The value to add

key

The name of the paramter

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

ttStems

convenient for TT export

- (NSArray<GSTTStem*> *)ttStems

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