So this morning, I had a windows update.
Right after the update, my program is just broken.
It crashes on loading a custom font. Here is the exact code.
Code:
Dim options As XPdfFontOptions = New XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always)
Dim privateFonts As New System.Drawing.Text.PrivateFontCollection()
privateFonts.AddFontFile(MyApp.fontPath & "thefont.ttf")
Dim MyCustomFont As XFont = New XFont(privateFonts.Families(0), 12, XFontStyle.Bold, options)
it crashes with (on the 4th line) with:
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
the addfontfile appears to not work. it comes back empty, where on a non upgraded machine it comes up valid.
Now Microsoft says you have to modify the app.config file. but I spent the entire day today messing with this and it just wont work. I literally have tried everything. I think its something else
https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/retargeting/4.5.2-4.7.2#privatefontcollectionaddfontfile-method-releases-font-resourcesDoes anyone have any ideas? I am totally lost.
Ive confirmed it works on a machine that is not upgraded, and is broken on any machine that is.
The .exe's that where compiled before today all work, so at least my existing user based isn't affected