previewHeight stopped working



This script used to work until two updates ago…

import GlyphsApp
Font = Glyphs.font

frameHeight = 160

Glyphs.defaults["GSPreviewHeight"] = frameHeight
for eachTab in Font.tabs:
	eachTab.previewHeight = frameHeight

It now doesn’t do anything :frowning: Please advise.


I’ll fix it.

I needed to change the view structure to fix performance. There are a few things like this that broke.


@GeorgSeifert do you have a log of things that change?
My plugins start to make weird things and it’s hard to find what’s happening.

The Variable Font plugin has a dragging function for resizing and it doesn’t work in 1184 anymore :slight_smile:

I can fix it for newer Glyphs versions, I found the problem in this cascade:
Which is a NoneType now. How can I access the same thing now?


I moved the editview out of the scroll view. What do you need the scrollview for?
This should work:


But be careful, this only works in 1186 and later.


Ah okay, thank you. I will check why I needed the ScrollView. I guess it had a reason :slight_smile:

How can I access the previewHeight in objective-c? The pythonic one works, but in Xcode I cannot get further than
[[doc windowControllers] firstObject];

Thanks so much, and sorry for nagging :slight_smile:


Same wording as the pyobjc phrase does not work?


The document doesn’t have a windowController , I can only find windowControllers , so I call the firstObject on that one. Then I can only get to .contentViewController and then I get stuck. Also because i’m half new to obj-c

Hier ist Schluss: [[doc windowControllers] firstObject].contentViewController :upside_down_face:

I know it’s messy, just starting to wrap my head around it


The document has a windowController. It is just missing from the header you are using.
This is equivalent:

[[[[Doc windowController] activeEditViewController] frameView] enclosingScrollView];

You might need to add this:

@interface GSDocument (private)
- (GSWindowController *)windowController;
[[[[(GSDocument* )Doc windowController] activeEditViewController] frameView] enclosingScrollView];

But again, there might be a better way to do this.


Okay, thank you so much! I’ll try to fix/remove that scrollView thing. Thanks for the little lesson :slight_smile:
I start to see some light at the end of the tunnel


Ok thanks, the reason why I had this script is because every time I open glyphs app, it opens the preview panel really really big, and all the tabs are inconsistently sized.


I tried these things, but it says GSDocument is an undefined class. There’s no header for GSDocument.


How can I get this to work? I added this in the implementation file, but there is no GSDocument header available, so it doesn’t recognise it as a class.
Unfortunately I cannot do anything properly what I am trying without getting the frameView and hopefully all its methods like position of active layer in view and such :slight_smile:


Then do

@interface NSDocument (private)
- (GSWindowController *)windowController;


Thanks. It still complains:

- (GSWindowController *)windowController; <-- "Expected a type"

I got the GSWindowControllerProtocol.h imported, if that would be a question.


Then this:

@interface NSDocument (private)
- (NSWindowController<GSWindowControllerProtocol> *)windowController;


Ha! There we go. Thank you sooooo much! :smiley:
With these little pieces I learn enough to hopefully not nag you so much.


Still not working :confused:

Am I missing some update somewhere? Is Xcode Version 9.3.1 (9E501) not ok? I just recently downloaded the SDK templates. Latest changes there are 3 months old.

When I do this:

@interface NSDocument (private)
- (NSWindowController<GSWindowControllerProtocol> *)windowController;

I still cannot access GSDocument, hence [(GSDocument* )Doc windowController] is not possible.

So I also tried:

NSViewController *frameView = [[[NSApp currentFontDocument] windowController] activeEditViewController];

But this doesn’t have a frameView. It then says: No visible @interface for ‘NSViewController’ declares the selector ‘frameView’

Suddenly I cannot build, because the GlyphsCore.framework is gone (marked red in Xcode). How can I get it back?


The plugins reconfigured to find the framework in /Applications/


The @interface makes the compiler believe that NSDocument has a ‘windowController’ method. Actually GSDocument (a subclass of NSDocument is implementing it) but in the end nobody cares. So you need to remove the ‘(GSDocument*)’ (or use NSDocument).


WOW, thanks for the info!
You know what? I had 5 Glyphs Versions and none of them had the name “Glyphs” anymore because I added the build number to the file name. Yesterday I removed the last Glyphs version with the entire name being only “Glyphs”. Now the framework is back after I added a copy with the same name.