Set fixed font name - HTML export

General TRichView support forum. Please post your questions here
Post Reply
Testomatico
Posts: 15
Joined: Sat Mar 22, 2014 7:47 pm

Set fixed font name - HTML export

Post by Testomatico »

Hello,
my project requieres a fixed font face. So all fonts of the exported html code need to be, e.g., Arial (also if the texts are imported from a homepage).
The dirty way how I could realize this would be replacing all face='*' attributes of the html code via ReplaceString(). But I'm sure there is a more elegant solution.
I hope you can help.

Best regards
Testo
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The simplest solution is creating an invisible TRichView, load document in it, changing all its RVStyle.TextStyles[].FontName, and save it as HTML.
Testomatico
Posts: 15
Joined: Sat Mar 22, 2014 7:47 pm

Post by Testomatico »

Thanks! That works fine.
Is there any possibility to remove the whole 'face' attribute?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Include rvsoDefault0Style in the Options parameters of SaveHTML/SaveHTMLEx.
With this option, no properties will be saved for TextStyles[0]. Since properties of all other styles are saved relative to it (unless you include rvsoNoDefCSSStyle or rvsoInlineCSS options), if font names are identical for the whole text, they will not be saved at all.
Post Reply