How can I apply my own font in TextFragment?

Hii,

I want to apply my font (not default fonts that comes with windows) on all TextFragments of TextFragmentCollection.
I tried with following code
textFragment.TextState.Font = FontRepository.FindFont(“Arial”);
which works perfectly fine.
But I need to replace Arial with my own font. And if I just replace “Arial” with my font name it says "Font MyFontName not found."
How to do this?

Hi Ruchi,


Thanks for contacting support.

In order to use the font, it must be installed over the system. In case you are still facing any problem, please share the font file so that we can test the scenario in our environment. We are sorry for your inconvenience.

Hi,

Yes, Font is installed on my machine (Windows 7) , Still I am facing the problem.
My Font is a Hindi Font and attached here for your reference. Please change the extension as ttf instead of txt in attached file.

I tried following line of code -
textFragment.TextState.Font = FontRepository.FindFont(“DVOT-Yogesh”);

Which says font not found.

Hi Ruchi,


Thanks for sharing the resource file.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-37988. We will
investigate this issue in details and will keep you updated on the status of a
correction. <o:p></o:p>

We apologize for your inconvenience.

Thanks.


Any updates in this regard?


Hi Ruchi,

Thanks for your inquiry. I am afraid we have recently noticed the issue and yet it is pending for investigation due to the issues already under investigation. As soon as its investigation is completed then we will be in a good position to share ETA for the fix. We will keep you updated about the issue resolution progress.

Thanks for your patience and cooperation.

Best Regards,

The issues you have found earlier (filed as PDFNET-37988) have been fixed in Aspose.PDF for .NET 18.10.