3

i have a some paragraphs within a FlowDocument, and what i need is to justify all lines (even lines with line breaks)

Here's a code sample:

 <Paragraph TextAlignment="Justify">
"One of the most important operations necessary when text materials
are prepared for printing or display is the task of dividing long
paragraphs into individual lines.<LineBreak/>
When this job has been done well,
people will not be aware of the fact that the words they are reading
have been broken apart arbitrarily and placed into a somewhat rigid
and unnatural rectangular framework; but if the job has been done
poorly, readers will be distracted by bad breaks that interrupt
their train of thought."
</Paragraph>

The output of the above will not justify the line that has a line break, this line will be aligned left, what i need is a same-width lines for all lines

How could this be achieved?

(Note that the desired output is the same output achievable in ms word if a paragraph has line breaks and is set to justify, for example if we have 3 words on a line we'll have 1 word on the left, one in the center and one on the right)

Thanks, Sam

4

2 に答える 2

1

私はあなたがあなたが望むことを達成することができないと思います。を近い段落に置き換えても<LineBreak/>(私はあなたが望まないことを知っています):

<Paragraph TextAlignment="Justify">
One of the most important operations necessary when text materials
are prepared for printing or display is the task of dividing long
paragraphs into individual lines.
</Paragraph>
<Paragraph TextAlignment="Justify">
When this job has been done well,
people will not be aware of the fact that the words they are reading
have been broken apart arbitrarily and placed into a somewhat rigid
and unnatural rectangular framework; but if the job has been done
poorly, readers will be distracted by bad breaks that interrupt
their train of thought.
</Paragraph>

段落の最後の行は左寄せされています。

于 2010-04-27T20:58:46.360 に答える
0

これはあなたがやりたいことですか?

<Paragraph Margin="5,5,5,5"> <!--You can assign margin here or below to give you the spacing needed-->
<!--You can set width as need, but new line can be done in a textblocks LineBreak-->
<TextBlock TextAlignment ="Justify" TextWrapping="Wrap" Width="150"> 
    One of the most <LineBreak/>important operations necessary when text materials 
    are prepared for printing or display is the task of dividing long
    paragraphs into individual lines.
</TextBlock>                               

それが役立つことを願っています...

于 2017-01-10T19:28:37.990 に答える