On 9/25/06, Oleg Khaschansky <[EMAIL PROTECTED] > wrote:
It was evaluated as "not a bug". But it is clear from its evaluation that negative-sized fonts are treated as positive sized but rotated around their origin, say with implicit transform. I'd suggest to follow this behavior.
I agree, that the behavior of the negative-sized fonts on RI is looks like the behavior of positive ones with -Pi rotation. However, if we look at the font metrics, bounds - we can see negative values for height, width values...I'm not sure they have any sence without additional documentation that we can't find in the spec. Moreover bug evaluation says that RI handles negative-sized fonts for components in different ways depending on the platform. And it's behavior unlike the drawing on the frame surface. What is to add - metrics for all these various cases are the same, it means that RI has erroneous behavior in some way. I would suggest not to follow the RI and mark it as "non-bug difference" as the RI hasn't any clear documentation on this problem and it's behavior erroneous and depends on the platform or component type. Thanks, Ilya.
On 9/23/06, Richard Liang < [EMAIL PROTECTED]> wrote: > On 9/23/06, Alexey Varlamov <[EMAIL PROTECTED] > wrote: > > Google said this is the bug of RI in progress [1]. However there is no > > distinct resolution yet... > > > > It's reported again Java 1.1.8 more than 3 years agao. I don't think > RI will fix this bug. > > Richard. > > > [1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4803825 > > > > > > 2006/9/23, Richard Liang < [EMAIL PROTECTED]>: > > > On 9/22/06, Ilya Okomin < [EMAIL PROTECTED]> wrote: > > > > Hi, all! > > > > > > > > I was playing with fonts and found that Font with negative size can be > > > > created on RI. > > > > Unfortunately spec keep silence about fonts with negative sizes. > > > > On Harmony if font size is negative then it is set to zero. > > > > > > > > ------------test.java--------------- > > > > import java.awt.*; > > > > import java.awt.font.FontRenderContext; > > > > > > > > public class NegativeFontTest { > > > > > > > > public static void main(String[] args) { > > > > int fontsize=-5; > > > > Font localFont = new Font("Arial", 2, fontsize); > > > > System.out.println("Size = " + localFont.getSize2D()); > > > > > > > > System.out.println("Height = " + localFont.getLineMetrics("", new > > > > FontRenderContext(null, false, false)).getHeight()); > > > > System.out.println("MaxCharBounds = " + localFont.getMaxCharBounds(new > > > > FontRenderContext(null, false, false))); > > > > } > > > > > > > > } > > > > ---------------------------------------- > > > > If you run this test case on RI you can see that output looks quite strange: > > > > > > > > Size = -5.0 > > > > Height = -5.7495117 > > > > MaxCharBounds = java.awt.geom.Rectangle2D$Float[x=0.0,y=4.6081543 ,w=-5.46875 > > > > ,h=- 5.7495117] > > > > > > > > > > > > Actually, I dont see any sence in negative height and width metrics and > > > > I think it is an RI bug. > > > > If you try to draw text with such font on RI - nothing is happen, you can't > > > > see any text on the component. > > > > I've ran 'xfontsel' tool on Linux and there was suggested to choose only > > > > positive sized fonts. Also I've looked on the GDI LOGFONT structure > > > > description in MSDN and I've seen there again that we deal with absolute > > > > height values. > > > > > > > > Any thoughts on this issue, is it RI bug or not? > > > > > > We cannot say it's a bug of RI, because the spec does not explicitly > > > describe the requirement of font size. > > > > > > I suggest we follow RI. > > > > > > Best regards, > > > Richard > > > > > > > > > > > Thanks, > > > > Ilya. > > > > > > > > -- > > > > -- > > > > Ilya Okomin > > > > Intel Middleware Products Division > > > > > > > > > > > > > > > > > -- > > > Richard Liang > > > China Development Lab, IBM > > > > > > --------------------------------------------------------------------- > > > Terms of use : http://incubator.apache.org/harmony/mailing.html > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > > Terms of use : http://incubator.apache.org/harmony/mailing.html > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > Richard Liang > China Development Lab, IBM > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- -- Ilya Okomin Intel Middleware Products Division
