#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(小体大写)
可以看到Thucydides文本的显示都是大写,但字体明显偏小。
原文地址:https://wpf.2000things.com/2011/03/28/259-setting-typography-properties-for-text-rendered-with-an-opentype-font/
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/
相关文章推荐
- Open quote is expected for attribute "{1}" associated with an element type "name".
- Open quote is expected for attribute "name" associated with an element type "item".
- 配置c3p0-config.xml报错:Open quote is expected for attribute "name" associated with an element type "pro
- Open quote is expected for attribute "property" associated with an element type "result".错误
- Open quote is expected for attribute "{1}" associated with an element type "type".
- Register an InstanceCreator with Gson for this type to fix this problem.
- no lable views point to this text field with an android:lablFor=”@+id/@+id
- 安卓应用程序在真机上调试时无打印信息,提示Unable to open log device ‘/dev/log/main’: No such file or directory在我们使用真机进行An
- struts中使用json,报错There is no result type defined for type 'json' mapped with name 'success'.
- No label views point to this text field with an android:labelFor="@+id/@+id/***" attribute
- no lable views point to this text field with an android:lablFor=”@+id/@+id
- org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER
- preferredFontForTextStyle字体设置之更改
- UITextView使用 sizeWithFont:constrainedToSize:lineBreakMode:计算自适应文本高度
- Open quote is expected for attribute "class" associated with an elemen的解决方案
- iOS文本布局探讨之三——使用TextKit框架进行富文本布局
- android:includeFontPadding的使用:清除TextView字体周边空白
- TextUML Toolkit is an open-source IDE for UML
- 使用内部类时提示No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- 在MFC中使用自定义字体来进行文本输出