Answer the question
In order to leave comments, you need to log in
How to embed a font in WebBrowser?
C#\WinForms\Visual Studio 2019
How is it possible to embed the font " Embedded Resource " in WebBrowser to change the pages default font?
Or it may be possible to replace the Resource Handler to replace the request by issuing a font at a non-existent address. Those. in html, insert css with font loading at " font://anyfont.ttf " and issue a font file on this request via Assembly (GetManifestResourceStream).
Or maybe there are some other options how to load exactly the font built-in (Embedded Resource) , and not lying next to it in the folder?
Answer the question
In order to leave comments, you need to log in
Regularly, as far as I know, there is no way to make embedded resources, more precisely, it will not work just to register your protocol inside the application.
Therefore, we inject the necessary elements onto the page, in the form of a data uri scheme (the file is encoded in the url as a string, for example data:application/vnd.ms-opentype;base64,iVB...==
, tracking onload or according to some other conditions. By the
way, .net WebBrowser is still internet explorer 11 with all the troubles that follow from here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question