CSS - font-variant-east-asian
The font-variant-east-asian
CSS property controls the usage of alternate glyphs for East Asian scripts, like Japanese and Chinese.
Examples
Example1
HTML
Copy Code
<p class="normal">!</p>
CSS
Copy Code
p { font-variant-east-asian: ruby; }
Result
Syntax
CSS
Copy Code
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;
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 activates the figures defined in specific standard. Possible values are:
Keyword Standard defining the glyphs OpenType equivalent jis78
JIS X 208 version 1978 jp78
jis83
JIS X 208 version 1983 jp83
jis90
JIS X 208 version 1990 jp90
jis04
JIS X 208 version 2004 jp04
simplified
None, use the simplified Chinese glyphs smpl
traditional
None, use the traditional Chinese glyphs trad
- <east-asian-width-values>
- These values controls the sizing of figures used for East Asian characters. Two values are possible:
proportional-width
activating the set of figures where numbers are not all of the same size. It corresponds to the OpenType valuespwid
.full-width
activating the set of figures where numbers are all of the same size, allowing them to be easily aligned like in tables. It corresponds to the OpenType valuesfwid
.
Formal syntax
CSS
Copy Code
normal <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> <a href="css/value_definition_syntax#brackets" title="Brackets">[</a> <a href="css/font-variant-east-asian#east-asian-variant-values"><east-asian-variant-values></a> <a href="css/value_definition_syntax#double_bar" title="Double bar">||</a> <a href="css/font-variant-east-asian#east-asian-width-values"><east-asian-width-values></a> <a href="css/value_definition_syntax#double_bar" title="Double bar">||</a> ruby <a href="css/value_definition_syntax#brackets" title="Brackets">]</a> <p>where <br><code><east-asian-variant-values> = <a href="css/value_definition_syntax#brackets" title="Brackets">[</a> jis78 <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> jis83 <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> jis90 <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> jis04 <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> simplified <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> traditional <a href="css/value_definition_syntax#brackets" title="Brackets">]</a><br><east-asian-width-values> = <a href="css/value_definition_syntax#brackets" title="Brackets">[</a> full-width <a href="css/value_definition_syntax#single_bar" title="Single bar">|</a> proportional-width <a href="css/value_definition_syntax#brackets" title="Brackets">]</a></code></p>
Description
The font-variant-east-asian
CSS property controls the usage of alternate glyphs for East Asian scripts, like Japanese and Chinese.
Initial value | normal |
---|---|
Applies to | all elements. It also applies to ::first-letter and ::first-line . |
Inherited | yes |
Media | visual |
Computed value | as specified |
Animatable | no |
Canonical order | order of appearance in the formal grammar of the values |
Specifications
Specification | Status | Comment |
---|---|---|
CSS Fonts Module Level 3 The definition of 'font-variant-east-asian' in that specification. |
Candidate Recommendation | Initial definition |
Feature | Firefox (Gecko) | Chrome | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 34 (34) [1] | ? | ? | ? | ? |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | ? | 34.0 (34)[1] | ? | ? | ? |
[1] Experimental implementation was available since Gecko 24. It was governed by the preference layout.css.font-features.enabled
defaulting to true
on Nightly and Aurora only.
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/css/font-variant-east-asian