Hello,
I try to use some extra fonts in my code but as soon as I try to use theses fonts my output document is 0kb. I tried with a OpenType Font and a TrueType Font file but without success. The two fonts are attached to my post so you can make a test using them.
// Colors
Color rosa = new Color(241, 0, 135);
// Translations
Dictionary<string, string> translations = new Dictionary<string, string>();
translations.Add(“typeDeBillet”, “billet type service horaire”);
Pdf pdf = new Pdf();
pdf.IsFontNotFoundExceptionThrown = true;
Section headerSection = pdf.Sections.Add() ;
HeaderFooter header = new HeaderFooter(headerSection) ;
headerSection.OddHeader = headerSection.EvenHeader = header;
header.IsFirstPageOnly = true;
Text textBilletType = new Text(header);
header.Paragraphs.Add(textBilletType);
//Create a text segment
Aspose.Pdf.Generator.Segment s1 = new Aspose.Pdf.Generator.Segment(translations[“typeDeBillet”]);
textBilletType.Segments.Add(s1);
//Set the font name to the TextInfo.FontName property of segment, where ‘Almonto Snow’ is custom font name
// That one works
s1.TextInfo.FontName = “Symbol”;
// That one fails
//s1.TextInfo.FontName = “Gotham Light”;
s1.TextInfo.IsFontEmbedded = true ;
//Save the Pdf
pdf.Save(@“C:\Test.pdf”);
Any help would be appreciated