我想在RichTextBox.SelectionFont
不更改样式的情况下设置 FontFamily,因为我的字体不支持粗体和常规样式。
rtb.SelectionFont = New Font(New FontFamily(nicknamefonttype), nicknamefontsize, 0, GraphicsUnit.Point)
字体不支持粗体和常规字体是错误的。
I am using this in my WPF application to apply a System.Drawing.FontFamily
to my selected text:
rtb.Selection.ApplyPropertyValue(FontFamilyProperty, ((System.Drawing.FontFamily)rbngFonts.SelectedItem).Name);
The rbngFonts is a RibbonGallery, so I suspect you need to adapt it to your application.