GlyphsFileFormat Protocol Reference
Tasks
-
font
property required method -
– writeFont:error:
required method -
– writeFont:toURL:error:
required method -
– fontFromURL:ofType:error:
required method -
groupID
property required method -
toolbarTitle
property required method -
toolbarIconName
property required method -
– importFile:fromURL:error:
-
– cancelExport
Properties
font
The GSFont object is assigned the the plugin prior to the export.
@property (assign, nonatomic) GSFont *font
Discussion
This is used to publish the export dialog.
groupID
The group ID defines the position of the exporter in the toolbar of the export window.
@property (readonly) NSUInteger groupID
Instance Methods
fontFromURL:ofType:error:
Reads a Font object from the specified URL.
- (GSFont *)fontFromURL:(NSURL *)URL ofType:(NSString *)Type error:(out NSError **)error
Parameters
- URL
The URL to read the font from.
- Type
The UTI of the document
- error
On return, If the document contents could not be read, a pointer to an error object that encapsulates the reason they could not be read.
Return Value
The font object, or nil if an error occurred.
importFile:fromURL:error:
Import some Data into the existing Font object
- (BOOL)importFile:(GSFont *)Font fromURL:(NSURL *)URL error:(out NSError **)error
Parameters
- Font
an existing, already open Font
- URL
the file to import from
- error
on return
Return Value
True if success, False if failure
writeFont:error:
Outputs a Font object.
- (BOOL)writeFont:(GSFont *)Font error:(out NSError **)error
Parameters
- Font
The font to export.
- error
On return, If the document contents could not be read, a pointer to an error object that encapsulates the reason they could not be read.
Return Value
YES if the operation was successful; otherwise, NO.
Discussion
This function should ask the user for the place to save the store the font.
writeFont:toURL:error:
Outputs a Font object to the specified URL.
- (BOOL)writeFont:(GSFont *)Font toURL:(NSURL *)URL error:(out NSError **)error
Parameters
- Font
The font to export.
- URL
The URL to save the font to.
- error
On return, If the document contents could not be read, a pointer to an error object that encapsulates the reason they could not be read.
Return Value
YES if the operation was successful; otherwise, NO.