Comments (7)
My initial diagnostic was not the good one, the issue was more perverse! Finding attributes from parents was short-circuited when the node had a style
attribute.
from svglib.
Thanks for the report, I tracked the bug to the style
attribute of <use>
nodes not taken into account.
You might try the following patch:
diff --git a/svglib/svglib.py b/svglib/svglib.py
index 94dc293..c82e0ae 100755
--- a/svglib/svglib.py
+++ b/svglib/svglib.py
@@ -561,6 +561,7 @@ class SvgRenderer:
# Append a copy of the referenced node as the <use> child (if not already done)
node.append(copy.deepcopy(self.definitions[xlink_href[1:]]))
self.renderNode(node.getchildren()[-1], parent=group)
+ self.shape_converter.applyStyleOnShape(group, node)
getAttr = node.getAttribute
transform = getAttr("transform")
x, y = map(getAttr, ("x", "y"))
from svglib.
Thanks for fixing this. Could you give me an estimate of when you will publish a new release on pypi?
from svglib.
@deeplook is the releaser.
from svglib.
I am looking actively for some tool to help producing releases more quickly, because the less frequently I do it the more I forget about the entire process/procedure... Any suggestions are highly appreciated. I've found here and there some helpers used by some projects, but maybe I need to combine some of that.
from svglib.
Documenting the release process (for example in the Wiki, https://github.com/deeplook/svglib/wiki) could be a first step, because then people might suggest improvements/tools to improve the process.
from svglib.
Good idea. I rushed away and created this initial page: https://github.com/deeplook/svglib/wiki/Release-Process. Feel free to add to it, too...
from svglib.
Related Issues (20)
- wrong width and height attributes of drawing obj HOT 1
- Implementation error in rendering of paths with shorthand command for quadratic Bézier curves HOT 5
- Transform on clipPath does not work HOT 2
- Error when svg file contains references to font with space in its name HOT 1
- Error on install svglib HOT 2
- Reportlab 4.0.0 added dependency to pycairo HOT 3
- Error ByteIO HOT 3
- svglib fails to render properly HOT 12
- CI failure because of missing cairo HOT 9
- Using root log instead of logger HOT 3
- Units px and pt are wrong HOT 5
- Embedding SVG fonts in PDF/rlg HOT 5
- Add font size test case to test suite
- Rename default branch to main HOT 2
- Add more example and pip install commands to README.md HOT 4
- svglib doesn't remove temporary files properly? HOT 5
- Problems with embedded image sizes HOT 4
- svglib ignores <switch> nodes HOT 4
- Please share wheel file on pypi HOT 5
- Element visibility in style attribute not respected HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svglib.