[英]WPF RichTextBox font spacing inconsistency
我发现呈现FlowDocument的WPF RichTextBox不是所见即所得。
下面的屏幕截图显示了与其渲染的PDF输出(右)相比,编辑器(左)的间距减小了。
本文档的xaml。
<ns0:FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ns0="http://schemas.microsoft.com/xps/2005/06"
Background="#FFFFFFFF" ColumnWidth="816" PageWidth="816" PageHeight="1056"
AllowDrop="True" NumberSubstitution.CultureSource="User">
<ns0:FlowDocument.Blocks>
<ns0:Paragraph>
<ns0:Paragraph.Inlines>
<ns0:Run Text="72" FontFamily="Arial" FontSize="72" />
</ns0:Paragraph.Inlines>
</ns0:Paragraph>
<ns0:Paragraph>
<ns0:Paragraph.Inlines>
<ns0:Run Text="48" FontFamily="Arial" FontSize="48" />
</ns0:Paragraph.Inlines>
</ns0:Paragraph>
<ns0:Paragraph>
<ns0:Paragraph.Inlines>
<ns0:Run Text="20" FontFamily="Arial" FontSize="20" />
</ns0:Paragraph.Inlines>
</ns0:Paragraph>
<ns0:Paragraph>
<ns0:Paragraph.Inlines>
<ns0:Run Text="12" FontFamily="Arial" FontSize="12" />
</ns0:Paragraph.Inlines>
</ns0:Paragraph>
<ns0:Paragraph>
<ns0:Paragraph.Inlines>
<ns0:Run Text="08" FontFamily="Arial" FontSize="8" />
</ns0:Paragraph.Inlines>
</ns0:Paragraph>
</ns0:FlowDocument.Blocks>
</ns0:FlowDocument>
您是否有解决此问题的解决方法?
如果要页面保真度,那么FlowDocument是错误的工具。
FlowDocuement就是-Flow-它不知道页面规格。
对于页面保真度,请使用FixedDocument 。
屏幕上的Microsoft Word旁边的PDF也不一定必须具有相同的间距。
这两张图片的文字高度也不相同。
阅读器具有缩放功能。
您为什么甚至期望这两个图像相同?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.