Rank: Newbie
Groups: Guest
Joined: 2/19/2018(UTC) Posts: 9
|
When I call the writer.GetGraphics() method: Code:System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'Aurigma.GraphicsMill.AdvancedDrawing.FontRegistry' threw an exception.
Source=Aurigma.GraphicsMill
StackTrace:
at Aurigma.GraphicsMill.AdvancedDrawing.FontRegistry.get_Installed()
at Aurigma.GraphicsMill.AdvancedDrawing.Graphics..ctor(PdfWriter pdf)
at Aurigma.GraphicsMill.Codecs.PdfWriter.GetGraphics()
at Test.Program.Main(String[] args) in C:\Working\SheetGenerator\Test\Program.cs:line 89
Inner Exception 1:
SEHException: External component has thrown an exception.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Could you post a code snippet so we could reproduce hte problem? |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 2/19/2018(UTC) Posts: 9
|
I'm using x64 binaries, here is my code snippet: Code:Graphics graphics;
PdfWriter writer = null;
Bitmap bm;
writer = new Aurigma.GraphicsMill.Codecs.PdfWriter("test.pdf");
int en = 2480;
int boy = 3508;
bm = new Bitmap(en, boy, PixelFormat.Format24bppRgb, RgbColor.White);
writer.AddPage(bm.Width, bm.Height);
graphics = writer.GetGraphics();
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
Hi, I've tested your snippet, and it works fine. So, the next steps are: - Get the latest version if you don't have it yet. At the moment, 9.3.15 is the last one.
- If not helps, try to figure out what font causes the exception. Here is a small snippet for filling CustomFontRegistry with files from your windows fonts directory one by one. Probably you should get the same exception.
Code:var fr = new CustomFontRegistry();
var fonts = System.IO.Directory
.GetFiles(@"c:\windows\Fonts\", "*.*")
.Where(file => (file.ToLower().EndsWith(".otf") || file.ToLower().EndsWith(".ttf") || file.ToLower().EndsWith(".pfb")))
.ToList();
foreach (var font in fonts)
{
Console.WriteLine(font);
fr.Add(font);
}
- Try to uninstall that font from your system. If everything works fine, please send us this file.
|
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 2/19/2018(UTC) Posts: 9
|
var fr = new CustomFontRegistry(); line throws the exception now: Code:System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'Aurigma.GraphicsMill.AdvancedDrawing.FontRegistry' threw an exception.
Source=Aurigma.GraphicsMill
StackTrace:
at Aurigma.GraphicsMill.AdvancedDrawing.FontRegistry..ctor()
at Test.Program.Main(String[] args) in C:\Working\SheetGenerator\Test\Program.cs:line 17
Inner Exception 1:
SEHException: External component has thrown an exception.
X64 Console app with .NET 4.5.2 as target framework. I also tried the old versions and here is my result: 9.2.23: works without problem 9.3.07: throws exception 9.3.11: throws exception 9.3.15: throws exception
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
|
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 2/19/2018(UTC) Posts: 9
|
I uploaded my folder to your link. Waiting for your response. But I don't understand why a font file can do this before I select the fonts to use with the library?
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
Potentially, a font file could be a cause of the failure. At least for the first snippet. So, I have checked your files with the second snippet on Windows 7/8/10, and there is no success. In GM 9.3 we changed the underlying library for text handling, and I expect the problem is there. But I need to reproduce it on my side. Could you give me more information about your software environment like OS version, updates installed, Visual Studio redistributables version, antivirus software and so on. By the way, you can try to reinstall VS redist, just in case. Our both setups from the website contain the required redistribution files inside. And could you also send me a crashing dump? If you have Visual Studio on the target machine, just attach to the process after the crash, then DEBUG -> Save Dump As... If not, try to use ProcDump tools from Sysinternals. It is easy to use: Code:procdump64.exe -i c:\pd_dumps
RunCrashingConsole.exe
procdump64.exe -u
Edited by moderator Monday, February 26, 2018 3:17:11 AM(UTC)
| Reason: Not specified |
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 2/19/2018(UTC) Posts: 9
|
Hi Eugene, I uploaded the dump and info files to your previous dropbox folder. Hope this helps. I'm on a trial license now and my first impressions with the library isn't good. Best Regards, Bulent.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
Hi Bulent, I understand your feelings, and I'm sorry for that. Sometimes such things happen, but we do a lot to minimize it as much as possible. I reproduced your environment on a clean virtual machine, and there was no success too. Actually, your software configuration is pretty close to mine. I checked the code, and I think I have an idea what could be wrong. I built a test version of GM. Please try to run it on your side. Here is a console application for testing: https://www.dropbox.com/...estFontRegistry.zip?dl=0 |
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 2/19/2018(UTC) Posts: 9
|
Hi Eugene, I tried your sample and still getting the exception. I debug the test program with reflection and this code goes into the catch block: Code:try
{
<Module>.TextWhizz.FontRegistry.InitFromSystem(<Module>.std.shared_ptr<TextWhizz::FontRegistry>.operator-><class\u0020TextWhizz::FontRegistry,0>(ifwFontRegistry));
}
catch
{
<Module>.___CxxCallUnwindDtor(ldftn(std.shared_ptr<TextWhizz::FontRegistry>.{dtor}), (void*)(&shared_ptr<TextWhizz::FontRegistry>));
throw;
}
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
|
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 2/19/2018(UTC) Posts: 9
|
This new version works without any problem. Writes all the font names on screen and finally writing True.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
Try the following code: Code:InstalledFontRegistry fontRegistry = (InstalledFontRegistry)typeof(InstalledFontRegistry).GetConstructor(
BindingFlags.NonPublic | BindingFlags.Instance,
null, Type.EmptyTypes, null).Invoke(null);
foreach (var font in fontRegistry.Fonts)
{
Console.WriteLine(font.PostscriptName);
}
Does it throw an exception? If yes, send me the dump, please. |
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 2/19/2018(UTC) Posts: 9
|
I uploaded the dump file to your dropbox folder
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
Please try to delete this file. C:\Windows\Fonts\XaraFont.fon Then run the console again. |
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 2/19/2018(UTC) Posts: 9
|
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
That's great! The fix will be available in the next release. |
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.