You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following problem related to this simple code, which has the task of loading a given SVG file as an object of type DrawingGroup. I care that the texts contained in the given SVG file are not geometries.
During its execution for the example SVG file, I got such an exception:
[DomException]
Code: SyntaxErr
Message: Style declaration ending bracket missing
HelpLink: [null]
Source: SharpVectors.Css
----------------------------------------------------------------------------------------------------------------------------------
Stack trace:
at SharpVectors.Dom.Css.CssStyleDeclaration.ParseString(String cssText)
at SharpVectors.Dom.Css.CssFontFaceRule.Parse(String& css, Object parent, Boolean readOnly, IList`1 replacedStrings, CssStyleSheetType origin)
at SharpVectors.Dom.Css.CssRuleList.TryParse(String& css, Object parent, Boolean readOnly, IList`1 replacedStrings, CssStyleSheetType origin)
at SharpVectors.Dom.Css.CssRuleList.Parse(String& css, Object parent, Boolean readOnly, IList`1 replacedStrings, CssStyleSheetType origin)
at SharpVectors.Dom.Css.CssStyleSheet.get_CssRules()
at SharpVectors.Dom.Svg.SvgDocument.GetFontUrl(CssStyleSheet cssSheet, IList`1 fontUrls, IDictionary`2 styledFontIds)
at SharpVectors.Dom.Svg.SvgDocument.GetFontUrls()
at SharpVectors.Dom.Svg.SvgDocument.OnLoaded()
at SharpVectors.Dom.Css.CssXmlDocument.Load(XmlReader reader)
at SharpVectors.Dom.Svg.SvgDocument.Load(String filename)
at SharpVectors.Renderers.Utils.WpfSvgWindow.LoadDocument(Uri documentUri, WpfDrawingSettings drawingSettings)
at SharpVectors.Converters.FileSvgReader.LoadFile(String fileName)
It looks to me that we have a problem here with loading custom fonts defined with the css rule font-face. I found only one such case in my file. I have included the definition of this font below:
<styletype="text/css">
<![CDATA[@font-face{font-family:"MicrosoftSansSerif";src:url("data:application/font-woff;charset=utf-8;base64,<stream of bytes, which I had to shorten because the post was too long>")}]]>
</style>
It seems to me that the given font-face rule is well defined (according to what I write here). For that, I have doubts about the parsing in the method CssStyleDeclaration.ParseString(String cssText). Can you please analyze the correctness of this method?
Sample SVG file attached.
The text was updated successfully, but these errors were encountered:
@Sarnapa Sorry, you have hit a missing code. The embedded URL matching regular expression failed, and the else block was left empty for lack of use case.
You can see
Hi,
I have the following problem related to this simple code, which has the task of loading a given SVG file as an object of type DrawingGroup. I care that the texts contained in the given SVG file are not geometries.
Mentioned fragment of code:
During its execution for the example SVG file, I got such an exception:
It looks to me that we have a problem here with loading custom fonts defined with the css rule font-face. I found only one such case in my file. I have included the definition of this font below:
It seems to me that the given font-face rule is well defined (according to what I write here). For that, I have doubts about the parsing in the method
CssStyleDeclaration.ParseString(String cssText)
. Can you please analyze the correctness of this method?Sample SVG file attached.
The text was updated successfully, but these errors were encountered: