Hi!
I am writing to report an issue with font rendering encountered in Aspose.Words version 25.1.0.
Problem description: When converting a .docx document containing text in the regular “Baskerville” font to PDF (or PNG), the font incorrectly renders as semi-bold. The Baskerville font family is installed system-wide for all users on my machine.
Expected behavior: The font weight should be preserved (regular) in the output PDF, matching the source DOCX.
Source file: Sample.docx (22.3 KB)
Converted file: Result.pdf (37.7 KB)
Font files used, contains original .ttc: Baskerville.zip (693.7 KB)
Code sample to reproduce:
var document = new Aspose.Words.Document(SourcePath);
document.LayoutOptions.TextShaperFactory = Aspose.Words.Shaping.HarfBuzz.HarfBuzzTextShaperFactory.Instance;
document.WarningCallback = new WordDocumentSubstitutionWarnings();
var saveOptions = Aspose.Words.Saving.SaveOptions.CreateSaveOptions(Aspose.Words.SaveFormat.Pdf);
saveOptions.UpdateFields = false;
document.Save(TargetPath, saveOptions);
The issue appears to be related to TrueType Collections (.ttc). When I split the Baskerville.ttc file into individual .ttf files (e.g., Baskerville.ttf , Baskerville-Bold.ttf ) and install those instead, the conversion works correctly, and the font weight is preserved.
This leads me to suspect that Aspose.Words might have difficulty correctly parsing or selecting the correct font weight from within a .ttc container.
Is there a way to resolve this issue while keeping the font in its original .ttc format, or is splitting the collection the only recommended workaround at this time?