@frederik thank you
It worked great now:
x, y = 500, 500
resolutions = [72, 18]
mfont = '/Library/Application Support/Adobe/Fonts/SansNom-Regular.otf'
installFont(mfont)
font(mfont)
print(listFontGlyphNames())
letters = ['n', 'E']
def pixelar(tx, t, al=True):
newPage(x, y)
path = BezierPath()
path.text(tx, fontSize=500, font=mfont)
coords = path.bounds()
translate((x - (coords[0] + coords[2])) * 0.5, (y - (coords[1] + coords[3])) * 0.5)
drawPath(path)
saveImage('~/Desktop/hint_{0}_{1}_aal_{2}.png'.format(tx, t, str(al).lower()), imageResolution=int(t), antiAliasing = al)
newDrawing()
for letter in letters:
for resolution in resolutions:
pixelar(letter, resolution, False)
pixelar(letter, resolution)