Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
The following sample code creates a workbook, adds some text in cell B4 of the first worksheet, and sets its font to an unknown/non‑existing font. Then it saves the workbook in HTML by setting 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.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Create workbook object and access the first worksheet
Workbook wb;
Worksheet ws = wb.GetWorksheets().Get(0);
// Access cell B4 and add some text to it
Cell cell = ws.GetCells().Get(u"B4");
cell.PutValue(u"This text has some unknown or invalid font which does not exist.");
// Set the font of cell B4 to an unknown font
Style st = cell.GetStyle();
st.GetFont().SetName(u"UnknownNotExist");
st.GetFont().SetSize(20);
cell.SetStyle(st);
// Save the workbook in HTML format and set the default font to Courier New
HtmlSaveOptions opts;
opts.SetDefaultFontName(u"Courier New");
wb.Save(outDir + u"out_courier_new_out.htm", opts);
// Save the workbook in HTML format again but set the default font to Arial
opts.SetDefaultFontName(u"Arial");
wb.Save(outDir + u"out_arial_out.htm", opts);
// Save the workbook in HTML format again but set the default font to Times New Roman
opts.SetDefaultFontName(u"Times New Roman");
wb.Save(outDir + u"times_new_roman_out.htm", opts);
Aspose::Cells::Cleanup();
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.