FontWeight doesn't work

0 Answers 403 Views
WordsProcessing
michael
Top achievements
Rank 1
michael asked on 27 Oct 2021, 04:07 PM

Hello,

I have a weird situation, that the line:

run.FontWieght = FontWieghts.Bold;

doesn't work.

in second hand, every other character attribute is working perfectly (like FontStyle, FontUnderline, Font size and so on).

can anyone guess what could be the issue? 

 

Tanya
Telerik team
commented on 29 Oct 2021, 11:30 AM

Hello Michael,

Such behavior could be observed when the font used for the specific run doesn't support bold characters. Can you please share more information about the setup you have so we can further investigate that? How is the run generated and what are the properties applied to it?

michael
Top achievements
Rank 1
commented on 25 Nov 2021, 02:51 PM

Hello Tanya!

it seem that only when I add the "FlowDirection" like the code below

run.FlowDirection = FlowDirection.RightToLeft;
run.FontWeight = FontWeights.Bold;

it overrides the bold statement... 

when i comment the FlowDirection, the bold attribute works perfectly!

Tanya
Telerik team
commented on 29 Nov 2021, 02:56 PM

Hello Michael,

Thank you for the additional details. I managed to reproduce the issue when the text is in right-to-left mode and it seems like this behavior is specific to MS Word. In the exported content, the bold styling is applied and the button in the ribbon of MS Word also indicates that. However, the text is rendered without any bolding. I have found a guide on how to fix that in MS Word: https://www.biosciencewriters.com/Fixing-right-to-left-text-in-Microsoft-Word.aspx.

I have also tested opening the generated document with other applications supporting .docx files and confirmed that the bold option is applied to the text and everything is rendered as expected.

Hope this information is useful.

michael
Top achievements
Rank 1
commented on 30 Nov 2021, 01:34 PM

Dear Tanya!

The problem has been fixed thanks to you.

Thank you very much for your responses!

No answers yet. Maybe you can help?

Tags
WordsProcessing
Asked by
michael
Top achievements
Rank 1
Share this question
or