As the title says.
https://github.com/schriftgestalt/GlyphsSDK/tree/Glyphs4/XcodeTemplates/Glyphs%20Dev
As the title says.
https://github.com/schriftgestalt/GlyphsSDK/tree/Glyphs4/XcodeTemplates/Glyphs%20Dev
The templates are updated for Glyphs 4. (Your link misses a space)
I got clone Glyphs4 Glyphs Dev create a new project,I see Build Setting stll is ‘Glyphs 3’ in
![]()
Is it wrong that I cloned it?
There are some bits that I missed. I fixed it (among some more issues).
In Glyphs 4, use the umbrella headers instead:
#import <GlyphsCore/GlyphsCore.h>
Or directly as:
@import GlyphsCore;
No need to import the individual headers of each framework.
Thanks,Another problem has come up:
I’m making a Palette plugin for G4. I added .h and .m file from another project, but after adding them, PaletteView doesn’t show up in G4. If I delete these two files, the view shows up again. I even tried creating new files with the same file names, but the same problem still happens. What could be causing this?Turns out I also ran into this back in G3.
Only after I delete these two files, create new files with file names I haven’t used before, and then re-import these two files, sometimes the view can show up in G4 again.Does Glyphs have any caching or mechanism?
I answered it in the message you send: It was a problem with the info.plist generation. This has to be set in Build settings: INFOPLIST_KEY_NSPrincipalClass = MyClassName (MyClassName has to be the actual plugin class, of cause).
In gG4, After changing the macro panel to the script panel, will the printToMacro([[NSApp delegate] performSelector:@selector(printToMacro:) withObject:@"1";])output information no longer be visible?
Or are just these few interfaces in this header file deprecated?
I fixed it.
What do you mean?
1、Here’s another question: has those API been deprecated? Between #if 0 and #endif.
2、There’s one more question:
This function for adding menus isn’t working anymore.
in G4
- (void)addMenuItemsForEvent:(NSEvent *)theEvent controller:(GSEditViewController *)controller toMenu:(NSMenu *)theMenu;
this is G3:
- (void)addMenuItemsForEvent:(NSEvent *)theEvent controller:(NSViewController<GSGlyphEditViewControllerProtocol> *)controller toMenu:(NSMenu *)theMenu
I have the following registration callback function.The right-click menu works fine in G3, but it doesn’t execute in G4.
[GSCallbackHandler addCallback:self forOperation:GSDrawBackgroundCallbackName];
and
- (void)drawBackgroundForLayer:(GSLayer *)layer options:(NSDictionary *)options{}
3、also,In G4, using GSFormatVersionCurrent for the format gives the wrong result. When I changed it to GSFormatVersion3, it worked correctly.
NSData *glyphsDataCurrent = [GSLayer layerDataFromDict:relationLayer.selectedObjects format:GSFormatVersion3 error:nil];
NSDictionary *pathDict = [NSPropertyListSerialization propertyListWithData:glyphsDataCurrent options:0 format:nil error:nil];
[targetLayer pasteDict:pathDict format:GSFormatVersion3 selectedNodes:nil error:nil];
4、I used to define these two methods myself in @protocol GSApplicationPluginProtocol and wrote them there, but G4 now has the GSApplicationPluginProtocol.h file, and the two methods I defined no longer work. How should I redefine these two methods?
@protocol GSApplicationPluginProtocol <NSObject>
- (void)showAlert:(NSString *)title message:(NSString *)message OKButton:(nullable NSString *)OKButton;
- (GSDocument *)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)display;
@end
They have been removed. Did you use those methods? What for?
You need to add a GSContextMenuCallbackName now.
Did you use GSFormatVersion3 in both places? If so, can you send me the file where this doesn’t work.
But why do you need to run it through the Serialization?
The document method should still work. The showAlert method got more arguments. As an undocumented method, that can happen. It is easy enough to set up an NSAlert yourself.
And I would not do that with a protocol but like this:
@interface NSApplication ()
- (NSModalResponse)showAlert:(NSString *)title message:(NSString *)message OKButton:(NSString *)OKButton cancelButton:(nullable NSString *)cancelButton otherButton:(nullable NSString *)otherButton;
- (NSDocument *)openDocumentWithContentsOfURL:(NSURL *)absoluteURL display:(BOOL)displayDocument;
@end
like this
I also want copy shapes with hints. It’s not that it doesn’t work, what I mean is that using GSFormatVersion3, the pasted outline is correct. If it’s GSFormatVersionCurrent, the path can be pasted too, but it’s wrong.
Could you give me some sample data that shows this?
I sent you a message on the site.