This is a migrated thread and some comments may be shown as answers.

XamlParseException on FontFamiliesProvider

3 Answers 128 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 16 May 2012, 07:32 AM
Hey, I've been giving RadRichTextBox a go, and so far it has been the perfect tool for me.

However, when I import my customized editor to my project, it throws off an error on this particular piece of XAML code:
<UserControl.Resources>
    <telerik:FontFamiliesProvider x:Key="FontFamiliesProvider" />
</UserControl.Resources>

The exception is a XamlParseException, and it goes along the lines of The type 'FontFamiliesProvider' was not found. [Line: 19 Position: 61]. I'm not using the RibbonUI control because I feel it is not suited for my needs; instead I've placed my buttons inside a StackPanel. It works on a separate testing project, but when I plug it in to my existing project... this error gets thrown.

I've also checked that all the references I need are there, and that they are all of version 2012.1.326.1040 with a runtime version of v2.0.50727. I am just very confused why it works on one project, and not on the other.

Many thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Boby
Telerik team
answered on 18 May 2012, 10:04 AM
Hello Matthew,
FontFamiliesProvider type is in Telerik.Windows.Controls.RichTextBoxUI assembly, so you should need a reference if you want to use it; another option is to implement one itself - it's just a bind-friendly non-static wrapper around FontManager class, which includes a RegisteredFonts property calling FontManager.GetRegisteredFonts method.

Greetings,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Fatima
Top achievements
Rank 1
answered on 01 Mar 2013, 04:54 PM
Hi,

I use FontFamiliesProvider in RadRichTextBoxRibbonUI ,but it did not reference the new font i instaled.
I tried to get the list from :the System.Drawing.Text.InstalledFontCollection but also it reference the default font.the same as FontFamiliesProvider .

Despite of in Office Word the list of FontFamily get the new font .

How can i get all font (default and new instaled) ?

Thanks
0
Iva Toteva
Telerik team
answered on 06 Mar 2013, 10:25 AM
Hi Fatima,

You can use all fonts installed on the client machine in Silverlight. This is also true for RadRichTextBox for Silverlight.

By default, the following fonts are shown in the UI:

  • Arial;
  • Arial Black;
  • Calibri;
  • Comic Sans MS;
  • Courier New;
  • Georgia;
  • Lucida Sans Unicode;
  • Times New Roman;
  • Trebuchet MS;
  • Verdana.

In order to have additional fonts show in the drop-downs of RadRichTextBoxRibbonUI and SelectionMiniToolBar, you should register them before the UI is created like this:

FontManager.RegisterFont(new FontFamily("Tahoma"));

When it comes to setting the font as default, this can be done as described in this article:

<telerik:RadRichTextBox Name="editor" Grid.Row="1" FontFamily="Tahoma" FontSize="16" DocumentInheritsDefaultStyleSettings="True" />

I hope this answers your question.


All the best,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Matthew
Top achievements
Rank 1
Answers by
Boby
Telerik team
Fatima
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or