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

RoboFontForumsHelp / GeneralSpace Center: copying the input string along with the control glyphs?

This topic has 2 voices, contains 2 replies, and was last updated by  Mathieu Christe 102 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
Author Posts
Author Posts
February 6, 2012 at 16:09 #3711

Mathieu Christe

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

February 6, 2012 at 18:15 #3714

frederik

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)
February 6, 2012 at 20:03 #3715

Mathieu Christe

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)
  • This reply was modified 102 days ago by  frederik.
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.