SIFR 文本对浏览器不可见查找命令

发布于 2024-12-08 07:53:45 字数 54 浏览 0 评论 0原文

用户无法使用 ctrl-f/cmd-f 查找 sifr 文本。是否可以为此功能配置 sifr?

Users are not able to find sifr text using ctrl-f/cmd-f. Is it possible to configure sifr for this functionality?

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

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

发布评论

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

评论(1

治碍 2024-12-15 07:53:45

不,事实并非如此。

SIFR(可扩展 Inman Flash 替换)定位 HTML 文档中的指定段落,并用 Flash 影片替换它们,以精美的字体打印出相同的文本。原始文本被保留,并且可以通过屏幕阅读器软件大声朗读,但隐藏在视图中。

遗憾的是,查找功能 (CTRL/CMD + F) 不适用于 Flash 影片。在幕后,每个被替换文本的区域实际上被视为由 Flash 操作的一个完整的独立窗口,而不是浏览器窗口的一个区域。因此,“查找”的突出显示或跳至功能将不适用于替换的文本,因为浏览器无法访问 Flash 的窗口。在某些浏览器中,“查找”可以通过查找留给屏幕阅读器的隐藏文本来“工作”;但由于它隐藏在视图之外,因此屏幕上没有任何变化来向用户表明其位置,这可能会令人沮丧。

我建议您查看 @font-face CSS 指令,它允许您嵌入自定义字体。 Font Squirrel 是一个有用的实用程序,用于生成具有多种字体的必要代码质量不错。由于@font-face在浏览器中工作,而不是在文档中叠加新窗口,因此查找功能将正常工作。并非所有浏览器都支持 @font-face,但大多数现代浏览器都支持。 对于较旧的浏览器,请照常在 CSS 中指定后备字体。

如果在旧版和新版浏览器中保持一致的字体对您来说确实很重要,您可以尝试混合方法:

  1. 对大多数浏览器使用 @font-face
  2. 使用 JavaScript 检测 @font-face 支持。
  3. 仅在不支持 SIFR 的浏览器中触发 SIFR支持@font-face

混合方法将产生最佳结果,但工作量相当大。它还会产生很多依赖性 - 您的页面不仅必须包含 @font-face 内容,还必须包含 SIFR 内容,这会增加页面的下载时间。因此,请仔细权衡您的选择。

No, it is not.

SIFR (Scalable Inman Flash Replacement) locates specified passages within an HTML document, and replaces them with Flash movies that print out the same text in a fancy font. The original text is preserved, and can be read aloud by screen reader software, but is hidden from view.

Sadly, the Find function (CTRL/CMD + F) will not work on the Flash movies. Under the hood, each area of replaced text is actually treated as a whole separate window being operated by Flash, rather than an area of the browser window. So the highlighting or skip-to functions of Find will not work on the replaced text, because the browser does not have access to Flash's windows. In some browsers, a Find may "work" by finding the hidden text left for screen readers; but because it is hidden from view, there is no change in the screen to signal its location to the user, which can be frustrating.

I would recommend looking into the @font-face CSS directive, which allows you to embed custom fonts. Font Squirrel is a helpful utility for generating the necessary code with a large variety of fonts of decent quality. Because @font-face works within the browser instead of superimposing new windows within the document, the Find function will work normally. Not all browsers support @font-face, but most modern browsers do. For older browsers, specify a fallback font in your CSS as usual.

If it is truly important to you to have a consistent typeface across both older and newer browsers, you could try a hybrid approach:

  1. Use @font-face for most browsers
  2. Use JavaScript to detect @font-face support.
  3. Trigger SIFR only in browsers that do not support @font-face.

The hybrid approach will yield the best results, but it's rather a lot of work. It also incurs a lot of dependencies -- your page has to include not just the @font-face stuff, but also the SIFR stuff, which will increase your page's download times. So weigh your options carefully.

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