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

           Summary: Extend Line Break algorithm to support non-standard
                    configuration
           Product: Fop
           Version: 0.95
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: general
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: alex_wat...@standardandpoors.com


The current line breaking algorithm in FOP 0.95 uses two static classes
LineBreakStatus and LineBreakUtils to implement the standard Unicode line
breaking algorithm (UTR 14).

In particular, this handles currency expressions such as $US150 and $A250 to
prevent line breaks within each number.

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.

I have checked the UTR14 spec and I know this is non-standard. It prohibits
breaks between (PR,AL) but allows breaks between (AL,PR).

My enhancement request is for a way to override the default line-break pairs at
runtime. This is not currently possible because the LineBreakStatus and
LineBreakUtils classes are static with private members.

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);

However, as LineBreakUtils is a generated java file I have an alternate patch
for LineBreakStatus that would achieve the same thing (but is a little more
work).

Please advise if there is a way to achieve this with current FOP functionality,
or if my suggested code enhancements are appropriate. I can provide PATCH code
for either approach if requested.

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

Reply via email to