Hey All,
Bit of a pickle here. I am porting my project to Mac and have an issue with System.Drawing.
The library must be present on the Mac somewhere because when I add a reference to the mcs.rsp file, visual studio can pickup on sub classes of the library like System.Drawing.FONT.
//mcs.rsp file
-r:System.Drawing.dll
//Tried
-r:/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/libgdiplus.0.dylib -target:framework System.Drawing
The error is related to libgdiplus.dylib, which to my knowledge is the mono port of system.drawing.
I have tried adding references to the gdiplus lib, even installed with HomeBrew. Nothing has worked.
For the sake of not fully understanding the problem Im facing, below is a code snip of what causes the error, and the error itself. Sorry for a big error dump, but its just there as Im not sure whats going wrong
private void LoadFontFile(string path){
fontCollection = new System.Drawing.Text.PrivateFontCollection();
fontCollection.AddFontFile(path);
font = new System.Drawing.Font(fontCollection.Families[0], fontRenderSize);
...
}
DllNotFoundException: /Users/builduser/buildslave/mono/build/external/buildscripts/add_to_build_results/monodistribution/lib/libgdiplus.dylib
System.Drawing.GDIPlus..cctor () (at <db84b41d92194c43bc99091ea8fb22ce>:0)
Rethrow as TypeInitializationException: The type initializer for 'System.Drawing.GDIPlus' threw an exception.
System.Drawing.Text.PrivateFontCollection..ctor () (at <db84b41d92194c43bc99091ea8fb22ce>:0)
CatalogueItemManager_Font.LoadFontFile (System.String path) (at Assets/Scripts/CatalogueItemManager_Font.cs:265)
..........
Note: I have also tried copying libgdiplus.dylib into the plugins folder and that didn’t do anything.
Im only borrowing a mates Mac, so I need to fix this today so I can build the app before having to give it back :(