[xep-support] preventing line breaks before punctuation

David Tolpin dvd at davidashen.net
Tue Oct 31 00:38:12 PST 2006


Hi Geoff,


> French users will always enter a space before the punctuation mark.  So  
> we still need a magical way of removing or replacing all the preceding  
> white space, if that white space is in the same block, and even if there  
> is XML markup between the end of the previous word and the punctuation.   
> This is difficult to do with XSLT.

1) Why do french users insert markup between the text and the column? Is  
the software that generates the FO responsible for that? Could it be  
modified?

2) There is a single space, and the space is attached either
- to the text, and then it is the last one, and the node is followed by a  
text node starting with colon;

- to the colon, in which case it is a string literal ' :'.

The latter case is trivial (split before, split after, remove space, wrap  
into inline with space-start . The former case requires moving a single  
space to the colon .

>
> I suspect it would be easier to implement in XEP's line breaking  
> mechanism, when the XML has already been parsed, the superfluous white  
> space has been removed, and the text has been broken into blocks.

If one decided to implement this in XEP, it would go to the preprocessing  
stage along the lines described above.

>  All you need to do at that point is prevent the insertion of a line  
> break before the punctuation mark.

XEP line-breaking algorithm is based on the Unicode standard. There are  
many ways to format texts, some of them are better than those which are  
specified in the standards. The unicode standard allows breaking a line  
before a space even if it is followed by a space.

The French typesetting has a legacy feature. This legacy feature is easy  
to express in XSL FO. French users are accustomed to placing a space  
before the colon, a poor practice from past times. Much in the same way as  
first-line indents using TAB must be replaced by proper start-indent,  
spaces before colons in french texts must be replaced by space-start .

David

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html



More information about the Xep-support mailing list