Changing font globally


Author
Message
Neil Turp
Neil Turp
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)
Group: Forum Members
Posts: 0, Visits: 166
I have an app where the user is allowed to change the font name/size of a file completely.  I know all formatting is lost but this is what the users want.  The code I am using is

NRichTextView mmdv = new NRichTextView()
...
mmdv.Content.Selection.SelectAll();
mmdv.Content.Selection.SetFontSizeToSelectedInLines(24.0);
mmdv.Content.Selection.DeselectAll();

but that doesn't work.  I've also tried stepping through the Sections
for (int a = 0; a < mmdv.Content.Sections.Count; a++)
{
  mmdv.Content.Sections[a].FontName = "Cochin";
etc
}
Nothing works.  Obviously I've misunderstood something somewhere but can anyone throw light on it?
Neil

Replies
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Neil,
We weren't able to replicate that - we tried:

   NRichTextView view = (NRichTextView)nRichTextViewWithRibbonControl1.Widget.GetFirstDescendant(NRichTextView.NRichTextViewSchema);

   view.Content.Selection.SelectAll();
   view.Content.Selection.SetFontSizeToSelectedInlines(24.0f);
   view.Content.Selection.SetFontNameToSelectedInlines("Arial");
   view.Content.Selection.DeselectAll();

And it was working correctly - so there must be something else about this problem. Can you post the complete code you use to load the document? Also can you send that document you're testing with?


Best Regards,
Nevron Support Team


Neil Turp
Neil Turp
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)
Group: Forum Members
Posts: 0, Visits: 166
My apologies.  After changing the font, I had included a default formatting in a subsequent routine.
N

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search