Which fonts are supported by HTML editor in salesforce and how can one add a new font?
A Rich Text Area field uses the Salesforce WYSIWYG HTML editor. This editor doesn't let you directly work with the HTML, but does allow you to define the
style attribute. So if your browser can use the font, you should be fine.
You can copy the required HTML including the font requirements in the style then you can paste them into the WYSIWYG editor.
Alternatively, you can with directly with the field to define the font as required.
To the new question from the comments:
I am converting a html document to pdf using apex.So If I want to add a new font , how can I do it so converted pdf also displays text in same font.
Rendering to PDF is a much more restrictive operation.
Salesforce support 5 fonts when rendering Visualforce page to PDF.
Only the following four typefaces are used in PDF. Also, what you can use for font-family are on the right, mapped to the typefaces respectively, where sans-serif, monospace and serif are case insensitive.
- Helvetica : Dialog, SansSerif or sans-serif
- Courier : Courier, DialogInput, Monospaced or monospace
- Times : Times, TimesRoman or serif (or any others inapplicable to the others would be mapped to this)
- Arial Unicode MS : Arial Unicode MS
Snapshot of the source Knowledge Article from the wayback machine before the link was broken. It appears the full text from the source knowledge article was also published at https://trailblazers.salesforce.com/answers?id=90630000000hrLzAAI