Random mixing of glyphs

Hello!

I have a monospaced font and I’m experimenting.
I want to randomly (or in a special way) change the glyphs in places and compile a new font.

For example: I chose a font - ran a script / extension - it shuffled the glyphs randomly and saved it in ttf/otf.

Tell me, are there any plugins/extensions/scripts that allow you to do this?

Thanks!

Hi @Kirill ,
What do you mean by “shuffled”?
Do you mean, that e.g. if you hit “a” key on your keyboard, some other character will be returned (let say “&”)?

Hi
Yes! I would like to shuffle all the characters in the font and save them in ttf/otf.
When I install the font, all the letters will be mixed up, I press " a " - a on the screen “&”…
I need a program or script /extension or something similar to do this quickly.

Try running this in the macro panel, should generate a new instance with randomized glyphs custom parameter (which you can then copy to any other instance):

from random import choice
font = Glyphs.font

newInstance = GSInstance()
newInstance.name = 'Randomized'
font.instances.append(newInstance)

glyphNames = []
for glyph in font.glyphs:
	glyphNames.append(glyph.name)

renameGlyphs = []
for i in range(len(font.glyphs)):
	if len(glyphNames) > 1:
		glyph1 = choice( glyphNames )
		glyphNames.remove( glyph1 )
		glyph2 = choice( glyphNames )
		glyphNames.remove( glyph2 )
		renameGlyphs.append( glyph1 + '=' + glyph2 )
	else:
		break
#print(renameGlyphs)
newInstance.customParameters[ 'Rename Glyphs' ] = renameGlyphs
1 Like

Thanks @alexs !
I running this in the macro panel:
All the characters are mixed up, it’s good! ( Bebas Neue Regular font test)
But on the preview, the font is the same and is exported as a normal font, without mixing glyphs.
How can I export a mixed font to otf format?

Updated a little bug in the script, try re-copy it

In the instances, you get this Rename Glyphs custom parameter, just copy it to any instance you want and export it as usual (your can then remove the Randomized instance itself).

image

@alexs - incredible. It works!)))
Respect to you, man!
Thank you!
I will test.