0

I write an application that handles text. I must be able to determine the FontFamily and the FontStyle of each word that is contained in a RichTextBox.Text, as the different font types must be handled differently. I found ways to SET the font type, but I was unable to find an example in which the font type is examined and the FontFamily and the FontStyle are determined. Thank you in advance.

user2102327
  • 59
  • 2
  • 6
  • 19
  • Font type of **what** text? Inside of a label, button, `RichTextBox` etc? – dymanoid Nov 29 '18 at 09:37
  • 2
    If you can __select__ a word the font will be accessible in [`rtb.SelectionFont`](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.richtextbox.selectionfont?view=netframework-4.7.2) etc.. If you have trouble, show the code that gives the trouble.. – TaW Nov 29 '18 at 12:26
  • An addendum to what @TaW said. You might have to deal with the Font Fallback feature of text-related controls. The Font won't match any of the user-defined Fonts. It this could be the case, read [this about Font fallback](https://stackoverflow.com/questions/51608365/how-can-label-control-display-japanese-characters-properly-when-font-of-the-labe?answertab=active#tab-top) and related adjustments you may won't to perform: [Some Alt keys changes my RichTextBox font](https://stackoverflow.com/questions/51441064/some-alt-keys-changes-my-richtextbox-font?answertab=active#tab-top) – Jimi Nov 30 '18 at 00:12

0 Answers0