RadPdfProcessing manually register font
Product Version | Product | Author |
---|---|---|
2020.1.114 | RadPdfProcessing for Net Standard | Dimitar Karamfilov |
Problem
The RadPdfProcessing version for .NET standard does not look for the fonts on the operating system and falls back to the standard fonts.
Solution
Manually register the fonts in your application.
var fontData = File.ReadAllBytes(@"......\Roboto-Bold.TTF");
FontsRepository.RegisterFont(new FontFamily("Roboto"), FontStyles.Normal, FontWeights.Bold, fontData);
Block block = new Block();
block.InsertText(new FontFamily("Roboto"), FontStyles.Normal, FontWeights.Bold, "Text");
editor.Position.Translate(100, 100);
editor.DrawBlock(block);