Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1700
How to use Bold and FontSize together ?
posted

Hello,

I have a document, I insert some lines with bold and some without.

I want to reduce the font for the whole document, and allow me to stay with my configuration.

My code is this one :

public ContextViewModel()
{
data = new RichTextDocument { IsReadOnly = true };
csBold = new CharacterSettings() { Bold = true };
CharacterSettings csBigSize = new CharacterSettings() { FontSize = new Extent(20, ExtentUnitType.LogicalPixels) };
pn = createParagraphNode();

InsertDetails();
}

void InsertDetails()
{
AddText(pn, csBold, "Version : ");
AddText(pn, null, Version.ToString());
pn = createParagraphNode();
}

I want something like : AddText(pn, null, csBigSize,Version.ToString());

Could you help me ?

Regards

Parents
No Data
Reply
  • 1700
    Verified Answer
    Offline posted

    Hello,

    I found the solution :

    csWithBold = new CharacterSettings() { Bold = true, FontSize = new Extent(14, ExtentUnitType.LogicalPixels) };
    csWithoutBold = new CharacterSettings() { FontSize = new Extent(14, ExtentUnitType.LogicalPixels) };

    I'll use it when I want Bold or not.

    Regards

Children
No Data