Completed
Last Updated: 16 May 2019 14:09 by ADMIN
ADMIN
Boby
Created on: 08 Dec 2017 13:22
Category: RichTextBox
Type: Bug Report
3
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.
2 comments
ADMIN
Peshito
Posted on: 16 May 2019 14:09
Fix will be available in LIB Version 2019.2.520 expected on Monday, May 20th.
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