Aspose Font Change

Hello Team,

Consider attached document is my Input Document. PAP_RS43733_GLB202304017_20230420154144.docx (88.5 KB)

I would like to change it’s font to be “Overpass” Font.

  1. How to change font to “Overpass” Font.
  2. What are the other fonts supported by Aspose word.
  3. If there is not “Overpass” font in Aspose Library what are other similar fonts have it in Aspose Word.

@rs43733

How to change font to “Overpass” Font.

To change the font of all your document you need to set the desired font to all the Run Nodes:

Document doc = new Document("C:\\Temp\\input.docx", new Aspose.Words.Loading.LoadOptions
{
    WarningCallback = new ConversionIssueCallBack()
});

var runs = doc.GetChildNodes(NodeType.Run, true);
foreach( Run run in runs )
{
    run.Font.Name = "Overpass";
}

doc.Save("C:\\Temp\\output.docx");

What are the other fonts supported by Aspose word.

Aspose.Words doesn’t have any restrictions regarding the fonts that you can use. If you have the font installed on your system (and accessible by the API), you can use it without limitations. In fact, you can set any font you want to the document, even if you don’t have it installed. Fonts are only required to render the document, so they only affect conversions to fixed document formats (like PDF) or the use of classes like LayoutCollection and LayoutEnumerator and accessing to properties such as PageCount (to get the number of pages). If you don’t have the font installed, Aspose.Words “replaces” that font with another similar font depending on the font you have installed.

If there is not “Overpass” font in Aspose Library what are other similar fonts have it in Aspose Word.

Aspose.Words API don’t encapsulate fonts it uses the fonts available in your system. If you don’t have the font installed, Aspose.Words “replaces” that font with another similar font depending on the font you have installed. You can be aware of font substitutions by implementing the IWarningCallback interface.