title | description | type | page_title | slug | position | tags | res_type |
---|---|---|---|---|---|---|---|
RadPdfProcessing manually register font |
This topic shows you how to manually register a font and use it in a PDF document with PdfProcessing. |
how-to |
RadPdfProcessing manually register font |
load-fonts-with-net-standard |
0 |
pdf, register, fonts |
kb |
Product Version | Product | Author |
---|---|---|
2020.1.114 | RadPdfProcessing for Net Standard | Dimitar Karamfilov |
The RadPdfProcessing version for .NET standard does not look for the fonts on the operating system and falls back to the standard fonts.
Manually register the fonts in your application.
{{region kb-load-fonts-with-net-standard1}} 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);
{{endregion}}