Coder Social home page Coder Social logo

Comments (6)

yha avatar yha commented on June 2, 2024 1

Seems like this is a librsvg issue then, so I'm closing this. Thanks for your help

from luxor.jl.

cormullion avatar cormullion commented on June 2, 2024

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:

tmp

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.

yha avatar yha commented on June 2, 2024

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.

cormullion avatar cormullion commented on June 2, 2024

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.

stale avatar stale commented on June 2, 2024

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.

cormullion avatar cormullion commented on June 2, 2024

Thanks - perhaps Rsvg.jl will get some love soon...

from luxor.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.