[英]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.