You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2010/02/12 07:50:02 UTC

DO NOT REPLY [Bug 48733] Extend Line Break algorithm to support non-standard configuration

https://issues.apache.org/bugzilla/show_bug.cgi?id=48733

--- Comment #1 from Manuel Mall <ma...@apache.org> 2010-02-12 06:50:00 UTC ---
(In reply to comment #0)
> 
> However, my company uses a different convention of putting the country before
> the currency symbol (eg. US$150 and A$250). Unfortunately, this allows a line
> break between the country and the currency symbol.
>
The usual solution for special cases requiring the standard linebreaking to be
overwritten is to add a zero width breaking or non breaking (depending on what
you want to achieve) joiner character to the input stream. Typically as part of
the XSL transformation step if you have one.
> 
> The simplest change would be to make the LineBreakUtils class public, change
> the PAIR_TABLE to non-final and then add a method setLineBreakPairProperty(int,
> int, byte). This would not break any existing unittests or functionality, but
> would allow me to write something like this when I create my FopFactory:
> 
> LineBreakUtils.setLineBreakPairProperty(
>   LineBreakUtils.LINE_BREAK_PROPERTY_AL,
>   LineBreakUtils.LINE_BREAK_PROPERTY_PR,
>   LineBreakUtils.PROHIBITED_BREAK);
> 
While it is desirable to make line breaking behaviour more flexible your
approach of exposing setters on static variables making them modifiable at
runtime is non thread safe and also does not allow linebreaking customization
on a per fop invocation basis as obviously these tables are shared across all
fop instances.

A more generic approach possibly using interfaces, factories and configurable
line breaking providers may be more appropriate. However, as pointed out above
this may be an overkill in your case as, depending on your FOP production
pipeline, injecting non breaking word joiner (U+2060) into your currency
amounts could be a simple solution not requiring any FOP code changes.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.