In Development
Last Updated: 27 Jan 2020 12:43 by ADMIN
Created by: Martin Ivanov
Comments: 2
Category: UI for WPF
Type: Bug Report
2

Most commonly the exception message is "Input file or data stream does not conform to the expected file format specification".

This appears because of the glyphs font used in the different controls.

To work this around you can use two approaches:

  • Update to Windows 7 SP2.

  • The second option is to download the UI for WPF source code, find the TelerikWebUI.ttf file and convert it to .otf using a third party tool (like FontForge for example). Then use a reflection to replace the font file, before the application startup. For example:
    RadGlyph.GetRegisteredFonts();
    var dictionary = typeof(RadGlyph).GetField("registeredTypefaces", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null) as Dictionary<string, Typeface>;
    dictionary?.Clear();
       
    RadGlyph.RegisterFont(new FontFamily(new Uri("pack://application:,,,/WpfApp3;component/TelerikFont/", UriKind.RelativeOrAbsolute), "./#TelerikWebUI"), "TelerikWebUI");
    In the code snippet, "WpfApp3" is the assembly name of your project, and "TelerikFont" is a folder in your project, containing the converted font file. You can call this code in the OnStartup override of App.xaml.cs. Or before the InitializeComponent() call in the main window's constructor.