`text` property `shape-inside` not respected
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- computer-graphics
Research direction
Start with CairoSVG's svg2png entry point and the supplied SVG, focusing on text element id="text3173" and rect id="rect1344". Reproduce the rendering with the shown Python call and compare it with the expected Inkscape output. Done means text using shape-inside wraps within the rectangle instead of bleeding off the page.
Written by the indexing model from the issue text.
Description
Problem
My <text> element's shape-inside property is being ignored when I svg2png using cairosvg. https://cairosvg.org/svg_support makes no mention of shape-inside. The shape-inside feature is described here.
What I expected
The text of the At the end of the Round ... Break ties in your favor if... text to wrap before it goes off the card, like so (this is what Inkscape renders and exports):
What occurred
The text is not inside the rect and bleeds off the page.
Repro:
- Download the svg file below
pip install cairosvgpython package- Create and run the following python code:
from cairosvg import svg2png
svg2png(
url="path/to/svg",
write_to="path/to/desired/png",
dpi=300,
output_width=825,
output_height=1125)
Here is my svg file, you can see that Github/Chrome is observing shape-inside:
You can right click it and download it.
The text element in question is id="text3173" and it shape-inside's rect element id="rect1344". Here's rect 1344 if it was visible:
XY Problem Considerations
The svg's are programmatically generated, so I cannot add newlines manually. The text input changes frequently and so the newlines would change frequently. The person responsible for creating the card's rules has no idea the width of the text area and ideally never will have to. I would love to avoid baking newlines that aren't related to emphasis into my card rules.
Currently, I call os.system("inkscape input.svg --export-filename=output.png --export-dpi=300") within my python program in order to render my svgs.
This isn't ideal because this requires my users to have Inkscape installed. I believe an entirely python solution is superior to a python package that requires a separate non-python program. I believe cairosvg may be a good Inkscape replacement if cairo supports text wrapping. So far, svglib and wand have the same issue, but their output has other problems on top of not wrapping text.
- Dominant language
- Python
- Stars
- 959
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Kozea/CairoSVG
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
并发下的渲染表现Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Exception "The SVG size is undefined" raised using svg2pngPossibly taken @DSeaStar claimed this 111 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
feature
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Techiebutler/freeframe#687 ·
Maintainers usually reply within 1 day
-
bug verbose GC
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
IBM/javacore-analyser#677 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 2 days
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#163932 · 1 comment ·
Maintainers usually reply within 1 day
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's filePossibly taken @Beehtrix claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#907 · 1 comment ·
Maintainers usually reply within 1 day