views:

122

answers:

1

I would like to access the Internet Explorer user settings for fonts, especially the font family, within a Browser Helper Object written in C#.

I have looked into SHDocVw.WebBrowser and IHTMLDocument( to 5) but I don't see what I'm looking for or missing the property.

The BHO is for Internet Explorer 7.

Thank you very much!

Edit: Richard asks why I need this information: The font-family you can adjust in the IE7 settings is used if the given font-families by the HTML document or CSS are not installed on the system. I need this application-based font-family which is used to render the text in the last instance (if all other information fail).

A: 

What you need to do is use a degrading setting for the font-family in CSS.

font-family: "Font 1", "Font 2", "Font 3" // etc

The first font is the one you want to use, the 2nd one is the one that is similar but more users have, then the 3rd one is the safety font. You could keep going but here's an example.

font-family: "Calibri", arial, sans-serif

In this example only Vista and Office 2008 have Calibri, other Windows machines have Arial and then Linux machines have sans-serif.

Ólafur Waage
It is not what I asked for. I know how to get the fonts from the document. The more important thing is how I get the font which is used if none of the document fonts are valid for the display. And in that case the default font of the browser is used. And I need that one.
Mil
Ok then, the question wasn't that clear :)
Ólafur Waage