Completed
Last Updated: 05 Feb 2020 09:36 by ADMIN
Release LIB 2020.1.210 (2/10/2020)
Martin Ivanov
Created on: 16 Jul 2019 09:39
Category: UI for WPF
Type: Bug Report
2
XamlParseException is thrown using some controls on Windows 7

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.
2 comments
ADMIN
Martin Ivanov
Posted on: 26 Jul 2019 05:46
Hello Alvaro,

The font is located at "source download folder/Core/Controls/Themes/Fonts/TelerikWebUI.ttf". I hope this helps.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Alvaro
Posted on: 25 Jul 2019 15:42

Hello,

Where can I find TelerikWebUI.ttf?
I've downloaded the source code (
Telerik_UI_for_WPF_Source_2019_2_618.zip), but I can not find it.