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

Fonts and their properties

3 Answers 107 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 03 Oct 2011, 11:12 AM
Hi.
I have a silverlight project where I use a webclient to get the fonts stream and then I create a fontsource from it.

Using an example on this forum, I've added the ttf used on that same example to my project and it works but all the fonts i've downloaded from font sites so far haven't worked. Any idea why? The only thing that my fonts don't have is a digital sign.

Before adding to the toolbar combo fonts option, I add them to textblocks and it renders perfectly but not on the richtextboxes.


Info:
The areas in red are texblocks on a horizontal stackpanel. Each text is the font family name and has the font applied to it.
The 3 blocks on top are 3 individual RichtextBoxes that set the ribbon datacontext to them once they get focus (works fine) and they have text written with the font applied.

The fonts can be found here:
http://www.1001freefonts.com/font/BaroqueScript.zip
http://www.1001freefonts.com/font/KatyBerry.zip

Telerik version:
2011.1.427.1040

3 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 05 Oct 2011, 01:36 PM
Hi Marco,

There are some specifics when using custom fonts in RadRichTextBox, as font families do not get initialized if they are not set to a TextBlock or another control from the framework first. We have reported this issue to Microsoft and are waiting for a fix of the issue.
Please find attached an application showing how this limitation can be worked around.

Kind regards,
Iva
the Telerik team

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

0
Sergio
Top achievements
Rank 1
answered on 05 Oct 2011, 02:51 PM
Hi.
I do not wish to have the fonts embedded. The fonts are on a folder on the server where the user uploads them to. Then, using a webclient the application gets the font file streams. Can this workaround be used somehow after the loaded/webclient completed events?

Thanks
0
Iva Toteva
Telerik team
answered on 11 Oct 2011, 11:11 AM
Hi Tiago,

I am afraid it will not be possible to use dynamically loaded fonts with RadRichTextBox.
The way to utilize such fonts with TextBoxes and TextBlocks is to set their FontSource property along with the FontFamily. However, RadRichTextBox does not have a FontSource property and there is too little information on how we could implement the same logic that has been implemented for TextBoxes and TextBlocks in order to get it working.

All the best,
Iva
the Telerik team

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

Tags
RichTextBox
Asked by
Marco
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Sergio
Top achievements
Rank 1
Share this question
or