Using OTF Fonts

Hello,

I am building a PDF that uses Minion Pro, an OpenType font. I’m having trouble getting Aspose to apply it; instead, it reverts to Times New Roman. If I set serifFont to, say, “Segoe Condensed”, the font is applied correctly, likely because it’s a TrueType font. Looking at this forum’s history, support said as recently as 2008 that there was no OpenType support. Has the situation changed since then? If so, what’s the minimum Aspose.Pdf version I need, and how do I need to change this code?

Thanks.

#region Styles
private const string serifFont = “Minion Pro Regular”;
private TextInfo defaultStyle = new TextInfo()
{
FontName = serifFont,
FontSize = 24
};
#endregion

public override void GenerateReport()
{
Text t = new Text(“2008 Jeep Wrangler Unlimited X”, defaultStyle);
CurrentSection.Paragraphs.Add(t);
}

Hello Will,

Thanks for using our products.

Aspose.Pdf for .NET supports fonts with OpenType Layout (I have tested it with Arimo) but I am not entirely certain about its compatibility with Minion Pro font that you are using. Can you please share the font file so that we can test the scenario at our end. We apologize for your inconvenience.

I have sent the fonts to you through PM.

Hello Will,

Thanks for sharing the fonts files.
<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>

I
have tested the scenario and I am able to notice that OpenType Fonts are not being honored during PDF generation. For the
sake of correction, I have logged it in our issue tracking system as PDFNET-29156. We will investigate this
issue in details and will keep you updated on the status of a correction.<span style=“font-size:10.0pt;
font-family:“Arial”,“sans-serif””>

We apologize for your inconvenience.

Is there a way to check the status of PDFNET-29156? I’m seeing this problem right now using aspose.pdf-20.6.jar

@jtmille3

We are afraid that the earlier logged ticket was related to an approach which has been obsolete and discontinued. However, you can please try using Aspose.PDF for .NET 21.5 to add a text using OTF font and let us know in case you face any issue by sharing your sample font file with us. We will further proceed to assist you accordingly.

I’ll create another post with a simplified example highlighting the problem when using Java. Thank you.

1 Like

@jtmille3

Sure, we will respond to that thread shortly.