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

RadControls crash when html font has ampersand in title.

1 Answer 69 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 18 Jan 2010, 07:23 PM

Hi,

I’ve been using HTML text formatting for some of theRadControls. I noticed that a RadControl will crash if the HTML font has anampersand in the tile. For example, the following HTML will crash a RadControl:

<html><span style="font-family: the king&amp; queen font; font-size: 20pt">Add TextHere</span></html>

The above HTML was created using the RadMarkupDialog, andassumes you have the following installed font:

http://www.audiolabel.com/artopia/king-and-queen.zip

I also noticed that a RadControl will crash if the HTML fontis missing from the user’s computer. This behavior is different than if you setthe font through the RadControl Font property. When setting the Font property,a missing font will be automatically replaced with a default system font.

Shouldn't a missing font be automatically replaced whensetting the font through HTML? I can see this being very important when yourTelerik program is installed on different computers.

I'm  using the latest Telerik build - 2009.3.1203

Thanks for your help,

Tim

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 19 Jan 2010, 12:30 PM
Hello Tim,

Thank you for you the feedback.

Please note that the RadMarkupEditor and the HTML-like feature are not 100% compatible. RadMakrupEditor gives a true HTML like code snippet as an output, but the HTML-like feature has a limited number of supported html tags described in this article.

In regards to the information above, you do not need to escape the & symbol. Just set the font name to King & Queen font
For example:
<span style="font-family: the king & queen font; font-size: 20pt">

In addition, the Html-like Span tag does not implement font safety logic. Currently, I would suggest that you use the Html-like tag <font=the King & Queen font> that will fallback to default font if the specified font is not installed on the machine. I would like to inform you that .NET cannot work correctly with this font - I tried to set it to a standard form and buttons without success (please refer to the screenshot).

I would also strongly recommend installing the fonts that the application uses on the deployment machines or check in code if the font exists:
if( myFontExistsOnTheLocalMachine )
{
   myText = "<html><span style=\"font-family: the king & queen font; font-size: 20pt\">"
}
else
{
   myText = "<html><span style=\"font-family: Tahoma; font-size: 20pt\">"
}

I hope this helps.

Sincerely yours,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Tim
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or