When RoboFont opens a font in the interface, it needs to load data from all glyphs in the font – to render the glyph cells of the Font Overview, and to build the font’s unicode map (used when typing text in the Space Center, for example).

In the UFO format, each glyph is stored as a separate .glif file inside the UFO package; the more glyphs in a font, the more individual files need to be parsed. This is why fonts with a large amount of glyphs can have a negative impact on the speed and performance of RoboFont.

One of the ideas under consideration for UFO4 is introducing a new charactermapping.plist file to collect the font’s character → glyph name mapping. (The <unicode> element would be removed from .glif to prevent duplicate data.) Having a central character map would greatly reduce font loading time for UFO fonts.

To make the opening of large fonts faster, RoboFont has a setting to control how many glyphs are loaded when a font is first opened. The remaining glyphs can be loaded later, if required, by using the Load All Glyphs button.

Setting the maximum amount of glyphs

Use the setting Max glyph count to read instantly from disk in the Character Set Preferences to control the maximum amount of glyphs loaded when a font is opened. The default value is 2000 glyphs.

This preference is stored internally as loadFontGlyphLimit, and can also be edited with the Preferences Editor.

Opening Large Fonts warning

When opening a font which contains more glyphs than the limit defined in the Max glyph count preference, a pop-up window with a warning will appear:

Click on the OK button to close the dialog. Check the box if you don’t want RoboFont to show this message again.

If you have previously selected Don’t show this message again, and wish to undo this choice: go to the Miscellaneous Preferences and click on the button Reset warnings.

Loading All Glyphs

When a font containing more glyphs than the Max glyph count limit is opened, a small button labeled Load All Glyphs will appear at the bottom left of the Font Overview window:

Click the Load All Glyphs button to force RoboFont to load data from all glyphs in the font.

Simple font window

Another approach for dealing with fonts with a large amount of glyphs is using a simplified font window. Instead of the usual Font Overview interface with glyph cells, we can use Python to create a simpler (and faster) font window in which the glyphs overview is a simple list of glyph names.

Double-click a glyph name to open a Glyph Editor for that glyph.

from AppKit import NSURL, NSDocumentController
from vanilla import Window, List
from defconAppKit.windows.baseWindow import BaseWindowController
from lib.doodleDocument import DoodleDocument
from mojo.UI import OpenGlyphWindow, OpenSpaceCenter, OpenFontInfoSheet

class SimpleFontWindow(BaseWindowController):
    
    def __init__(self, font):
        
        self._font = font
        
        if font.path:
            document = DoodleDocument.alloc().init()
            document.setFileURL_(NSURL.fileURLWithPath_(font.path))

            dc = NSDocumentController.sharedDocumentController()
            dc.addDocument_(document)
        
        self._canUpdateChangeCount = True
        
        self.w = Window((250, 500), "SimpleFontWindow", minSize=(200, 300))
        
        glyphs = font.keys()
        glyphs.sort()
        
        self.w.glyphs = List((0, 0, -0, -0), glyphs, doubleClickCallback=self.openGlyph)
        
        toolbarItems = [
                dict(itemIdentifier="spaceCenter",
                     label="Space Center",
                     imageNamed="toolbarSpaceCenterAlternate",
                     callback=self.openSpaceCenter
                     ),
                dict(itemIdentifier="fontInfo",
                     label="Font Info",
                     imageNamed="toolbarFontInfo",
                     callback=self.openFontInfo
                     )
                ]
        self.w.addToolbar(toolbarIdentifier="SimpleToolbar", toolbarItems=toolbarItems)
        
        windowController = self.w.getNSWindowController()
        windowController.setShouldCloseDocument_(True)
        self._font.UIdocument().addWindowController_(windowController)
                
        self._font.addObserver(self, "fontChanged", "Font.Changed")

        self.setUpBaseWindowBehavior()
        self.w.open()
    
    def openGlyph(self, sender):
        sel = sender.getSelection()
        if sel:
            i = sel[0]        
            name = sender[i]
            self._canUpdateChangeCount = False
            OpenGlyphWindow(self._font[name])
            self._canUpdateChangeCount = True
                
    def openSpaceCenter(self, sender):
        self._canUpdateChangeCount = False
        OpenSpaceCenter(self._font)
        self._canUpdateChangeCount = True
    
    def openFontInfo(self, sender):
        self._canUpdateChangeCount = False
        OpenFontInfoSheet(self._font, self.w)
        self._canUpdateChangeCount = True
    
    # notifications
    def fontChanged(self, notification):
        if self._canUpdateChangeCount:
            self._font.UIdocument().updateChangeCount_(0)
    
    
fonts = OpenFont(showInterface=False)
if not isinstance(fonts, list):
    fonts = [fonts]

for font in fonts:
    SimpleFontWindow(font)

Last edited on 08/09/2018