1

我想在用 C# 编写的浏览器帮助器对象中访问 Internet Explorer 用户设置的字体,尤其是字体系列。

我查看了 SHDocVw.WebBrowser 和 IHTMLDocument(to 5) 但我没有看到我正在寻找或缺少的属性。

BHO 适用于 Internet Explorer 7。

非常感谢!

编辑:理查德问我为什么需要这些信息:如果系统上未安装 HTML 文档或 CSS 给定的字体系列,则使用您可以在 IE7 设置中调整的字体系列。我需要这个基于应用程序的字体系列,它用于在最后一个实例中呈现文本(如果所有其他信息都失败)。

4

1 回答 1

0

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.

于 2009-03-18T13:59:53.463 回答