SOLVED Access current glyph collection view externally

  • Is there a way to capture the current doodleGlyphCollectionView without an observer like glyphCollectionDraw? I'd like to manipulate the glyph collection with a button somewhere. Is there something like CurrentGlyphCollectionView?


  • It was a dig but I got it, in case anyone is following (and sorry for abusing the Robofont UI so much, Frederik):

  • This does most of the job, but leaves those two bottom left buttons, which I can't track down.

    from mojo.UI import CurrentFontWindow
    fo = CurrentFontWindow().fontOverview
    # gradient layer on bottom bar and any subviews
    # line of text showing what glyphs were selected
    # glyph cell size slider
    # remove bottom bar (negative space) by changing glyph collection area to full size

  • Just a quick piggyback (sorry), is there a way to get CurrentFontWindow() to work? I would love to add that to this gist: My small laptop screen thanks you in advance.

  • This is all exactly what I needed, thanks for your patience @frederik @gferreira

  • admin

    A fontOverview has a statusBar which is a vanilla group.

    But be careful: RoboFont post messages in the statusbar, like glyph selection count, ...

  • Thanks!

    Last question on this now that I see the old thread—anyway to solve for Single Window Mode? Would love for the button to be just below the Font Overview, but subscribing to fontWindowWillOpen seems to anchor it to the whole window. This probably works well for the font overview in Multi-window Mode, but in SWM it's at the very bottom left. (see on top of the layout option buttons)


    The only observer I see firing when Font Overview is opened is glyphCollectionDraw. In my mind, even after I capture the window corresponding to the view: CurrentFontWindow().fontOverview.getGlyphCollection().getGlyphCellView()... I'd need to have an observer for when the Font Overview panel is hidden, so I could then hide the button.

    Hope this makes sense.

  • no time wasted :) I will add this example to the docs, so it’s easier to find next time. thanks!

  • Gah, of course I would completely forget that I've asked this before. Apologies for wasting time!

  • hi @ryan have a look at this example (not sure if this is what you mean)

  • Perfect, thanks Frederik!

    Is there an easy way to insert a button at the bottom of glyph collection? I've tried some things, but wondering if it would require a fontOverviewWillOpen or something of the like. Perhaps addSubview_()?

  • admin

    multiple ways to access it:

    from mojo.UI import CurrentFontWindow
    v = CurrentFontWindow().fontOverview.getGlyphCollection()
    # or
    v = CurrentFont().document().getGlyphCollection()

Log in to reply