Hi Folks, newbie with a problem! first time Inkscape user and having problems importing SVG’s. They import fine but don’t display correctly and can’t figure out why, spent hours googling and playing around but can’t figure it, as I say new to Inkscape and to some extent SVG’s so this could be an easy fix I’m missing?! It’s easier to see so uploaded the file and some screen shots but basically not all the SVG image appears – Tried all the ‘Image Import Types’ and ‘Views’ and it works fine when viewed with Google. The SVG was created in VS Code (ver 1.88.1) in JS (SVG, SvJs) and saved from VS Code. Inkscape ver is 1.3.2 (091e20e, 2023-11-25, custom) and using Win 11. Like I say probably just a newbie missing the obvious but be grateful for any ideas/help.
If you open xml editor, you can see that each element has a fill or stroke coded in HSL in a fashion that inkscape doesn't recognize : inkscape then considers the stroke as unset.
I don't have any skill in coding, but to me, HSL values have to be translated into RGB values and fill and stroke have to be gathered in a style attribute to be read by inkscape.
I was sent here because I have the opposite problem: Xcode (and consequently, the Apple SDKs for iOS, macOS etc) will not honor the `style="fill`, but only the `fill` attribute. When editing an existing file, Inkscape will not remove and not update a `fill` attribute where present, but simply add the `style`attribute.
You can find more info in the original thread, and in a GitHub repo describing the issue in great detail.
It would be great if there was some solution to this, I am certain a lot of iOS and macOS developer would appreciate!
Hi, just got a chance to take a look and thanks for the Extension !
Think i'm getting somehwhere...., the extension has worked on one SVG but not another tho not sure i'm using it correclty ? am just opening the SVG file and applyin the extension to all elements > convert to style and if that doesnt work attributes ? Like i said newbie ! am not manually selecting anything, is this right ?
Ok, i get it now, looking at the output after running the extension it is doing that, i'll have a look at what else is being generated that could be screwing things up - thanks again, much appreciated !
Hi Folks, newbie with a problem! first time Inkscape user and having problems importing SVG’s. They import fine but don’t display correctly and can’t figure out why, spent hours googling and playing around but can’t figure it, as I say new to Inkscape and to some extent SVG’s so this could be an easy fix I’m missing?! It’s easier to see so uploaded the file and some screen shots but basically not all the SVG image appears – Tried all the ‘Image Import Types’ and ‘Views’ and it works fine when viewed with Google. The SVG was created in VS Code (ver 1.88.1) in JS (SVG, SvJs) and saved from VS Code. Inkscape ver is 1.3.2 (091e20e, 2023-11-25, custom) and using Win 11. Like I say probably just a newbie missing the obvious but be grateful for any ideas/help.
If you open xml editor, you can see that each element has a fill or stroke coded in HSL in a fashion that inkscape doesn't recognize : inkscape then considers the stroke as unset.
I don't have any skill in coding, but to me, HSL values have to be translated into RGB values and fill and stroke have to be gathered in a style attribute to be read by inkscape.
Agree.
The VS generator could possibly be set to output inline styles or css classes.
otherwise, I'd ask the devs on the chat if there is an option to read and convert the fill and stroke properties to inline styles.
https://chat.inkscape.org/channel/team_devel
Thanks Guys, thats really helpful, appreciate it.
Will delve further over weekend.
Is
fill="hsl(231 80% 80% / 29%)"
Supposed to be
fill="hsl(231 80% 80%)"
fill-opacity="29%"
?
If you want to correct this in Inkscape rather than in the original program:
Here is a starting point. (Zipfile attached)
An extension, appears under
Extensions>hsl format correction
Brilliant work! 👏
I was sent here because I have the opposite problem: Xcode (and consequently, the Apple SDKs for iOS, macOS etc) will not honor the `style="fill`, but only the `fill` attribute. When editing an existing file, Inkscape will not remove and not update a `fill` attribute where present, but simply add the `style`attribute.
You can find more info in the original thread, and in a GitHub repo describing the issue in great detail.
It would be great if there was some solution to this, I am certain a lot of iOS and macOS developer would appreciate!
I'll have a look.
I did write something a while ago ( bipper is my old username ) in javascript to do exactly the opposite :)
https://inkscape.org/~bipper/★attributes2style
Hi, just got a chance to take a look and thanks for the Extension !
Think i'm getting somehwhere...., the extension has worked on one SVG but not another tho not sure i'm using it correclty ? am just opening the SVG file and applyin the extension to all elements > convert to style and if that doesnt work attributes ? Like i said newbie ! am not manually selecting anything, is this right ?
I suppose it depends upon the type of output being generated by the third party software.
The example I posted converts
fill="hsl(231 80% 80% / 29%)"
to fill="hsl(231 80% 80%)" and fill-opacity="0.29"
If there are different types of output being generated, you would have to write a function to handle each case
Ok, i get it now, looking at the output after running the extension it is doing that, i'll have a look at what else is being generated that could be screwing things up - thanks again, much appreciated !