ArthurHub / HTML-Renderer

Cross framework (WinForms/WPF/PDF/Metro/Mono/etc.), Multipurpose (UI Controls / Image generation / PDF generation / etc.), 100% managed (C#), High performance HTML Rendering library.
https://htmlrenderer.codeplex.com/
BSD 3-Clause "New" or "Revised" License
1.25k stars 527 forks source link

How to add custom/private font? #122

Open lobodava opened 6 years ago

lobodava commented 6 years ago

I have installed PdfSharp + HTML-Renderer. Both are of the latest possible versons. PdfSharp has a new FontResolver since of version 1.50 beta 2 http://www.pdfsharp.net/wiki/FontResolver-sample.ashx

If to create and apply this FontResolver, PdfSharp itself resolves and loads custom/private fonts correctly, but HTML-Renderer does not.

If there is no font with a certain name in the system, HTML-Renderer does not resolve it with FontResolver — it first substitute familyName with 'Segoe UI' and only after that calls the FontResolver. If a font is installed, HTML-Renderer recognises it and passes the familyName to the FontResolver.

I need to resolve two fonts and as workaround I use well-known fonts in css like Verdana, Tahoma, Impact, and replace them with custom/private fonts in the FontResolver.

Is it a bug or I just have not found the right way to let HTML-Renderer know about the custom/private fonts?

superboy1984 commented 6 years ago

The same question

ayatim commented 5 years ago

Same Question here :). @lobodava did you manage to find a solution for that ?

POPCORNBOOM commented 2 years ago

The same question