Replies: 10 comments 1 reply
-
Hi, Hope that you doing fine, Could you have a look at this issue please |
Beta Was this translation helpful? Give feedback.
-
Interesting, are those working in chrome? Not sure if those things are supported by svg specification. Need to investigate. |
Beta Was this translation helpful? Give feedback.
-
Initially I've used svg. Net and the output is correct.
It's supported by svg and is working under Chrome.
I've moved my project under svg. Skia and I've seen the described mismach
If I can help, please let me know
Amael
Le ven. 17 juin 2022 à 9:05 PM, Wiesław Šoltés ***@***.***> a
écrit :
… Hi,
Currently using the SvgColourServer to define the stopColor of fill color
There is a issue in the SvgGradientStop StopColor and fill when it is a
text color (white, bleu, black...)
Missing the rbg( ) for stop-color and the single quote should be removed
when text color is used (white)
It is translated as
<linearGradient x1="1px" y1="0.2px" x2="1" y2="1" id="filter_1_opacity">
<stop offset="0%" stop-color="36, 199, 201" stop-opacity="0" />
<stop offset="100%" stop-color="'White'" stop-opacity="1" />
</linearGradient>
<mask id="filter_1">
<rect x="0px" y="0px" width="1080" height="225" style="fill:url(#filter_1_opacity);" />
<rect x="0px" y="225px" width="1080" height="604" opacity="1" style="fill:'White';" />
</mask>
instead of
<linearGradient x1="1px" y1="0.2px" x2="1" y2="1" id="filter_1_opacity">
<stop offset="0%" stop-color="rgb(36, 199, 201)" stop-opacity="0" />
<stop offset="100%" stop-color="white" stop-opacity="1" />
</linearGradient>
<mask id="filter_1">
<rect x="0px" y="0px" width="1080" height="225" style="fill:url(#filter_1_opacity);" />
<rect x="0px" y="225px" width="1080" height="604" opacity="1" style="fill:White;" />
</mask>
```
Thanks in advance for your time
Interesting, are those working in chrome? Not sure if those things are
supported by svg specification. Need to investigate.
—
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEB46IIUFIW67M2GNFLLVIDVPTEA7ANCNFSM5O2TONSA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ah ok that helps a lot, which version of Svg.Net did you use? |
Beta Was this translation helpful? Give feedback.
-
Latest... For now I'm mainly on svg. Net
It's working on svg net for the last two years since the day I started
playing with your library....
I've a branch for svg skia...I am waiting to merge it in order to be able
to move to net 6 as I'm deploying on a Linux docker and system drawing is
not available...
Le ven. 17 juin 2022 à 9:27 PM, Wiesław Šoltés ***@***.***> a
écrit :
… Initially I've used svg. Net and the output is correct. It's supported by
svg and is working under Chrome. I've moved my project under svg. Skia and
I've seen the described mismach If I can help, please let me know Amael Le
ven. 17 juin 2022 à 9:05 PM, Wiesław Šoltés *@*.
*> a écrit : … <#m_5423916160839134622_> Hi, Currently using the
SvgColourServer to define the stopColor of fill color There is a issue in
the SvgGradientStop StopColor and fill when it is a text color (white,
bleu, black...) Missing the rbg( ) for stop-color and the single quote
should be removed when text color is used (white) It is translated as
instead of ``` Thanks in advance for your time Interesting, are those
working in chrome? Not sure if those things are supported by svg
specification. Need to investigate. — Reply to this email directly, view it
on GitHub <#100 (comment)
<#100 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEB46IIUFIW67M2GNFLLVIDVPTEA7ANCNFSM5O2TONSA
<https://github.com/notifications/unsubscribe-auth/AEB46IIUFIW67M2GNFLLVIDVPTEA7ANCNFSM5O2TONSA>
. You are receiving this because you authored the thread.Message ID: @.*>
Ah ok that helps a lot, which version of Svg.Net did you use?
—
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEB46ILXMH7DJBKO6QW7RALVPTGSRANCNFSM5O2TONSA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ok will try to fix |
Beta Was this translation helpful? Give feedback.
-
I'm doing more test today Here is some samples which are working on svg.net 3.4.0 but not on Svg.skia 0.5.14 Initial SVG file content
Save as svg output with no transformation
Output
To test the issue with fill white
Save as svg
|
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue with setting a simple fill: sElement.Fill = new SvgColourServer( Produces something like: |
Beta Was this translation helpful? Give feedback.
-
I have also come across the same issue in a similar case to that reported by @nielsbosma. My case is very simple - I wrote a simple unit-tests that
By bisecting through the tags I have found that between tag 0.5.11 and 0.5.11.1 the result went from good to bad. Taking this further I looked at the git submodule code for the fork from SVG-NET library - which is extracted to externals/SVG. The following commit between 0.5.11 [e42d4ff] and 0.5.11.1 [302ce0d] seems to change the behaviour for writing svg colour information:
SvgColourConverter.cs @ be9f7dd
My guess is that it might be possible to compile the code without the Anyway hope this info might help someone investigate a possible fix. |
Beta Was this translation helpful? Give feedback.
-
I did some tests - the color issue only occurs with the https://www.nuget.org/packages/Svg.Custom/0.5.16 NuGet package, which is used by <circle cx="100" cy="100" r="50" id="2" fill="#804020" stroke="none" /> and save it back to string, you get this: <circle cx="100" cy="100" r="50" id="2" style="fill:128, 64, 32;stroke:none;" /> where The https://www.nuget.org/packages/Svg/3.4.3 package is unaffected, it only happens when using https://www.nuget.org/packages/Svg.Custom/0.5.16. Which explains why none of the tests in the SVG.NET project could have caught this - it doesn't occur there. And @andywyatte17 is right - the difference is that the Svg.Skia/src/Svg.Custom/Svg.Custom.csproj Line 14 in 6127353 which causes the public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
#if !NO_SDC
var colorString = ColorTranslator.ToHtml((Color)value).Replace("LightGrey", "LightGray");
// color names are expected to be lower case in XML
return colorString.StartsWith("#", StringComparison.InvariantCulture) ? colorString : colorString.ToLowerInvariant();
#endif
}
return base.ConvertTo(context, culture, value, destinationType);
} So string sep = culture.TextInfo.ListSeparator + " ";
TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int));
string[] args;
int nArg = 0;
if (c.A < 255) {
args = new string[4];
args[nArg++] = intConverter.ConvertToString(context, culture, (object)c.A);
}
else {
args = new string[3];
}
// Note: ConvertToString will raise exception if value cannot be converted.
args[nArg++] = intConverter.ConvertToString(context, culture, (object)c.R);
args[nArg++] = intConverter.ConvertToString(context, culture, (object)c.G);
args[nArg++] = intConverter.ConvertToString(context, culture, (object)c.B);
// Now slam all of these together with the fantastic Join
// method.
//
return string.Join(sep, args); And this method is apparently intentionally programmed to produce |
Beta Was this translation helpful? Give feedback.
-
Hi,
Currently using the SvgColourServer to define the stopColor of fill color
There is a issue in the SvgGradientStop StopColor and fill when it is a text color (white, bleu, black...)
Missing the rbg( ) for stop-color and the single quote should be removed when text color is used (white)
It is translated as
instead of
Beta Was this translation helpful? Give feedback.
All reactions