我可以使用CSS的"unicode-range"在整个(第三方)页面上指定字体? [英] Can I use CSS "unicode-range" to specify a font across an entire (third party) page?

查看:61
本文介绍了我可以使用CSS的"unicode-range"在整个(第三方)页面上指定字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从不流利使用CSS,但我认为以前没有这种情况.

我正在考虑使用

unicode范围的CSS描述符设置字符的特定范围从@ font-face定义的字体下载并可用在当前页面上使用.

示例:

  @ font-face {字体家族:"Ampersand";src:local('Times New Roman');unicode范围:U + 26;} 

支持:> CanIUse.com

另请参见 文章

I've never become fluent with CSS but I don't think I had this situation before.

I'm thinking of using stylish to add CSS to a third-party site over which I have no direct control. So the HTML and CSS is not really set up for the kind of customizations I want to do.

The site I wish to tweak doesn't allow good control over fonts but some of its pages (user created) make a lot of use of some exotic Unicode ranges (eg. Khmer) that my OS/browser combination choose a terrible font for:

Can I make a CSS rule that will apply to all text in a page that falls within a certain Unicode range to set it to a known good font, without delving into the structure of the page HTML/DOM?

(Or is unicode-range only for doing something different with webfonts?

解决方案

The answer is yes in most browsers

MDN - Unicode Range

The unicode-range CSS descriptor sets the specific range of characters to be downloaded from a font defined by @font-face and made available for use on the current page.

Example:

@font-face {
  font-family: 'Ampersand';
  src: local('Times New Roman');
  unicode-range: U+26;
}

Support: CanIUse.com

Also see this Article

这篇关于我可以使用CSS的"unicode-range"在整个(第三方)页面上指定字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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