Page 1 of 2

justify - paragraph

Posted: Sat Aug 10, 2013 1:16 am
by RobertoVG
When I set to justified the last text (first) line will not until the end of paragraph (incorrectly). This situation is equal to one paragraph left justified.

xxxxx xxxxxx xxxxxxx xxxxxxx xx
xxxxx xxxxxx xxxxxxx xxxxxxx xxxxxxx

is there any procedure that can be done to "push" the text indented to the end of the line?

Thanks

[/img]

Posted: Sat Aug 10, 2013 6:33 am
by Sergey Tkachenko
Probably, you assigned BiDiMode<>rvbdUnspecified.
Unfortunately, justifying is not supported in this mode.

Posted: Sat Aug 10, 2013 11:54 am
by RobertoVG
Hi Sergey

I confirm that the property SRichViewEdit1.BidiMode: = rvbdUnspecified and did several tests in this direction, but the display is not really justified

Posted: Sat Aug 10, 2013 3:22 pm
by Sergey Tkachenko
If please save this document to RVF file and send them to me richviewgmailcom

Posted: Sat Aug 10, 2013 5:31 pm
by RobertoVG
I've mailed the e-mail

Posted: Sat Aug 10, 2013 6:46 pm
by Sergey Tkachenko
I confirm the problem with multiple adjacent spaces - TRichView does not display them as Word or WordPad.
It will be improved, but not in near future. I do not think this problem is too important, because multiple spaces are not normal.

Posted: Sat Aug 10, 2013 7:00 pm
by RobertoVG
Hi Sergey

the issue is not simply the various spaces.
Is the need to put text on the same line.

which the unit / procedure / function that handles this control?

Posted: Sun Aug 11, 2013 5:53 am
by Sergey Tkachenko
Sorry, what's wrong with text having single spaces between words?

Posted: Sun Aug 11, 2013 1:03 pm
by RobertoVG
In my country, I am launching the application of financial calculation integrated text editor, for judges and lawyers. Thus it is essential edition extensively justified paragraph.

There may be situations where two words can not be on different lines, and that's the problem with trichview.

Therefore I ask you to assist me to develop at least one routine that intersperse between words in the line following the logic below

1) Initial paragraph
aaaa aaa aaa aaa aaa bb
bbbb bbbb bbb bbb bb

2) the user manually pushed the words correctly, leaving the text
that routine should adjust
aaaa aaa aaa aaa aaa
bb bbbb bbbb bbb bbb bb

3) after performing routine text line was adjusted properly justified
(through routine to be idealized)
aaaa aaa aaa aaa aaa
bb bbbb bbbb bbb bbb bb


is there any function that indicate the space occupied by the words of the line measured in pixels?

is there any function that indicates the maximum position for a formatted line?


Thanks

Posted: Sun Aug 11, 2013 1:06 pm
by RobertoVG
item (3) above
aaaa   aaa  aaa  aaa  aaa
bb bbbb bbbb bbb bbb bb

Posted: Sun Aug 11, 2013 5:13 pm
by Sergey Tkachenko
Is it necessary to put a word on the next line using multiple spaces? (after all, it is an unreliable way to do it).
May be you can use Shift+Enter instead? (Well, the current version of TRichView does not justify the line where Shift+Enter is pressed, but I can add an option.

Posted: Sun Aug 11, 2013 6:12 pm
by RobertoVG
if you dial shift + enter (current version), will generate another paragraph, and the last word of the first line will not touch the margin.

Try to understand, unfortunately, as in the case reported, the two lines belong to the same paragraph and the first line the word "aaa" occupies the same column that the end of the line below

if you add option (new change) with shift + enter, since the last word that was left of the first line, pull over to the right margin, solves the problem.

Posted: Sun Aug 11, 2013 6:40 pm
by Sergey Tkachenko
Shift+Enter adds a different line breaks than simple Enter. Shift+Enter adds a line break inside a paragraph instead of starting a new paragraph.

Yes, in the current version a line ending with Shift+Enter is not aligned to the both sides, but adding an option should be easy. I'll try to do it tomorrow.

Modifying line breaking with multiple spacing would be much more complicated (a single space character between lines can be simply not shown, while multiple spaces cannot (otherwise editing would be inconvenient) - they must be placed as a special invisible item to the right of right margin, and this item must be processed specially)

Posted: Tue Aug 13, 2013 10:01 am
by Sergey Tkachenko
I made the following changes in CRVFData.pas (they will be included in the next update)

1) In the interface section, add:

Code: Select all

const 
  RichViewJustifyBeforeLineBreak: Boolean = False;
2) In TCustomRVFormattedData.FinishScreenLine, closer to the beginning of the function, after the line " dli := DrawItems;":

Code: Select all

  if RichViewJustifyBeforeLineBreak and IsParaSectionFinished then
    IsParaSectionFinished := IsLastParaItemEx(dli.ItemNo);
Now, if you assign RichViewJustifyBeforeLineBreak := True, you will get the desired behavior.

Posted: Tue Aug 13, 2013 10:49 am
by RobertoVG
worked
thank you for your attention