The custom FontSettings have higher priority than the default instance.Ī text in a document can be formatted with various fonts, such as Arial, Times New Roman, Verdana, and others. In this case, you can just amend the default instance as follows: If you are sure that all processing documents require the same font settings, then it is recommended to set up and utilize the default FontSettings instance. Suppose that you need to use the same font sources for all your documents. This instance is also automatically shared among documents, and can be extracted as follows: In the case when FontSettings is not defined explicitly, Aspose.Words uses the default FontSettings instance.
For example, you can share an instance of the FontSettings class between different documents, which allows you to speed up the loading of the documents. However, each instance of FontSettings has its own cache, which could reduce the processing time of subsequent documents. Since the procedure described above is time-consuming, it may negatively affect application performance at its first launch.
After all the fonts are retrieved, Aspose.Words uses these details to find the required font data or a suitable replacement for the requested font.
When Aspose.Words encounters a font in the document for the first time, it attempts to obtain basic font information, such as the font full name, family name, version, style, from the font files located in each font source.
Differences in Processing of Font Formats in Aspose.Words and Microsoft WordĪspose.Words requires TrueType fonts for a variety of tasks, including rendering documents to fixed-page formats, for example, PDF or XPS. When Aspose.Words renders a document, it needs to perform embedding and subset embedding of TrueType fonts into the resulting document, which is a normal practice during a document generation, including popular PDF or XPS formats.
How to Recognize That the Font Was Replaced.Font Manipulation and Performance Issues.