Declared in GlyphsFilterProtocol.h

Overview

The protocol defining the filter plugin interface

Properties

controller

the Controller of type GSEditViewController

@property (nonatomic, unsafe_unretained) NSViewController<GSGlyphViewControllerProtocol> *controller

dialogTitle

The title of the filter dilaog.

@property (nonatomic, readonly) NSString *dialogTitle

interfaceVersion

The interface version.

@property (nonatomic, readonly) NSUInteger interfaceVersion

keyEquivalent

The keyEquivalent to select the Filter.

@property (nonatomic, readonly) NSString *keyEquivalent

rerun

is set, if the user chose “run last Filter”. Then it should keep the settings from the last run.

@property (nonatomic) BOOL rerun

title

The title of the plugin.

@property (nonatomic, readonly) NSString *title

Instance Methods

actionName

the returned value will be placed as the title of the “OK” button in the filter dialog.

- (NSString *)actionName

customParameterString

Implement this to enable the

- (NSString *)customParameterString

filterNeedsRemoveOverlap

This will be call if the filter should be run from on export of the font. (see: Instance > Custom Properties)

- (BOOL)filterNeedsRemoveOverlap

loadPlugin

do main initialisations

- (void)loadPlugin

makeWindowController

Implement it if you need to suply your own window.

- (GSDialogController *)makeWindowController

Return Value

a GSDialogController that controlles the window

needsMenuEntry

Return NO, if the plugin should not be added to the Filter menu.

- (BOOL)needsMenuEntry

Discussion

If not implemented, it defaults to YES.

processFont:withArguments:

Is called to process font when called from a ‘Filter’ custom parameter

- (void)processFont:(GSFont *)font withArguments:(NSArray *)arguments

Parameters

font

The font to process

arguments

A list of arguments

processGlyph:withArguments:

Is called to process font when called from a ‘PreInterpolationFilter’ custom parameter

- (void)processGlyph:(GSGlyph *)glyph withArguments:(NSArray *)arguments

Parameters

glyph

The glyph to process

arguments

A list of arguments

processLayer:withArguments:

Is called to process a layer when to preview a Filter custom parameter

- (void)processLayer:(GSLayer *)layer withArguments:(NSArray *)arguments

Parameters

layer

The layer to process

arguments

A list of arguments

runFilterWithLayer:error:

This method will be called if one layer is active in Edit View (the nodes are visible) Pay attention to the selection.

- (BOOL)runFilterWithLayer:(GSLayer *)layer error:(out NSError **)error

Parameters

layer

The active Layer

error

if something goes wrong, retunes an NSError by reference.

Return Value

YES if successful, otherwise NO. In the later case the error will hold a explanation.

runFilterWithLayer:options:error:

This method will be called if one layer is active in Edit View

- (BOOL)runFilterWithLayer:(GSLayer *)layer options:(NSDictionary *)options error:(out NSError **)error

Parameters

layer

a Layer

options

A dict containing some options. This might be “CheckSelection” : YES/NO.

error

if something goes wrong, retunes an NSError by reference.

Return Value

YES if successful, otherwise NO. In the later case the error will hold a explanation.

Discussion

This is actually only used for the reomve Overlap filter and might be removed when that one goes away.

runFilterWithLayers:error:

This method will be called if the hole glyph is supposed to be processed.

- (BOOL)runFilterWithLayers:(NSArray *)layers error:(out NSError **)error

setup

Glyphs will call that before the filter is invoked.

- (NSError *)setup

setupDialog:

do update the window

- (void)setupDialog:(GSDialogController *)dialog