Fonts Falling back even after specifying font folders in Docx to HTML Conversion

Please find the snippet below

List<com.aspose.words.FolderFontSource> folderFontSources = new ArrayList<com.aspose.words.FolderFontSource>();
   for (String fontFolder : m_fileData.getFontFolders()) {
     LOG.debug("Adding folder with path: " + fontFolder + " to word font folder sources.");
       folderFontSources.add(new com.aspose.words.FolderFontSource(fontFolder, true));
    }
   FontSourceBase[] updatedFontSources = (FontSourceBase[]) folderFontSources.toArray(new FontSourceBase[folderFontSources.size()]);
    FontSettings.getDefaultInstance().setFontsSources(updatedFontSources);
    // set options on generated file
   m_wordSaveOptions = new com.aspose.words.HtmlFixedSaveOptions();
    m_wordSaveOptions.setSaveFormat(SaveFormat.HTML_FIXED);
    m_wordSaveOptions.setEncoding(Charset.defaultCharset());
    m_wordSaveOptions.setExportEmbeddedFonts(true);
    m_wordSaveOptions.setExportEmbeddedCss(true);
	m_wordSaveOptions.setExportEmbeddedImages(true);
	m_wordSaveOptions.setExportEmbeddedSvg(true);
	m_wordSaveOptions.setExportFormFields(true);
	m_wordSaveOptions.setPrettyFormat(true);
	m_wordSaveOptions.setUseHighQualityRendering(true);
	m_wordSaveOptions.setJpegQuality(90);
	m_wordSaveOptions.setPageCount(Integer.MAX_VALUE);
	m_wordSaveOptions.setPageMargins(10);
	m_wordSaveOptions.setShowPageBorder(false);
	m_wordSaveOptions.setDmlEffectsRenderingMode(2);
	m_wordSaveOptions.setDmlRenderingMode(1);
	m_wordSaveOptions.setDefaultTemplate("");
	m_wordSaveOptions.setFontFormat(ExportFontFormat.WOFF);
	m_wordSaveOptions.setOptimizeOutput(true);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();

    if (m_fileData.getSourceFileTypeCode().intValue() == FILE_FORMAT_DOCX_CODE ||
      m_fileData.getSourceFileTypeCode().intValue() == FILE_FORMAT_DOCM_CODE ||
      m_fileData.getSourceFileTypeCode().intValue() == FILE_FORMAT_DOC_CODE) {
      
    	// Load source document
      Document doc = new Document(m_fileData.getSourceFileFullPath());
      // Generate docs
      doc.setFontSettings(FontSettings.getDefaultInstance());
      doc.save(outStream, m_wordSaveOptions);

If I am running the conversion in a machine by specifying font folders, the font is still not displayed in the rendered HTML, however, we were able to see the font for the same in pdf.Please help us with this issue

@Raghul_Vishnu

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output HTML file that shows the undesired behavior.
  • Please attach the expected output HTML file that shows the desired behavior.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Please find the below file with the expected documents

Aspose Font Not Shown.zip (382.6 KB)

@Raghul_Vishnu

We have tested the scenario using the latest version of Aspose.Words for Java 21.5 and have not found the shared issue. So, please use Aspose.Words for Java 21.5.