Open pozitron57 opened 6 months ago
4c1a8f8 made some improvements to bounding box calculations that should help when there is text falling on the border, but only when text is drawn as paths (also requires new ziafont and ziamath commits). Using d.config(margin=0)
works to remove white space in many cases, but won't be perfect for example with the following two cases.
If text is drawn as svg
There are other situations where the bounding box won't be perfect, such as when a Bezier curve control point extends the box - it doesn't distinguish between actual and control points. Inkscape is probably smarter about tracing the actual curve path when cropping.
Thanks. Quick note:
When the right resistor has label there is a whitespace at right (placed with elm.Resistor(l=0).label('$R$', loc='right')
).
Without a label, margin=0
works well at the right edge:
I already wrote about whitespace in svg in #6, but I need zero whitespace. Here is the function I use to remove all the whitespace from svg files generated by SchemDraw:
It is not optimal as there is need for Inkscape installation. Nevertheless I'd like SchemDraw to allow for this usage, something like
d.save('filename.svg', crop=True)
. It works for all my plots, but the elements I use are limited to a little part of basic elements, hence more testing might be necessary.