ASPOSE word family custom fonts

Hi ,

when we add custom fonts ASPOSE considering only custom fonts to replace when no fonts found. Its not considering the default fonts in the system.

Example: in word document we have two fonts one is claibri and barcode fonts. Both the fonts are not available in linux machine.

when two fonts are available ASPOSE using the linux default fonts to render.
But when we provide the custom font barcode, ASPOSE considering only barcode font and applying this font for entire document (ASPOSE using barcode in place of claibri, its not using linux default font when no claibri font found).

Below is the code snippet that we are using for custom fonts

FontSourceBase[] fontSources = FontSettings.getDefaultInstance().getFontsSources();
FolderFontSource customFonts = new FolderFontSource( “custom fonts location”, true );
List newFontSources = new ArrayList<>();
if ( fontSources != null )
{
for ( FontSourceBase src : fontSources )
{
newFontSources.add( src );
}
}
newFontSources.add( customFonts );
FontSettings.getDefaultInstance()
.setFontsSources( newFontSources.toArray( new FontSourceBase[newFontSources.size()] ) );

Thanks,
Nagendra.

@nyanamadala900014

We suggest you please read the following articles.
How to Get Available Fonts for Rendering
Specifying Fonts to be Read from both the System Fonts Folder and a Custom Folder

Please check the available fonts on the machine where are you converting DOCX to PDF. Moreover, you can use FontSettings.SubstitutionSettings property as shown below.

doc.FontSettings.SubstitutionSettings.FontInfoSubstitution.Enabled = true;
doc.FontSettings.SubstitutionSettings.TableSubstitution.AddSubstitutes("Calibri", new string[] { "Arial" });