Proofs using python


#1

Hello.

I’m lately thinking about using Drawbot (plugin) to generate proofs of the current font I’m working on and I was wondering which could be the best option to get the paths of a specific layer and draw them without having to export and install the font. Something like a pen object that would get each path’s coordinates to draw them.

Thank you so much.


#2

something like is:

drawPath(layer.bezierPath)

should work. You need to do the layout yourself.


#3

Great! Thanks a lot again, Georg!


#4

Also, since I’m iterating through all of the layers in font’s selection, is there a way to get only the frontmost layer of each master? Now I’m getting also the copies that I’ve made during the process and I would like to draw only the ones that are currently used by each master.

Thanks.


#5
layer = glyph.layers[master.id]

#6

Thank you so much Georg, this worked pretty well. Since this is a proof that I’m preparing for selected glyphs in current font, some of them are build our of components (f.e.: accented characters) but apparently it is not drawing them probably because they are not understood by the program as “paths”. How could I draw them?

Thanks!


#7

I’ve found it, thanks still!


#8

It should be Layer.drawBezierPath


#9

It worked even better than I did. Thanks a lot, Georg.