Hi Ondrej,
Hi,
Hi Ondra,
<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>I am afraid the requested feature is currently not supported. For
the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-36819 under new features list. 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.
Hi Ondra,
FolderFontSource fs = new FolderFontSource(myDir);<o:p></o:p>
FontRepository.Sources.Add(fs);
Aspose.Pdf.Text.Font font = FontRepository.FindFont(desiredFontName);
FontRepository.Sources.Clear();
FolderFontSource fs = new FolderFontSource(myDir);
FontRepository.Sources.Add(fs);
Document doc = new Document();
Page page = doc.Pages.Add();
TextFragment text = ReadText(myDir + "Sample.txt");
//Disconnect system font directory to exclude conflicts with a system font Frutiger if it exists
FontRepository.Sources.Clear();
//Connect custom font directory
FolderFontSource fs = new FolderFontSource(myDir + @"\Fonts");
FontRepository.Sources.Add(fs);
text.TextState.Font = FontRepository.FindFont("Frutiger-Normal");
text.TextState.FontSize = 14;
page.Paragraphs.Add(text);
text = ReadText(myDir + "VerdanaText.txt");
//Here we must use system font Verdana, so to void font name conflicts we connect only system directory to FontRepository.Sources
FontRepository.Sources.Clear();
SystemFontSource systemSource = new SystemFontSource();
FontRepository.Sources.Add(systemSource);
text.TextState.Font = FontRepository.FindFont("Verdana");
text.TextState.FontSize = 14;
page.Paragraphs.Add(text);
doc.Save(myDir + "out.pdf");
private TextFragment ReadText(string fileName)
{
TextFragment text;
TextReader tr = new StreamReader(fileName);
using (tr)
{
text = new TextFragment(tr.ReadToEnd());
}
return text;
}