Re: [xep-support] Hyphenation tip

From: David Cramer <david@thingbag.net>
Date: Fri Sep 18 2009 - 07:32:11 PDT

You could (programmatically?) add zero-width spaces in the places where
you want the breaks. The DocBook XSLs have some code that does that for
URLs.

For inspiration see this message on the docbook mailing list:
http://www.mail-archive.com/docbook@lists.oasis-open.org/msg05030.html
And here is the xslt that contains the hyphenate-url template he mentions:
http://docbook.sourceforge.net/release/xsl/current/fo/xref.xsl

In your case I guess you'd want to rewrite it so it adds them between
lower-case and upper-case characters. Alternatively, you could add
processing instructions in your source, e.g. Upload<?sbr?>Vcs<?sbr?>Path
and then have template that sticks a zero-width space or soft hyphen
character there. Then it will only break there if it needs to.

David

Jan Tošovský wrote:
> Hello,
>
> I have another issue in narrow table columns, where extra long line of text is used. It is obvious that line must be wrapped, but it is hyphenated on strange position. If soft hyphen characters are added, they are not preffered and some unknown logic behind is used instead.
>
> Example:
> UploadVcsPath, with soft hyphens Upload-Vcs-Path is broken to UploadVc-sPath
> LogOutAction, with soft hyphens Log-Out-Action is broken to LogOutAc-tion
>
> Can this behaviour be improved somehow?
>
> Thanks in advance for your tips.
>
> Jan
>
>
>> -----Original Message----
>> From: owner-xep-support@renderx.com [mailto:owner-xep-
>> support@renderx.com] On Behalf Of Dave Pawson
>> Sent: Wednesday, May 06, 2009 9:39 PM
>> To: xep-support@renderx.com
>> Subject: Re: [xep-support] Hyphenation tip
>>
>> 2009/5/6 Michael Sulyaev <msulyaev@renderx.com>:
>>
>>> Hello Jan,
>>>
>>> If you have language="en" you are using the hyphen/ukhyphen.tex rules
>>>
>> file
>>
>>> which is for English (UK). See xep.xml, the last section on
>>>
>> languages. This
>>
>>> file allows "ht-tp".
>>>
>>> You may also forbid hyphenation of "http" in UK rules:
>>>
>>> $ diff -ubBr hyphen/ukhyphen.tex.orig hyphen/ukhyphen.tex
>>> --- hyphen/ukhyphen.tex.orig 2009-05-06 19:13:46.000000000 +0400
>>> +++ hyphen/ukhyphen.tex 2009-05-06 19:14:07.000000000 +0400
>>> @@ -8576,4 +8576,5 @@
>>> ma-nu-scripts
>>> re-ci-pro-city
>>> through-out
>>> -some-thing}
>>> +some-thing
>>> +http}
>>>
>>>
>>> Obviously, you may disable hyphenation for the URLs in the source FO:
>>>
>>> For example <fo:inline
>>>
>> hyphenate="false">http://www.server3.com</fo:inline>
>>
>>> can be named <fo:inline
>>> hyphenate="false">http://www.whatever.com</fo:inline>
>>>
>> I think your suggestions are better Michael!
>> 1. Use the hyphenation dictionary for the language in use
>> 2. use the hyphenate='false' property!
>>
>> Thanks.
>>
>
> -------------------
> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
> in the body of the message to majordomo@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
>

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@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
Received on Fri Sep 18 08:15:35 2009

This archive was generated by hypermail 2.1.8 : Fri Sep 18 2009 - 08:15:43 PDT