Page 1 of 1

Set fixed font name - HTML export

Posted: Sat Aug 30, 2014 11:04 am
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

Posted: Sat Aug 30, 2014 11:19 am
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.

Posted: Sat Aug 30, 2014 11:25 am
by Testomatico
Thanks! That works fine.
Is there any possibility to remove the whole 'face' attribute?

Posted: Sat Aug 30, 2014 11:34 am
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.