如何访问 Internet Explorer 的用户字体设置?

发布于 2024-07-15 09:53:46 字数 343 浏览 6 评论 0原文

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

我已经研究过 SHDocVw.WebBrowser 和 IHTMLDocument( 至 5) 但我没有看到我正在寻找的内容或缺少该属性。

BHO 适用于 Internet Explorer 7。

非常感谢!

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深空失忆 2024-07-22 09:53:46

你需要做的是在 CSS 中对 font-family 使用降级设置。

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

第一个字体是您要使用的字体,第二个字体是相似但更多用户拥有的字体,然后第三个字体是安全字体。 你可以继续,但这里有一个例子。

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

在此示例中,只有 Vista 和 Office 2008 有 Calibri,其他 Windows 计算机有 Arial,然后 Linux 计算机有 sans-serif。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文