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
When using font-familty in a SVG document, MacOs might fail with an exception "Font '?' cannot be found' when calling the Draw function. This seems to happen when text are getting rendered, svg files without text do not cause issues.
The GDI+ library is loaded correctly (the GDI+ compat check states that it can be loaded and the Exception seems to come from within the GDI+ libraries.
Exception has occurred: CLR/System.ArgumentException
Exception thrown: 'System.ArgumentException' in System.Drawing.Common.dll: 'Font '?' cannot be found.'
at System.Drawing.FontFamily.GetGdipGenericSansSerif()
at System.Drawing.FontFamily.get_GenericSansSerif()
at Svg.SvgElement.ValidateFontFamily(String fontFamilyList, SvgDocument doc) in /Users/gertjan/Development/SVG/Source/SvgElementStyle.cs:line 461
The exception seems not to be really caused by the font that cannot be found, but the error seems to be thrown from SvgElement.ValidateFontFamily, the throwing code is: return System.Drawing.FontFamily.GenericSansSerif;, so I assume there might be a problem with the Generic font enumeration in the GDI+ library.
Not sure if the problem is really in the SVG lib, but for documentation purposes this ticket might be relevant.
Example data
Problem occurs in every SVG that has a font described in the document. This includes SVG files in the UnitTest project (like Resources\Issue_Threading\TestFile.svg).
This issue might also occur on Linux systems.
Used Versions
Used the master branch from this repository in the state of August 10th 2019. Running on MacOs Mojave 10.14.6 on .Net Core 2.2 and using the suggested gdi+ replacement package for Mac.
Exception encountered while running unit tests from the unit test project.
The text was updated successfully, but these errors were encountered:
Logged this for reference purposes. Since I am primarily working on MacOs (and I believe I am a minority under the developers here), I'll look into this. Ofcourse, I won't refuse any assistance from Mac/Linux users involved/interested.
This might explain why I had quite a large set of tests failing in the past on Mac. I thought it was due to some rendering issues (because the equality checks did sometimes fail) or some other issues, but possibly the font issue might been here for quite some time.
Description
When using font-familty in a SVG document, MacOs might fail with an exception "Font '?' cannot be found' when calling the Draw function. This seems to happen when text are getting rendered, svg files without text do not cause issues.
The GDI+ library is loaded correctly (the GDI+ compat check states that it can be loaded and the Exception seems to come from within the GDI+ libraries.
The exception seems not to be really caused by the font that cannot be found, but the error seems to be thrown from
SvgElement.ValidateFontFamily
, the throwing code is:return System.Drawing.FontFamily.GenericSansSerif;
, so I assume there might be a problem with the Generic font enumeration in the GDI+ library.Not sure if the problem is really in the SVG lib, but for documentation purposes this ticket might be relevant.
Example data
Problem occurs in every SVG that has a font described in the document. This includes SVG files in the UnitTest project (like Resources\Issue_Threading\TestFile.svg).
This issue might also occur on Linux systems.
Used Versions
Used the master branch from this repository in the state of August 10th 2019. Running on MacOs Mojave 10.14.6 on .Net Core 2.2 and using the suggested gdi+ replacement package for Mac.
Exception encountered while running unit tests from the unit test project.
The text was updated successfully, but these errors were encountered: