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

RoboFont Forums Help / General Space Center: copying the input string along with the control glyphs?

This topic contains 2 replies, has 2 voices, and was last updated by  Mathieu Christe 8 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3711

    Mathieu Christe
    Participant

    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

    #3714

    frederik
    Keymaster

    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)
    
    #3715

    Mathieu Christe
    Participant

    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)
    
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.