-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stuck in parsing css in some svg. #206
Comments
I have the same problem with this file. It also freezes the UI if in a SvgViewBox like this : <Grid>
<svgc:SvgViewbox Stretch="Fill"
Source= "W:/New Folder/freeze.svg">
</svgc:SvgViewbox>
</Grid> But it works with SharpVectors 1.5! Maybe related to some font definition in SVG? |
It may be realted to regular expression backtracking. |
Reproduced fail during css-parsing with the following data: |
@marksolbergerbjorkerot Thanks for tracking this issue. There is another problem with this issue; the original SVG test file contains embedded WOFF2 format font, which is not fully supported by the SharpVectors. I am currently trying to complete that support and then take on the CSS parsing. |
@paulushub - it seems that CssRuleList never breaks the while-loop when no at-rules have been able to be parsed. It just keeps looping the same css over and over. Changing the UnknownCssRule regex-pattern no ^@[^;]+;? (making the last semi-colon optional) will render a match on the rule for cases where no semicolon exists and the while-loop will break. |
@marksolbergerbjorkerot I have completed the WOFF1/WOFF2 decoder codes and started testing this issue. private static readonly Regex _reSplitCss = new Regex(@"([^:\s]+)*\s*:\s*([^;]+);");
// changed to
private static readonly Regex _reSplitCss = new Regex(@"([^:\s]+)\s*:\s*([^;]+);"); |
- Reworked and completed the WOFF1 and WOFF2 support - Restoration of FontFamily names in WOFF1 when stripped out. Issue #123 - Fixed CSS parsing issue #206 - credit @marksolbergerbjorkerot
@kkwpsv @alo00 @marksolbergerbjorkerot It seems this issue is resolved by the latest commit. Please can you verify this fix. @kkwpsv The embedded WOFF2 fonts are never used. Are you using these fonts? The fonts were decoded and successfully tested, but no verification is done in your test file, since there is no text to be rendered. |
I have test the latest version with my sample file, it works fine. |
@kkwpsv Thanks for the updates. |
Is there any plan for a new release including this fix ? Thanks |
@Whiletru3 Will trying to get it out by Monday. Currently, busy looking for a new job 😢 |
@paulushub Thanks a lot :) Good luck for your search 👍 |
The stack when stuck is as below:
Here is two svgs which caused stuck.
svg.zip
The text was updated successfully, but these errors were encountered: