SIFR 文本对浏览器不可见查找命令
用户无法使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,事实并非如此。
SIFR(可扩展 Inman Flash 替换)定位 HTML 文档中的指定段落,并用 Flash 影片替换它们,以精美的字体打印出相同的文本。原始文本被保留,并且可以通过屏幕阅读器软件大声朗读,但隐藏在视图中。
遗憾的是,查找功能 (CTRL/CMD + F) 不适用于 Flash 影片。在幕后,每个被替换文本的区域实际上被视为由 Flash 操作的一个完整的独立窗口,而不是浏览器窗口的一个区域。因此,“查找”的突出显示或跳至功能将不适用于替换的文本,因为浏览器无法访问 Flash 的窗口。在某些浏览器中,“查找”可以通过查找留给屏幕阅读器的隐藏文本来“工作”;但由于它隐藏在视图之外,因此屏幕上没有任何变化来向用户表明其位置,这可能会令人沮丧。
我建议您查看
@font-face
CSS 指令,它允许您嵌入自定义字体。 Font Squirrel 是一个有用的实用程序,用于生成具有多种字体的必要代码质量不错。由于@font-face在浏览器中工作,而不是在文档中叠加新窗口,因此查找功能将正常工作。并非所有浏览器都支持@font-face
,但大多数现代浏览器都支持。 对于较旧的浏览器,请照常在 CSS 中指定后备字体。如果在旧版和新版浏览器中保持一致的字体对您来说确实很重要,您可以尝试混合方法:
@font-face
@font-face
支持。@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:
@font-face
for most browsers@font-face
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.