Font change issue with TAdvRichEditor and TAdvRichEditorMiniHTMLIO

If I load a TAdvRichEditor/TAdvRichEditorMiniHTMLIO with HTML, and proceed to backspace to delete all the characters in line 1, the font shown in the toolbar will change from my setting of Arial 10pt to Tahoma 8pt. When you delete the final character in the line, the caret disappears and the font on the toolbar changes to Tahoma 8pt. Just moving the caret or clicking into the editor causes it to change back to my setting of Arial 10pt. However, if you do not do either of those things, anything you type in on that first line is in Tahoma 8pt.

What is worse is that if you then save it and reload it, line one is still Tahoma, and the other text is still Arial, but it is now all 8pt (it lost the fact that it was 10pt).

TAdvRichEditor 1.8.2.2
Delphi 10.3.3

Video showing the problem:
Font issue

There must be 'subtle?) details missing as I cannot reproduce this here.
First of all, I cannot see the caret disappear. When there is no text on the line and no text selected, it is normal that it falls back to the default font, i.e. the font set via AdvRichEditor.Font.
When I delete text on the first line and reenter text, it uses the font of the text already there, so it moves back to Arial 10. I cannot see that it uses Tahoma after deleting the line?

Thanks for taking a look at it. I will put an example together and send it on up. It may be a few days before I can get to it, but like you said it is probably something subtle that I have set or should have set.

Example Sent.

We traced & solved this issue. The next update will address this.

Unfortunately, it still has issues. I set the font in design mode to Arial 10pt, but at runtime it defaults to Tahoma 8pt with an empty editor. Also, clicking into an empty editor, the caret does not show up until you start typing.

VCL UI Pack 10.4.5.1
TAdvRichEditor 1.8.2.9

I'm sorry but I could not see a problem here.
Dropped TAdvRichEditor on the form. Changed AdvRichEditor.Font at design-time. The font set at design-time is used at runtime.
Are you sure you have a clean setup? Is this happening on multiple machines?

Pretty sure it is a clean setup. A customer reported the issue and I was able to duplicate but noticed I was about a month behind in your updates, so I installed the latest and rebuilt. Problem still occurred. Do you still have the sample I sent to you on Aug 16th? It shows the issue. If you have it, just click the "Step 2" button and notice that the font changes from Arial 10pt to Tahoma 8 pt and clicking in the editor does not show a caret until you start typing. I think the problem occurs after loading the editor with an empty string, not at startup time as in your steps. If you need the example again, I can resend it. Or just add basically these two lines to your test:
AdvRichEditor1.Clear;
AdvRichEditorMiniHTMLIO1.Insert('');

Maybe I need to reset the font after loading an empty string, but certainly the caret should be there I would hope :)

Update:
It gets worse. If I backspace whatever I key in, I get an access violation after deleting the last character. AV at line 2748 in TAdvRichEditorBase.Backspace
Caret.CharIndex := Caret.Element.TextLength;

Caret.Element is nil.

1 Like

With these extra details, we could reproduce this and we will investigate this.