Is there a reason the setStyle method of the font class does a logical OR
operation with the parameter passed?


From:
http://itext.svn.sourceforge.net/viewvc/itext/trunk/src/core/com/lowagie/text/Font.java?revision=3373
    public void setStyle(int style) {
        if (this.style == UNDEFINED)
            this.style = NORMAL;
        this.style |= style;
    }


I expected this method to replace the style with the one I provide rather
than do a logical OR. I would expect a method such as addStyle() to do the
above logical OR. Another option may be to add another setStyle method that
takes an int and a boolean parameter called 'replace' which defaults to
false for backwards compatibility. With the current behavior I need to call
setStyle(Font.Normal) then call setStyle again with the style I desire if I
want to replace the style.

Your thoughts?
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to