Approved
Last Updated: 12 Feb 2018 11:58 by ADMIN
ADMIN
Boby
Created on: 08 Dec 2017 13:22
Category: RichTextBox
Type: Bug Report
2
RichTextBox: TypeInitializationException in SystemFontsManager is thrown during initialization on some machines
The exception is thrown by the SystemFontsManager internal class from Telerik.Windows.Documents.Core, so it can observed when using RadPdfViewer, RadRichTextBox, RadSpreadsheet.

The reason is not clear, posssible causes are:
- Corrupted fonts after upgrade from Windows XP
- Enabling of Block untrusted fonts feature (https://docs.microsoft.com/en-us/windows/threat-protection/block-untrusted-fonts-in-enterprise )

The call stack is as follows:

System.TypeInitializationException: The type initializer for 'Telerik.Windows.Documents.Core.Fonts.SystemFontsManager' threw an exception. ---> System.IO.FileNotFoundException: Unable to find the specified file.
   at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr)
   at MS.Internal.Text.TextInterface.FontList.get_Item(UInt32 A_0)
   at MS.Internal.Text.TextInterface.FontList.FontsEnumerator.get_Current()
   at MS.Internal.FontFace.TypefaceCollection.Enumerator.get_Current()
   at System.Windows.Media.Fonts.TypefaceCollection.<GetEnumerator>d__11.MoveNext()
   at Telerik.Windows.Documents.Core.Fonts.SystemFontsManager..cctor()

Workaround: 

Manually delete all registry key values in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts pointing to files outside of the Fonts folder.
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
1 comment
ADMIN
Peshito
Posted on: 26 Jan 2018 06:47
Please refer to the following article describing the symptoms and possible solutions related to this issue:
https://www.telerik.com/forums/getting-typeinitializationexception-or-fileformatexception-error-when-using-the-document-processing-libraries