您的位置:首页 > 运维架构

#259 – 对使用OpenType 字体的文本进行排版(Setting Typography Properties for Text Rendered with an OpenType Font)

2016-09-12 16:10 477 查看
WPF有一个可以通过设置文本元素附加属性对文本进行排版的排版类Typography 。但是这些属性仅对使用 OpenType 字体的文本有效。

Typography 允许你指定下面的内容:

 -上标和下标

 -设置大写格式以及大写字符间的间距

 -连字(Ligatures ),字符间连写

 -花体

 -备用项

 -数字样式

 -版式

下面是一个例子,指定某些字符使用small capitals(小体大写)

<TextBlock Margin="20" Width="250" Height="55"
FontFamily="Constantia" FontSize="14"
TextWrapping="Wrap">
We secure our friends not by accepting favors but by doing them.
<Run Typography.Capitals="SmallCaps">--Thucydides</Run>
</TextBlock>





可以看到Thucydides文本的显示都是大写,但字体明显偏小。

原文地址:https://wpf.2000things.com/2011/03/28/259-setting-typography-properties-for-text-rendered-with-an-opentype-font/



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐