Comments (6)
Seems like this is a librsvg issue then, so I'm closing this. Thanks for your help
from luxor.jl.
Hi!
All the SVG handling is provided by Rsvg.jl, so if there are any problems, it's either a limitation of librsvg
, a bug in Rsvg.jl, or a bug in how Luxor.jl calls Rsvg.jl. At the moment, it's difficult to say where the error might be. I'm not sure how well Rsvg handles fonts that are not embedded, but mentioned by name...
If you can't reproduce the error with Rsvg.jl, it will be something that can be investigated in Luxor.jl.
As for the whole fonts issue, it's very dependent on which platform you're on, which OS version, your font management, fontconfig settings, whether you use the Toy or Pro APIs, etc. For example, on my MacOS machine, your code gives:
For some reason, Impact doesn't want to appear here, with the Pro API, although:
using Luxor
@draw begin
fontface("Impact")
fontsize(200)
text("Impact")
end
finds and draws Impact. I suspect fontconfig on MacOS, but I'm not too sure.
from luxor.jl.
If you can't reproduce the error with Rsvg.jl, it will be something that can be investigated in Luxor.jl.
I tried Rsvg+Cairo, and the result is consistent with Luxor.
But I couldn't get either to simply transform the text elements from the svg as necessary without rendering them, which should have avoided the issue.
I'm basically trying to use Luxor as a kind of programmatic SVG editor, combining different SVGs in various ways, and maybe drawing some simple shapes on top. I don't need it to do any rendering at all (like conversion of text to paths). Maybe Luxor/Cairo is not the right tool for that?
In any case, I have two different workarounds for now: working on a Linux machine, where I don't see these font issues, at least for Impact and Georgia. Or going the opposite route and converting all text to paths (using Inkscape CLI) before using them in Luxor.
from luxor.jl.
Maybe Luxor/Cairo is not the right tool for that?
Possibly not ... 🤷♂️ Cairo, Rsvg, Cairo.jl, and Rsvg.jl all have their limitations, particularly in font-handling, and Luxor will simply inherit all those limitations. It would be a major undertaking to add reliable platform-independent font handling, or to add better SVG interpreting... I think librsvg has or had a reputation of being quite buggy - but to be honest I think all SVG interpreters might have some compatibility issues, unless written by Adobe...
Purely graphical SVGs seem to work to some extent, but we can't output font information in SVG anyway (although PDF output is better...).
If there's nothing to change in Luxor.jl, feel free to close this issue -and good luck with your work!
from luxor.jl.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from luxor.jl.
Thanks - perhaps Rsvg.jl will get some love soon...
from luxor.jl.
Related Issues (20)
- Release 3.8.0 HOT 2
- MethodError: objects of type String are not callable HOT 3
- Update sethue() and setcolor() to accept Nothing arguement HOT 2
- Source code for how to create a graph for inclusion in Luxor Documentation HOT 7
- Drop dependencies like FFMPEG (in the long run)? HOT 6
- You can't just "Plot a pixel on the screen" HOT 3
- Remove dependency on Juno.jl HOT 3
- SVG with transparent background HOT 2
- transparency does not work for background color in svg HOT 2
- clip() using lines or boxes does not return an output HOT 2
- set_next_drawing_index` not defined HOT 3
- Time to release v4? HOT 5
- A 1x1 box is semi-transparent HOT 4
- Running @draw in a loop HOT 2
- Julia v1.11 internal changes HOT 2
- Add noindex and banner to older version documentations HOT 1
- Inconsistent behavior around tolerances in `isequal` and `isless` HOT 5
- Release 4.0 HOT 1
- Windows test failure because of Cairo_jll HOT 2
- Incorrect LaTeX rendering HOT 7
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 luxor.jl.