Space Center: copying the input string along with the control glyphs?



  • I can't find a way to copy the text I'm looking at, control glyphs + text string, in the Space Center. I'd like to, for proofing it in another application, say InDesign.

    Thanks for the guidance, best, M


  • admin

    you could get them similar like what happens inside a Space Center

    from mojo.UI import CurrentSpaceCenter
    
    ## get the current space center
    spaceCenter = CurrentSpaceCenter()
    
    ## get the pre glyphs as a list of glyph names
    pre = spaceCenter.getPre()
    ## get the input glyph names
    glyphs = spaceCenter.get()
    ## get the after glyphs as a list of glyph names
    after = spaceCenter.getAfter()
    
    ## join them all together in one big list
    allGlyphs = []
    for g in glyphs:
        allGlyphs.extend(pre)
        allGlyphs.append(g)
        allGlyphs.extend(after)
    
    ## print them nicely
    print " ".join(allGlyphs)
    


  • Thanks a lot, it does the trick.

    Note to users: ## print them nicely means with a wordspace between each glyph. For proofing, I need to get rid of the space, so I simply removed it between the quotes:

    print " ".join(allGlyphs) → print "".join(allGlyphs)