Full Justification

  • I'm using WPTools in a Delphi 2007 application where users enter text in a very small column width editor. The component works very well in this situation, but there is one feature that doesn't seem to be working as desired.

    Full justification. Left/center/right justification works as expected, but when i set a block of text to be fully justified, this only works when the text wraps and there are no hard line enders (carriage returns). If carriage returns are usee, the line(s) end up justifying to the left.

    I can't get by the carriage returns. Is there any way to force a single line to justify fully in the editor?

    Thanks,

    Alan

  • this is becoming more of an issue now. Users are noticing that the full justify isn't working as expected, that the WYSIWYG display really isn't true WYSIWYG with respect to full justify.

    Is there any solution for this issue??

    Alan

  • First, I should note that in my application, the page width is less than two inches. Not a "standard' sized document.

    Anyway, if they are typing along and letting WPTools automatically break the lines for them, the text will properly block/full justify. But, another aspect of this application is that prior to the text being stored in a database, some automatic formating/hyphenation code is run on it and this breaks up the lines with hard carriage returns. When this happens...the block/full justification no longer is there in the WPTools editor, and all text is left justified instead. Here are some before/after screen captures:

    Before the text processing, just using auto-wordwrap:


    After the text processing:


    it appears that a single line of text with a hard carriage return at the end cannot be full/block justified so that it fills in the entire page width.

    Any help with this would be greatly appreciated.

    alan

    • Offizieller Beitrag

    Hi,

    You don't see this with a regular page width, is this right?

    I see the effect here when there is just one word in the wrapped line, WPTools does not do letter spacing.

    I can have a small page width here and also justified text (with a very small font then).

    Maybe there is something off with the FormatOptions.

    You can edit your form (DFM) in textmode and delete the properties FormatOptions end -Ex, this will restore the default when you load the next time.

  • I honestly haven't tried ti with a 'regular' page width, but why would it work any differently? I don't thikn this is dependent on the width of the page - I believe its dependent on if there is an explicit CRLF at the end of the line of text.

    as i said previously, after processing my text, EACH line has a hard line break at the end. After processing, there is NO word wrapping. I still need the full justification to work even if there is a hard carriage return at the end of each line of text.

    This is the issue, i believe. Full justification doesn't appear to work on a line when it has a hard carriage return at the end.

  • I'll just chip in here, having worked on a word-processor before (just a user of WPTools though). The key here is that full justification is only ever done on the body of a paragraph, and not on the last line of a paragraph. The problem is that the last line will usually be very short compared to the rest of the lines, so it would look quite odd.

    In your situation, you are breaking the paragraph up into lots of little paragraphs, and that is why it is doing what you are seeing. I doubt it would work how you want ever, to be honest. The way forward is to get the hyphenation or other requirement into the WPTools way of working (I don't know if it has a hypenation facility) or to use special break characters that will allow it to work as it currently does. Perhaps using an alternative space character or something (hmm, that might not work either). Anyway, I think an alternative is needed.

  • Zitat von matthew

    I'll just chip in here, having worked on a word-processor before (just a user of WPTools though). The key here is that full justification is only ever done on the body of a paragraph, and not on the last line of a paragraph. The problem is that the last line will usually be very short compared to the rest of the lines, so it would look quite odd.

    In your situation, you are breaking the paragraph up into lots of little paragraphs, and that is why it is doing what you are seeing. I doubt it would work how you want ever, to be honest. The way forward is to get the hyphenation or other requirement into the WPTools way of working (I don't know if it has a hypenation facility) or to use special break characters that will allow it to work as it currently does. Perhaps using an alternative space character or something (hmm, that might not work either). Anyway, I think an alternative is needed.

    Another question -

    is there any way in WPTools to take a line of text and say "equally space the words in this line so it fills the whole page"? Or is that basically what it does with a paragraph?

    If it does it with a paragraph, why can't it do it with a single line of text?

  • I can't say why WPTools doesn't (I am nothing but a user) but this is the same as any word-processor. Try it in Word.

    Code
    The problem is that it would look quite horrible if you had the last line all 
    justified                          across                        the              page.

    That didn't work so well, but it shows the idea.

  • Zitat von matthew

    I can't say why WPTools doesn't (I am nothing but a user) but this is the same as any word-processor. Try it in Word.

    Code
    The problem is that it would look quite horrible if you had the last line all 
    justified                          across                        the              page.

    That didn't work so well, but it shows the idea.

    I understand what it may look like. The difference is i'm using a very narrow column width so it would never be as exaggerated as you point out.

  • I understand your situation is different, but I'm just pointing out how word processors work. Maybe WPTools does have a solution, but as a general principle you are swimming against the tide in this requirement, and working out how to hyphenate automatically would solve your situation.

  • Zitat von matthew

    I understand your situation is different, but I'm just pointing out how word processors work. Maybe WPTools does have a solution, but as a general principle you are swimming against the tide in this requirement, and working out how to hyphenate automatically would solve your situation.

    There are reasons for doing what i'm doing, and you and I don't need to get into that here. I understand your point...its just that I need to do what i'm doing, and the only part of WPTools that this breaks is full justification.

    alan