是svg字体表面声明必须的哈希吗? [英] Is the hash necessary in svg font-face declarations?

查看:111
本文介绍了是svg字体表面声明必须的哈希吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

@font-face
  font-family: 'AllerRegular'
  src: url('/fonts/aller/aller_rg-webfont.eot')
  src: url('/fonts/aller/aller_rg-webfont.eot?#iefix') format('embedded-opentype'), url('/fonts/aller/aller_rg-webfont.woff') format('woff'), url('/fonts/aller/aller_rg-webfont.ttf') format('truetype'), url('/fonts/aller/aller_rg-webfont.svg#AllerRegular') format('svg')
  font-weight: normal
  font-style: normal

我添加了一个svg版本的这个字体,但我不知道ID是否正确。如果这个SVG中只有一种字体需要有正确的id?

In the example above, I'm adding an svg version of this font but I'm not sure the ID is correct. If there is only one font included in this SVG is it necessary to have the correct id?

推荐答案

本文说:


在上面的CSS代码中,你可以看到SVG版本需要一个额外的信息,它的ID,在文件名
声明中的hashtag(#)之后。如果你不填写它,它不工作,所以你需要
找到这个信息在TXT文档或
记事本中打开SVG文件,并在页面顶部寻找以下行。 / p>

In the CSS code above, you can actually see that the SVG version needs an extra info, its ID, after the hashtag (#) in the file name declaration. If you don’t fill it it’s not working, so you need to find this information opening the SVG file in a TXT document or notepad and look for the following line, near the top of page.

这一个说:


对于SVG字体,它们还需要一个#hashtag;

With SVG fonts, they also need a #hashtag;

hashtag只是一个指向SVG中定义的字体ID的指针。如果不包括它,整个SVG文件将被加载,包括防止字体被识别的SVG头。

The hashtag is simply a pointer to the ID of the font defined inside the SVG. If you don't include it, the whole SVG file will be loaded, including SVG headers that prevent the font from being recognized.

这篇关于是svg字体表面声明必须的哈希吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆