Set Default Font while rendering spreadsheet to HTML with Golang via C++
Contents
[
Hide
]
Aspose.Cells allows you to set the default font while rendering a spreadsheet to HTML. Use the HtmlSaveOptions.GetDefaultFontName() method for this purpose. This property is useful when some cells in a spreadsheet specify invalid or non‑existent fonts; those cells will be rendered using the font defined by the HtmlSaveOptions.GetDefaultFontName() property.
Set Default Font while rendering spreadsheet to HTML
The following sample code creates a workbook, adds some text to cell B4 of the first worksheet, and sets its font to an unknown or non‑existent font. It then saves the workbook as HTML while specifying different default font names such as Courier New, Arial, Times New Roman, etc.
The screenshot shows the effect of setting different default font names via the HtmlSaveOptions.GetDefaultFontName() property.

The code generates the output HTML file with Courier New, the output HTML with Arial, and the output HTML file with Times New Roman.