10 Answers, 1 is accepted
Hi Roland,
I have tested this with the following code and it works on my side:
var document = new RadFixedDocument();
var page = document.Pages.AddPage();
var editor = new FixedContentEditor(page);
Block block = new Block();
block.TextProperties.Font = FontsRepository.TimesRoman;
block.InsertText("100€");
editor.Position.Translate(100, 100);
editor.DrawBlock(block);
var provider = new PdfFormatProvider();
File.WriteAllBytes(@"..\..\result.pdf", provider.Export(document));
Please note that if this is a .NET Framework application you can use the fonts available on the operating system. For example:
Block block = new Block();
block.InsertText(new FontFamily("Segoe UI"), "100€");
I hope this helps. Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hello Roland,
Is this a .NET Framework or .NET Core/Standart application? What is the default culture on your operating system? Which version of the PdfPorcessing library are you using?
I am looking forward to your reply.
Regards,
Dimitar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

used to be .NET Core 3.1, now .NET 5
The server OS culture is nl-NL, my PC OS culture is en-US, my browser language is English, but the application forces the current culture and [""Accept-Language"] request header to nl-NL.Currency is written with a € (and all the right delimiters and separators) as expected, but that never shows up in the PDF.

Hi Roland,
When using the version for NET Standart, the fonts must be manually registered or you can use one of the predefined fonts in the repository. By default, the Helvetica font is used and it does not contain the euro symbol. Detailed information about this is available in the following articles:
Here is how you can register the font and use the example from the previous post (you can copy the font from the C:|Windows\Fonts folder):
var fontData = File.ReadAllBytes(@"..\..\..\SEGOEUI.TTF");
FontsRepository.RegisterFont(new FontFamily("Segoe UI"), FontStyles.Normal, FontWeights.Normal, fontData);
var document = new RadFixedDocument();
var page = document.Pages.AddPage();
var editor = new FixedContentEditor(page);
Block block = new Block();
block.InsertText(new FontFamily("Segoe UI"), "100€");
editor.Position.Translate(100, 100);
editor.DrawBlock(block);
var provider = new PdfFormatProvider();
File.WriteAllBytes(@"..\..\..\result.pdf", provider.Export(document));
Let me know if you have any other questions.
Regards,
Dimitar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

>By default, the Helvetica font is used and it does not contain the euro symbol.
Nor do the others...
Registering a font from my PC seems to work, but how do I set the font once for an entire document instead of having to change every block.InsertText()?
Hi Roland,
You can set the TextProperties.Font and this way all text added after that will use this font. Here is an example of this:
FontBase font;
FontsRepository.TryCreateFont(new FontFamily("Segoe UI"), FontStyles.Normal, FontWeights.Normal, out font);
editor.TextProperties.Font = font;
Block block = new Block();
block.InsertText("100€");
editor.Position.Translate(100, 100);
editor.DrawBlock(block);
editor.Position.Translate(100, 150);
editor.DrawText("Test 100€");
Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

the combination
editor.TextProperties.Font = font;
block.InsertText("100€");
seems to be highly unreliable.
If I load font arial.ttf with fontfamily name "arial", I cannot print a €.
Exact same font with name "Arial" suddenly works as expected.
I will stick to block.TextProperties.Font = font; for now
Hi Roland,
The font names are case sensitive and you need to use the correct name when creating a font (this is indeed a bit tricky at first). You can check the font names in MS Word in case you are wondering about a particular case.
In addition, you can fallback to a particular font in case you decide to get the fonts from the operating system:
FontBase font;
if (!FontsRepository.TryCreateFont(new FontFamily("Arial"), FontStyles.Normal, FontWeights.Normal, out font))
{
font = FontsRepository.TimesRoman;
}
Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.