LibreOffice text justification

Németh László nemeth at numbertext.org
Tue Mar 19 09:36:06 PDT 2013


Hi,

I have added the improved version of the macro to the Typography
toolbar (second icon):

http://extensions.libreoffice.org/extension-center/typography-toolbar

It formats the actual justified paragraph or all justified paragraphs
of the selected text or document (formatting a huge document is quite
slow, so you can stop it by frequent pressing of Ctrl-Shift-Q or by
the icon Interrupt Macro of a customized Standard toolbar).

You can add keyboard event listeners or a background thread eg. in
Python to check and maybe modify the paragraph formatting, but it is
better to implement this feature as a new option of paragraph
formatting. There is a relevant paragraph setting in Writer, the
“expand single” word in the justified last paragraph line.

Best regards,
László



2013/3/8 Chris Tapp <opensource at keylevel.com>:
> Hi Németh,
>
> On 7 Mar 2013, at 15:54, Németh László wrote:
>
>> Hi,
>>
>> It seems, LibreOffice uses a TeX-like penalty system for
>> justification, but without modifiable options and pdfTeX-like
>> microtypography features. There are other problems in this area, for
>> example, the (sometimes very ugly) missing kerning before the
>> automatic hyphen character and the missing italic correction. (Also
>> adding the hyphenation zone setting of the other word processors would
>> be fine for left/right aligned paragraphs).
>>
>> Maybe a good method to improve typesetting of LibreOffice to add a new
>> option for automatic extra (but limited) kerning/scaling of characters
>> of lines with extra large spaces, but without the modification of the
>> line breaks. I have made a Basic prototype to automatize this
>> line-oriented character formatting (for all lines of a document,
>> except the last lines of the paragraphs), allowing max. +4% character
>> width and max. +3% kerning (for example, max. 0,36 pt extra character
>> distance between 12pt characters):
>>
>> http://www.numbertext.org/tmp/micro.bas
>>
>> (Note: scaling of Graphite fonts doesn't modify the line breaks, so
>> remove this section from the prototype to test it with Graphite
>> fonts.)
>>
>> The test results seem better, than the original typesetting, except
>> the hanging hyphen marks (this is a bug):
>>
>> http://www.numbertext.org/tmp/micro_all.pdf
>>
>> (micro.odt and micro_nohyph.odt are the original test files without
>> modified kerning and scaling:
>>
>> http://www.numbertext.org/tmp/micro.odt
>> http://www.numbertext.org/tmp/micro_kern.odt
>> http://www.numbertext.org/tmp/micro_scale.odt
>> http://www.numbertext.org/tmp/micro_kern_and_scale.odt
>> http://www.numbertext.org/tmp/micro_nohyph.odt
>> http://www.numbertext.org/tmp/micro_nohyph_kern.odt
>> http://www.numbertext.org/tmp/micro_nohyph_scale.odt
>> http://www.numbertext.org/tmp/micro_nohyph_kern_and_scale.odt)
>>
>> I plan to add a sophisticated version (maybe with shrinking, testing
>> also minimal paragraph width modifications) to the typography toolbar
>> (http://extensions.libreoffice.org/extension-center/typography-toolbar)
>> to fix the selected paragraphs with one click.
>
> Thanks for this, it looks like a good place to start :-)
>
> Will it be possible to trigger the formatting
> using something embedded in the document which then applies it to one or more specific paragraph styles?
>
> It may also be worth looking at 'runt' control at the same time (though many think these should just be left).
> A 'runt' is the small fragment of text which is sometimes pushed onto the last line of a paragraph. It can be
> controlled by preventing single words on the last line or setting a minimum number of characters. Character
> based control is often better as preventing long words dropping down on their own looks poor.
>
>> Best regards,
>> László
>> _______________________________________________
>> LibreOffice mailing list
>> LibreOffice at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>
> Chris Tapp
>
> opensource at keylevel.com
> www.keylevel.com
>
>
>


More information about the LibreOffice mailing list