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

           Summary: [PATCH] MinOptMax immutable/layoutmgr refactoring
           Product: Fop
           Version: 1.0dev
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: page-master/layout
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created an attachment (id=24429)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24429)
patch

This is the patch which I annonced in
http://markmail.org/thread/2ka3sejiecymn4te.

It's all about refactoring. No new functionality.

The main point was to make MinOptMax immutable. MinOptMax has around 800 usages
in FOP. It's central usage is in the package layoutmgr. It's passed around a
lot. This passing around highly benefits from the newly immutability. It's also
used in computations which may be a bit slower now but not by a far margin.

The big point is that the invariant min <= opt <= max can now be really
guarantied (except at malicious serialization - but I could handle this). There
is now no way to break this invariant (please validate this).

I have a MinOptMaxTest which covers all method except for the deprecated ones.
MinOptMax conforms to Checkstyle and looks nice. :-)  

It's really an all new class.

Apart from MinOptMax, I refactored some of the code around it's usage. Most of
the layoutmanager code will improve from refactoring. Most of it isn't up to
todays standards. Sadly I'm not able to refactor much, because I don't really
in detail what is happening. I saw many Knuth things and as a LaTex user, I
have an idea about this algorithm but not in detail. 

I'm really interested in TextLayoutManager so I refactored there a lot in the
process to understand the code. I created the TextAreaBuilder in the process of
refactoring the method createTextArea. This method is so complex that I though
it is really an class of its own.

I'm interested in TextLayoutManager because I like to implement some advanced
OpenType layout features to the text processing. As you properly know, I
currently write new code to read TrueType/OpenType files. I'm at a point where
I can read and preprocess all the OpenType advanced typography features such as
glyph substitution and glyph positioning (much more than kerning). So at the
end it would be nice to actually see this features in action. So I came to
TextLayoutManager.

Back to my patch. Most of the changes I made are covered by tests. Of course it
runs all tests. But there are some uncovered places as I already noted in my
first mail of http://markmail.org/thread/2ka3sejiecymn4te.I don't know of the
uncovered places really used in FOP. So it would be necessary for the committer
to look at such uncovered places before applying may patch.

I hope my patch will help the layoutmgr code.

Best Regards
Alex

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