Open kwyntes opened 1 year ago
@JeremyKuhne is usually the go to for richtext I think.
@kwyntes SetCharFormatFont
is what you'd debug. I haven't really looked at EM_SETCHARFORMAT
so I can't offer a lot beyond that. As this is the way it has always been we probably won't be able to look into it deeply, but you're welcome to investigate and capture whatever you find here. We can discuss further when you have more.
.NET version
Tested in 7.0, 6.0 and .NET framework 4.8.
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Not that I know of.
Issue description
Setting the
Font
orSelectionFont
property to some font, likenew Font("Arial Black", 11.5f, FontStyle.Italic)
, programtically entered text, either throughAppendText(...)
or modifying theText
property directly, displays with the chosen font applied. When entering new text however, be it by simply appending at the end, selecting all or part of the text and then typing new text, or typing in between the text already present, will have the expected font size and style applied, but a default font family.I tried to figure out where new text input is processed in the
RichTextBox
andTextBoxBase
classes, but I couldn't manage to find it. If anyone could point me to the source code for that, please do so!https://user-images.githubusercontent.com/78665317/227747410-359ce9aa-37c6-4ab6-a3b3-95263a959f81.mp4
Steps to reproduce