Matplotlib export text as line elements in Python -
I have to build some basic CAD tools in Python, which is based on So far, I have all the original mimosetic stuff, but I can not understand how to implement the text correctly. To use different fonts, etc. I want to use the text capabilities of matplotlib, but I can not find any way to export text properly from matplotlib. Is there any way to get a vector output now? Or an array of at least plotted text? After a few days of conflict, I found a way to get the outline of text: a more accurate example If you have a vector If you want to get the outline as the array, then you can remove everything after line 78 and do this: This will give you an array of polygons, and each polygon again an array of points (x, y) of a polygon. Although there was some problem for running the Fitipip on windows, and I still do not know how to make it portable, I think I will be with this solution because it is fast, trustworthy and Allows one to use all good system fonts. matplotlib . After all the parts are put together, the entire layout will be exported as line elements (basically the tuples of start / end coordinates of bus lines, such as [x1, y1, x2, y2]) and bus points.
path = path (VERTS, CODES) outline = path.to_polygons ()
Comments
Post a Comment