Single Window Mode + separate font overview

RoboFont Forums Help / General Single Window Mode + separate font overview

This topic contains 3 replies, has 2 voices, and was last updated by  Thom 4 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6277

    Thom
    Participant

    Is it possible to open a separate font overview window? :)

    Cheers Thom

    #6278

    frederik
    Keymaster

    You will have to write a tiny script that takes a font and creates a new window with a glyph collection view. Any double click could then open a glyph window.

    Could you elaborate why you would need a second (or multiple) font overviews?

    I can make you an example, if you wish…

    #6280

    Thom
    Participant

    I want the glyph collection view on a second screen. And all the rest on the main screen. :)

    I would like an example. Many thanks Frederik!

    Thom

    #6281

    Thom
    Participant

    I have this… But it is buggy. See if you scroll. If you change a glyph the factory doest work, only after scrolling/clicking on the overview.. Here I need a bit help :)

     
    from vanilla import *
    from defconAppKit.controls.glyphCollectionView import *
    from defconAppKit.windows.baseWindow import BaseWindowController
    from mojo.UI import SetCurrentGlyphByName
    
    class MyFont(BaseWindowController):
    	def __init__(self, glyphs):
    		self.w = Window((900,600), "")
    		self.w.collectionView = GlyphCollectionView((15, 15, -15, -65), doubleClickCallback=self.double, cellRepresentationName='doodle.GlyphCell')
    		self.w.collectionView.setCellSize((100, 100))
    		self.setUpBaseWindowBehavior()
    		
    		self.w.collectionView.preloadGlyphCellImages()
    		self.w.collectionView.set(glyphs)
    		self.updateTitle()
    		self.w.open()
    		
    	def updateTitle(self):
    		title = f.info.familyName +" - "+ f.info.styleName+",  "+ str(CurrentGlyph())
    		self.w.setTitle(title)
    		
    	def double(self, sender):
    		order = f.lib.get('public.glyphOrder')
    		SetCurrentGlyphByName(order[self.w.collectionView.getSelection()[0]])
    		self.updateTitle()
    
    f = CurrentFont()
    g = CurrentGlyph()
    glyphs = []
    for g in f.lib.get('public.glyphOrder'):
    	glyphs.append(f[g])
    
    MyFont(glyphs)
    
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.