简体   繁体   中英

How to access the user font settings of the Internet Explorer?

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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM