RadLabel issue when I use HTML-like text

1 Answer 88 Views
Label
Simos Sigma
Top achievements
Rank 2
Iron
Iron
Iron
Simos Sigma asked on 21 Sep 2022, 02:04 PM | edited on 21 Sep 2022, 02:05 PM
I am working on a project with "UI for WinForms R2 2022 SP1 (version 2022.2.622)" and I am facing an issue on all my RadLebels!!! If I use HTML-Like text they look like this...



Any idea why is this happening?

Thank you for your time!!!

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Sep 2022, 10:16 AM

Hello, Simos, 

By default we use the GDI+ to measure the text, however, GDI+ is a known suspect for reporting wrong sizes of the text and this is probably the case here. However, it wouldn't be easy to determine without knowing the exact font. You can easily force the element to use GDI instead of GDI+ by setting the UseCompatibleTextRendering property to false and this should improve the rendering of normal text. However, for HTML-like text rendering, the possible solution that I can suggest is to use a suitable font or font size. Just give several font sizes a try and choose this one which suits your requirements best:  

this.radLabel1.Text = "<html>The <b>data</b> folder which contains <b>16222</b> files and <b>118</b> folders is being copied...";

Here is the result with different font and sizes:

- Arial 9:

this.radLabel1.Font = new Font("Arial", 9f, FontStyle.Regular);

- Arial 10:

this.radLabel1.Font = new Font("Arial", 10f, FontStyle.Regular);

- Verdana 11:

 this.radLabel1.Font = new Font("Verdana", 11f, FontStyle.Regular);

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Label
Asked by
Simos Sigma
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or