font-variant-east-asian - CSS: Cascading Style Sheets 编辑

The font-variant-east-asian CSS property controls the use of alternate glyphs for East Asian scripts, like Japanese and Chinese.

font-variant-east-asian: normal;
font-variant-east-asian: ruby;
font-variant-east-asian: jis78;              /* <east-asian-variant-values> */
font-variant-east-asian: jis83;              /* <east-asian-variant-values> */
font-variant-east-asian: jis90;              /* <east-asian-variant-values> */
font-variant-east-asian: jis04;              /* <east-asian-variant-values> */
font-variant-east-asian: simplified;         /* <east-asian-variant-values> */
font-variant-east-asian: traditional;        /* <east-asian-variant-values> */
font-variant-east-asian: full-width;         /* <east-asian-width-values> */
font-variant-east-asian: proportional-width; /* <east-asian-width-values> */
font-variant-east-asian: ruby full-width jis83;

/* Global values */
font-variant-east-asian: inherit;
font-variant-east-asian: initial;
font-variant-east-asian: unset;

Syntax

Values

normal
This keyword leads to the deactivation of the use of such alternate glyphs.
ruby
This keyword forces the use of special glyphs for ruby characters. As these are usually smaller, font creators often designs specific forms, usually slightly bolder to improve the contrast. This keyword corresponds to the OpenType values ruby.
<east-asian-variant-values>
These values specify a set of logographic glyph variants which should be used for display. Possible values are:
KeywordStandard defining the glyphsOpenType equivalent
jis78JIS X 0208:1978jp78
jis83JIS X 0208:1983jp83
jis90JIS X 0208:1990jp90
jis04JIS X 0213:2004jp04
simplifiedNone, use the simplified Chinese glyphssmpl
traditionalNone, use the traditional Chinese glyphstrad
<east-asian-width-values>
These values control the sizing of figures used for East Asian characters. Two values are possible:
  • proportional-width activating the set of East Asian characters which vary in width. It corresponds to the OpenType values pwid.
  • full-width activating the set of East Asian characters which are all of the same, roughly square, width metric. It corresponds to the OpenType values fwid.

Formal definition

Initial valuenormal
Applies toall elements. It also applies to ::first-letter and ::first-line.
Inheritedyes
Computed valueas specified
Animation typediscrete

Formal syntax

normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]

where
<east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]
<east-asian-width-values> = [ full-width | proportional-width ]

Examples

Setting East Asian glyph variants

This example require font "Yu Gothic" installed in your OS, other fonts may not support OpenType features.

HTML

<table>
<thead></thead>
<tbody style="border:0;">
  <tr>
    <th>normal/jis78:</th>
    <td>麹町</td>
    <td class="jis78">麹町</td>
  </tr>
  <tr>
    <th>normal/ruby:</th>
    <td>しんかんせん</td>
    <td class="ruby">しんかんせん</td>
  </tr>
  <tr>
    <th>normal/traditional:</th>
    <td>大学</td>
    <td class="traditional">大学</td>
  </tr>
</tbody>
</table>

CSS

td{
  font-family:"Yu Gothic";
  font-size:20px;
}
th{
  color:grey;
  padding-right:10px;
}

.ruby {
  font-variant-east-asian: ruby;
}

.jis78 {
  font-variant-east-asian: jis78;
}

.traditional{
  font-variant-east-asian: traditional;
}

Result

Specifications

SpecificationStatusComment
CSS Fonts Module Level 3
The definition of 'font-variant-east-asian' in that specification.
RecommendationInitial definition

Browser compatibility

BCD tables only load in the browser

See Also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:89 次

字数:10325

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文