CSS 字体链接
我在想如何将 css 中的 font-family 链接到文件夹中的字体。与 PHP 一样,您可以在文件夹中使用您的字体。
示例代码:
CSS: font-family: verdana; This is what I mean: font-family: foldername/font
有相关代码吗?或者我必须使用PHP来浏览我自己的字体?
I was wandering how can I link font-family in css to a font in your folder. Like PHP you can use your font in your folder.
Example Code:
CSS: font-family: verdana; This is what I mean: font-family: foldername/font
Is there a code for that? or I have to use PHP to browse my own font?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
刚刚在“A List Apart”上找到了这个,还没有检查过自己,但这个网络专家是在线设计师最受尊敬的资源之一,所以我想你最好的机会就是尝试一下。
Just found this one on "A List Apart", haven't checked myself but this webbie is one of the most respectful resources for designers online so i guess your best shot is to give it a try.
这是不可能的:
浏览器从客户端计算机的特定位置读取字体,您不能以这种方式更改它。
It is not possible do like:
Fonts are read by the browser from the client machine from a specific location, you can not change it that way.
约旦,
这应该可以帮助您:
使用@font-face
Jordan,
This should help you:
Using @font-face
你误解了这一点。 PHP 可以使用服务器端字体来生成图像。字体本身永远不会向客户端显示,而只是呈现的结果。
为了能够在用户的浏览器中使用非标准字体,您必须将字体与站点一起打包。
有多种技术可以做到这一点,所有技术都具有不同程度的浏览器支持。 此处这是一篇关于各种可用技术及其优点和缺点的好文章。另请查看重复链接。
请注意,仅仅因为您购买了字体,这并不一定意味着您可以重新分发嵌入到网站中的字体! 请务必检查您的字体许可证。
You are misunderstanding this. PHP can use server-side fonts to generate an image. The font itself is never shown to the client, just the rendered results.
To be able to use a non-standard font in the user's browser, you will have to package the font along with the site.
There are various techniques to do this, all with various degrees of browser support. Here's a good article on the various available techniques, their upsides and downsides. Also check out the duplicate link.
Note that only because you paid for a font, this does not mean necessarily that you are allowed to re-distribute it embedded in a web site! Always check your font license.