kug*_*sha 8 xhtml html5 fonts css3 opentype
我现在正在开发一个项目,在OpenType字体中有几个相同字符的变体.所有字符都具有相同的Unicode ID,但具有不同的GID编号和其他一些参考,如Swash或Stylistic SetXX(ss01)(在indesign中找到此信息).有没有办法在HTML文档中使用这些字符?
示例:J(正常),J(具有速度模糊),J(由链组成),所有具有unicode ID:004A,但GID值分别为43,206和233.
我没有听说过font-variant-alternates
,但我知道Firefox 4及更高版本支持-moz-font-feature-settings
,它允许您通过CSS应用OpenType功能.
来自Mozilla Hacks博客文章的moz-font-feature-settings
示例代码:
.altstyles {
/* format: feature-tag=[0,1] with 0 to disable, 1 to enable */
/* dlig = discretionary ligatures, ss01 = stylistic set 1 */
-moz-font-feature-settings: "dlig=1,ss01=1";
}
Run Code Online (Sandbox Code Playgroud)
据我所知,还没有其他浏览器支持类似的功能.
font-variant-alternates 是你想要的:http://www.w3.org/TR/css3-fonts/#font-variant-alternates-prop
我还不知道它的支持范围有多大,并且我敢打赌它不在 IE 中。
此页面显示了对 OTF 的总体支持:http://caniuse.com/#feat=ttf;从这个意义上来说,完全支持是否真的完全还不清楚。
Firefox 和 IE 支持的演示:http://ie.microsoft.com/testdrive/Graphics/opentype/opentype-fontfont/index.html