TAdvRichEditor: Issues with exporting to HTML


I think I have found a couple of issues in the exporting to HTML process through TAdvRichEditorHTMLMiniIO and TAdvRichEditorHTMLIO as well.

  1. Font names are not being properly handled. If my text has a "Segoe UI" font face, it is exported as font-family:"SEGOE" in the BODY tag which is wrong. The process truncates the names if it finds a blank but it not happens with all the fonts. If a try to load that html, the AdvRichEditor will try to select an unexistent font "SEGOE" in the font selector combo from my TAdvRichEditorFormatToolBar.

Also, it's weird that the font is saved all in uppercase because if the font exists in the system (let's say I'm using Tahoma and not Segoe UI) it will appear as "TAHOMA" in the font selector combo and not Tahoma as it should be. Again, this is not happening will all the fonts. If I use for example "Bauhaus 93", is not truncated and it's not saved in uppercase.

  1. Bullet symbols are not preserved so if I select an arrow as the bullet for a list, I export to HTML and try to load the document again, it will show all the lists with the default bullet symbol (circle).


Do you use the latest version of the components as I could not reproduce this.
There is no uppercase and it is exported as "Segoe UI"


Default TAdvRichEditor on the form, font set to Segoe UI and export to HTML with:


I was able to reproduce it but it's a bit tricky. The issue seems to be related not in the AdvRichEditorMiniHTMLIO Save() method but the Load() one.

Here are the steps.

  1. Project with TAdvRichEditor + TAdvRichEditorFormatToolbar
  2. Select Segoe UI from the font selector combo box (TAdvRichEditor should says that its Font->Name is Segoe UI font.
  3. Write a text
  4. Save it with AdvRichEditorMiniHTMLIO
    5, Load the text with AdvRichEditorMiniHTMLIO->Load(TStream *) or AdvRichEditorMiniHTMLIO->Insert(UnicodeString HTMLString) (both methods seems to do the same)
  5. The font selected int the font selector combo box should looks like "SEGOE"
  6. If you export again the document it will save the font as SEGOE.

Obviously the issue is firstly related to the html loading routine and not the saving one. My bad. Sorry.

P.D. You can use the following html document. That's the one I used to do my testing:

<HTML><BODY style='font-family:"Segoe UI";font-style:normal;font-weight:normal;font-size:12pt'><FONT color="#000000">Hi,<BR><BR></FONT><FONT color="#000000">this&nbsp;is&nbsp;a&nbsp;text&nbsp;written&nbsp;in&nbsp;Segoe&nbsp;UI.<BR><BR></FONT><FONT color="#000000">If&nbsp;you&nbsp;load&nbsp;in&nbsp;the&nbsp;TAdvRichEdit&nbsp;with&nbsp;the&nbsp;TAdvRichEditorFormatToolbar,&nbsp;the&nbsp;font&nbsp;should&nbsp;appear&nbsp;as&nbsp;&quot;SEGOE&quot;&nbsp;(all&nbsp;capitals&nbsp;and&nbsp;truncated&nbsp;which&nbsp;is&nbsp;wrong.<BR><BR></FONT><FONT color="#000000">Regards.</FONT></BODY></HTML>

Hi, were you be able to reproduce the "SEGOE" issue following my steps?

Will the bullets issue (point 2 in my original message) be resolved in a next update?


The SEGOE font issue was solved.
In HTML export, standard HTML bullets <LI> are exported, the bullet style is not exported to HTML. In HTML this is supposed to be handled by CSS and you could add custom CSS to the HTML if you need other bullet symbols.

Ok. I'll do that then.