justify - paragraph

General TRichView support forum. Please post your questions here
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

justify - paragraph

Post by RobertoVG » Sat Aug 10, 2013 1:16 am

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]

Sergey Tkachenko
Site Admin
Posts: 14226
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sat Aug 10, 2013 6:33 am

Probably, you assigned BiDiMode<>rvbdUnspecified.
Unfortunately, justifying is not supported in this mode.

RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Post by RobertoVG » Sat Aug 10, 2013 11:54 am

Hi Sergey

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

Sergey Tkachenko
Site Admin
Posts: 14226
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sat Aug 10, 2013 3:22 pm

If please save this document to RVF file and send them to me richviewgmailcom

RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Post by RobertoVG » Sat Aug 10, 2013 5:31 pm

I've mailed the e-mail

Sergey Tkachenko
Site Admin
Posts: 14226
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sat Aug 10, 2013 6:46 pm

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.

RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Post by RobertoVG » Sat Aug 10, 2013 7:00 pm

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?

Sergey Tkachenko
Site Admin
Posts: 14226
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sun Aug 11, 2013 5:53 am

Sorry, what's wrong with text having single spaces between words?

RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Post by RobertoVG » Sun Aug 11, 2013 1:03 pm

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

RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Post by RobertoVG » Sun Aug 11, 2013 1:06 pm

item (3) above
aaaa   aaa  aaa  aaa  aaa
bb bbbb bbbb bbb bbb bb

Sergey Tkachenko
Site Admin
Posts: 14226
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sun Aug 11, 2013 5:13 pm

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.

RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Post by RobertoVG » Sun Aug 11, 2013 6:12 pm

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.

Sergey Tkachenko
Site Admin
Posts: 14226
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sun Aug 11, 2013 6:40 pm

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)

Sergey Tkachenko
Site Admin
Posts: 14226
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Tue Aug 13, 2013 10:01 am

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.

RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Post by RobertoVG » Tue Aug 13, 2013 10:49 am

worked
thank you for your attention

Post Reply