You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Mike Sierra <ms...@mac.com> on 2005/02/04 18:09:04 UTC

auto-linebreak?

I want to allow long URLs amidst text to automatically linebreak after 
slash characters.  This is somewhat related to the issue of 
hyphenation, but at first glance at the doc there doesn't appear to be 
any support for it.  Any ideas?  Thanks,

--Mike


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: auto-linebreak?

Posted by Mike Sierra <ms...@mac.com>.
Excellent -- &#x200B; worked like a charm.  The following perl 
postprocesses away the problem throughout the text, auto-breaking after 
dots/dashes/slashes that fall between alphanumerics:

     $fo =~ s{(<.+?>|[^<]+)}{
         my $m = $1;
         $m !~ m~<~ and $m =~ s~(\w[-./])(\w)~$1&#x200B;$2~g;
         $m;
     }sge;

This is actually a lot more refined than how it works in my old 
favorite FrameMaker, which breaks after specified characters no matter 
what, e.g., breaking filenames like .cshrc onto two lines.

Many thanks,

--Mike



On Friday, February 4, 2005, at 12:26  PM, The Web Maestro wrote:

> On Feb 4, 2005, at 9:09 AM, Mike Sierra wrote:
>> I want to allow long URLs amidst text to automatically linebreak 
>> after slash characters.  This is somewhat related to the issue of 
>> hyphenation, but at first glance at the doc there doesn't appear to 
>> be any support for it.  Any ideas?  Thanks,
>>
>> --Mike
>
> There was some discussion about this some time ago (IIRC, it was a 
> year or so) in the archives. I don't have the time to look, but it 
> dealt with PATH information for URLs and/or local file systems.
>
> From what I recall the solution, if there was one, involved adding '/' 
> as a breaking point or something. Unfortunately, partly because FOP is 
> not a finished product, I don't think the problem resolved. Or if it 
> was, it involved placing a zero-width space before '/' character(s), 
> so they would wrap 'naturally'.
>
> Web Maestro Clay


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: auto-linebreak?

Posted by The Web Maestro <th...@gmail.com>.
On Feb 4, 2005, at 9:09 AM, Mike Sierra wrote:
> I want to allow long URLs amidst text to automatically linebreak after 
> slash characters.  This is somewhat related to the issue of 
> hyphenation, but at first glance at the doc there doesn't appear to be 
> any support for it.  Any ideas?  Thanks,
>
> --Mike

There was some discussion about this some time ago (IIRC, it was a year 
or so) in the archives. I don't have the time to look, but it dealt 
with PATH information for URLs and/or local file systems.

 From what I recall the solution, if there was one, involved adding '/' 
as a breaking point or something. Unfortunately, partly because FOP is 
not a finished product, I don't think the problem resolved. Or if it 
was, it involved placing a zero-width space before '/' character(s), so 
they would wrap 'naturally'.

Web Maestro Clay
-- 
<th...@gmail.com> - <http://homepage.mac.com/webmaestro/>
My religion is simple. My religion is kindness.
- HH The 14th Dalai Lama of Tibet


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org