Chrome 在 Windows (Vista) 中显示框来代替文本
对于我正在开发的网站,我使用多个 @font-face 来设置某些文本的样式。对于我的一种字体,它在 Mac 和 Windows 的所有浏览器中显示效果都很好,但 Windows 上的 Chrome 是个例外(Vista 和 Windows 7 中出现这种情况)。
在该浏览器中,正在使用字体,但文本的空格显示为框。
我检查了Mac版Chrome,不存在这个问题。我在网上查了一下,发现很多关于 Chrome 在无法正确渲染字符/字体(例如日语/中文网站)时显示方框/方块的内容。那里提到的解决方案(例如清除缓存或重新启动我的电脑)似乎都不起作用。
我不确定这些情况是否适用于此以及我的字体是否出现在网站上,但只有空格显示为正方形。我使用的任何其他 @font-face 字体都没有发生这种情况。
我在网上找到的其他解决方案包括确保本地安装了字体。这不是一个选项,因为我不能要求每个访问网站的人在他们的计算机上安装字体。
我会附上一个链接,但该项目现在位于开发服务器上。
还有其他人遇到过这个问题吗?有谁知道如何解决这个渲染问题吗?
For a website I am developing I am using multiple @font-face's to style certain texts. For one of my fonts, it displays great in all browsers for Mac and Windows with one exception, Chrome on Windows (It is happening in Vista & Windows 7).
In that browser the font is being used but the spaces for the text are being displaying as boxes.
I have checked Chrome for Mac and the problem does not exists. I have looked around online and found a lot of stuff about Chrome displaying boxes/squares when it cannot render the characters/fonts correctly such as with Japanese/Chinese sites. None of the solutions mentioned there, such as clearing the cache or restarting my comp, seem to be working.
I'm not sure any of those cases apply here as well as my font is appearing on the site but only the spaces appear as squares. This is not happening with any of the other @font-face fonts I'm using either.
Other solutions I have found online include making sure you have the font installed locally. This is not an option as I cannot ask everyone who visits a website to install a font on their computer.
I would attach a link but the project is on a developmental server right now.
Has anyone else run into this issue and does anyone have any idea how to fix this rendering problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了一个问题,似乎这些框只显示在文本的随机区域,并且只显示空格。
我的解决方案是打开纯文本编辑器并在纯文本编辑器中重新输入错误内容,然后将其粘贴回内容中。
就我而言,我正在与一位设计师合作,我正在从 AI 文件中复制文本,我想象有一些隐藏的字符被复制了。
I ran into a problem it seemed that the boxes only showed up for random areas of text, and only for spaces.
My solution was to open a plain text editor and retype the faulty content in the plain text editor and then paste it back into the content.
In my case, I was working with a designer and I was copying the text from an AI file and I imagine that there were some hidden characters that were being copied over.
我知道这是一篇非常古老的帖子,但为了防止那些挣扎者,让我提出我的解决方案..
就我而言,我用各种解决方案绞尽脑汁,但没有一个解决方案给我提供所有浏览器兼容性的工作结果。经过一番尝试后,我找到了一个解决方案,请遵循以下过程。
如果您输入了 nudi、bharaha 或任何非 unicode 字符,那么这将起作用(我的测试是在 nudi 上),
http://aravindavk.in/ascii2unicode/)
然后尝试下面的一段代码
<前><代码> <样式>
@font-face {
字体系列:kannadanudi;
src: url('https://github.com/googlei18n/noto-fonts/raw/master/unhinted/NotoSansKannada-Regular.ttf');
}
ನಮ್ಮಮಾತು
,在上面的代码中,您可以下载并提供本地字体路径,也可以直接链接 github url。无论如何,这就是我为解决问题所做的事情..提前致谢。如果有任何疑问,可以发表评论。
I know this is a very old post, but just in case for those strugglers let me produce my solution..
In my case, i cracked my brain with various solutions but none gave me working results with all browser compatibility.. after trying a bit I found a solution, which is to follow below procedure.
If you have typed in nudi,bharaha or any non-unicode characters then this will work(My test was on nudi)
http://aravindavk.in/ascii2unicode/)
then try a piece of code below
Where in which from the above code you can either download and give a local font path or u can directly link the github url. Anyhow this was what i did to conclude my problem.. Thank in advance. If any have doubts then can comment on it.
在今年尝试了许多不同的方法之后,我自己只是在寻找这个答案。我最终通过向字体生成器添加 unicode 字符解决了这个问题。
简短的答案是将其添加到 Unicode Range 的 Font Squirrel 设置中:
长答案可在以下问题中找到:Chrome 10/Windows @font-face 编码问题
I was just searching for this answer myself after trying many different approaches this year. I finally solved it by adding unicode characters to the font generator.
The short answer is to add this to your Font Squirrel settings for Unicode Range:
The long answer is available at this question: Chrome 10/Windows @font-face encoding trouble