You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Ilya Okomin <il...@gmail.com> on 2006/09/19 11:37:02 UTC

Re: [jira] Created: (HARMONY-1456) [classlib][awt]java.awt.Font.hasUniformLineMetrics() return true on Harmony while RI returns false

Hi, community!

I found for java.awt.Font.hasUniformLineMetrics() RI returns false for all
fonts (physical/logical) while Harmony returns true for physical and false
for logical.
Spec says: "Checks whether or not this Font has uniform line metrics. A
logical Font might be a composite font, which means that it is composed of
different physical fonts to cover different code ranges. Each of these fonts
might have different LineMetrics. If the logical Font is a single font then
the metrics would be uniform. ". Thus I find reasonable to return true for
physical fonts, as they are single.I assume that it is a non-bug difference
from RI.
Any thoughts on this issue?

Regards,
Ilya.


On 9/13/06, Ilya Okomin (JIRA) <ji...@apache.org> wrote:
>
> [classlib][awt]java.awt.Font.hasUniformLineMetrics() return true on
> Harmony while RI returns false
>
> --------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1456
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1456
>             Project: Harmony
>          Issue Type: Bug
>          Components: Non-bug differences from RI
>         Environment: Windows XP
>            Reporter: Ilya Okomin
>            Priority: Trivial
>
>
> According to the specification method must Font.hasUniformLineMetricsreturn true if this Font has uniform
> line metrics; false otherwise.
> RI returns false for physical font "Arial" while Harmony returns true.
> ====================test.java====================
> import java.awt.*;
>
> import junit.framework.TestCase;
>
> public class test extends TestCase {
>
>    public void testRun() {
>        final String name = "Arial";
>
>        Font f=new Font(name, Font.BOLD, 12);
>
>        // Check if created font is physical, it's family name
>        // is not logical and equals to the name parameter.
>        assertEquals(f.getFamily(), name);
>        assertTrue(f.hasUniformLineMetrics());
>    }
> }
> ===============================================
>
> Output:
> RI: java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32,
> R25.0.0-75, GC: System optimized over throughput (initial strategy
> singleparpar))
>
> junit.framework.AssertionFailedError
>        at junit.framework.Assert.fail(Assert.java:47)
>        at junit.framework.Assert.assertTrue(Assert.java:20)
>        at junit.framework.Assert.assertTrue(Assert.java:27)
>        at test.testRun(Test9688.java:17)
>        at jrockit.reflect.VirtualNativeMethodInvoker.invoke(
> Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
>        at java.lang.reflect.Method.invoke(Ljava.lang.Object;[
> Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
>        at junit.framework.TestCase.runTest(TestCase.java:154)
>        at junit.framework.TestCase.runBare(TestCase.java:127)
>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>        at junit.framework.TestResult.run(TestResult.java:109)
>        at junit.framework.TestCase.run(TestCase.java:118)
>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>        at junit.framework.TestSuite.run(TestSuite.java:203)
>        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:478)
>        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:344)
>        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:196)
>
> Harmony: java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r431938, (Aug 16 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
>
> // test passed!
>
> I would suppose that it is RI bug, since spec says: " If the logical Font
> is a single font then the metrics would be uniform." In this case we have
> "Arial" font that is a single physical font on Windows platform and
> according to spec it has to have uniform metrics.
>
>
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>


-- 
--
Ilya Okomin
Intel Middleware Products Division

Re: [jira] Created: (HARMONY-1456) [classlib][awt]java.awt.Font.hasUniformLineMetrics() return true on Harmony while RI returns false

Posted by Oleg Khaschansky <ol...@gmail.com>.
I wanted to say that if RI always returns false then there's very
small probability that any application developed for RI's classlib
uses this.

On 9/19/06, Ilya Okomin <il...@gmail.com> wrote:
> On 9/19/06, Oleg Khaschansky <oleg.v.khaschansky@gmail.com > wrote:
>
> > +1. BTW, I can't imagine the application that could be affected by
> > this difference.
>
>
> It may have sence if the application uses certain metrics for logical fonts
> according to the hasUniformLineMetrics() returned value. E.g. baseline
> offsets or lines thicknesses may be different for the physical fonts, that
> are composing logical font. Probably some applications would use font
> metrics if the hasUniformLineMetrics() returned true and use redefined
> values for such metrics if returned value is false, depending on the
> situation. (It is only a guess;)
>
> Thanks,
> Ilya.
>
>
>
> > On 9/19/06, Ilya Okomin < ilya.okomin@gmail.com> wrote:
> > > Hi, community!
> > >
> > > I found for java.awt.Font.hasUniformLineMetrics() RI returns false for
> > all
> > > fonts (physical/logical) while Harmony returns true for physical and
> > false
> > > for logical.
> > > Spec says: "Checks whether or not this Font has uniform line metrics. A
> > > logical Font might be a composite font, which means that it is composed
> > of
> > > different physical fonts to cover different code ranges. Each of these
> > fonts
> > > might have different LineMetrics. If the logical Font is a single font
> > then
> > > the metrics would be uniform. ". Thus I find reasonable to return true
> > for
> > > physical fonts, as they are single.I assume that it is a non-bug
> > difference
> > > from RI.
> > > Any thoughts on this issue?
> > >
> > > Regards,
> > > Ilya.
> > >
> > >
> > > On 9/13/06, Ilya Okomin (JIRA) < jira@apache.org> wrote:
> > > >
> > > > [classlib][awt]java.awt.Font.hasUniformLineMetrics() return true on
> > > > Harmony while RI returns false
> > > >
> > > >
> > --------------------------------------------------------------------------------------------------
> >
> > > >
> > > >                 Key: HARMONY-1456
> > > >                 URL: http://issues.apache.org/jira/browse/HARMONY-1456
> > > >             Project: Harmony
> > > >          Issue Type: Bug
> > > >          Components: Non-bug differences from RI
> > > >         Environment: Windows XP
> > > >            Reporter: Ilya Okomin
> > > >            Priority: Trivial
> > > >
> > > >
> > > > According to the specification method must
> > Font.hasUniformLineMetricsreturn true if this Font has uniform
> > > > line metrics; false otherwise.
> > > > RI returns false for physical font "Arial" while Harmony returns true.
> >
> > > > ====================test.java====================
> > > > import java.awt.*;
> > > >
> > > > import junit.framework.TestCase;
> > > >
> > > > public class test extends TestCase {
> > > >
> > > >    public void testRun() {
> > > >        final String name = "Arial";
> > > >
> > > >        Font f=new Font(name, Font.BOLD, 12);
> > > >
> > > >        // Check if created font is physical, it's family name
> > > >        // is not logical and equals to the name parameter.
> > > >        assertEquals(f.getFamily(), name);
> > > >        assertTrue(f.hasUniformLineMetrics());
> > > >    }
> > > > }
> > > > ===============================================
> > > >
> > > > Output:
> > > > RI: java version "1.5.0"
> > > > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> > > > BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32,
> > > > R25.0.0-75, GC: System optimized over throughput (initial strategy
> > > > singleparpar))
> > > >
> > > > junit.framework.AssertionFailedError
> > > >        at junit.framework.Assert.fail (Assert.java:47)
> > > >        at junit.framework.Assert.assertTrue(Assert.java:20)
> > > >        at junit.framework.Assert.assertTrue(Assert.java:27)
> > > >        at test.testRun(Test9688.java:17)
> > > >        at jrockit.reflect.VirtualNativeMethodInvoker.invoke(
> > > > Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
> > Source)
> > > >        at java.lang.reflect.Method.invoke (Ljava.lang.Object;[
> > > > Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
> > > >        at junit.framework.TestCase.runTest(TestCase.java:154)
> > > >        at junit.framework.TestCase.runBare(TestCase.java :127)
> > > >        at junit.framework.TestResult$1.protect(TestResult.java:106)
> > > >        at junit.framework.TestResult.runProtected(TestResult.java:124)
> > > >        at junit.framework.TestResult.run (TestResult.java:109)
> > > >        at junit.framework.TestCase.run(TestCase.java:118)
> > > >        at junit.framework.TestSuite.runTest(TestSuite.java:208)
> > > >        at junit.framework.TestSuite.run (TestSuite.java:203)
> > > >        at
> > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > > > RemoteTestRunner.java:478)
> > > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (
> > > > RemoteTestRunner.java:344)
> > > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> > > > RemoteTestRunner.java:196)
> > > >
> > > > Harmony: java version "1.5.0 "
> > > > pre-alpha : not complete or compatible
> > > > svn = r431938, (Aug 16 2006), Windows/ia32/msvc 1310, release build
> > > > http://incubator.apache.org/harmony
> > > >
> > > > // test passed!
> > > >
> > > > I would suppose that it is RI bug, since spec says: " If the logical
> > Font
> > > > is a single font then the metrics would be uniform." In this case we
> > have
> > > > "Arial" font that is a single physical font on Windows platform and
> > > > according to spec it has to have uniform metrics.
> > > >
> > > >
> > > >
> > > > --
> > > > This message is automatically generated by JIRA.
> > > > -
> > > > If you think it was sent incorrectly contact one of the
> > administrators:
> > > > http://issues.apache.org/jira/secure/Administrators.jspa
> > > > -
> > > > For more information on JIRA, see:
> > http://www.atlassian.com/software/jira
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > --
> > > Ilya Okomin
> > > Intel Middleware Products Division
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
>
> --
> --
> Ilya Okomin
> Intel Middleware Products Division
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [jira] Created: (HARMONY-1456) [classlib][awt]java.awt.Font.hasUniformLineMetrics() return true on Harmony while RI returns false

Posted by Ilya Okomin <il...@gmail.com>.
On 9/19/06, Oleg Khaschansky <oleg.v.khaschansky@gmail.com > wrote:

> +1. BTW, I can't imagine the application that could be affected by
> this difference.


It may have sence if the application uses certain metrics for logical fonts
according to the hasUniformLineMetrics() returned value. E.g. baseline
offsets or lines thicknesses may be different for the physical fonts, that
are composing logical font. Probably some applications would use font
metrics if the hasUniformLineMetrics() returned true and use redefined
values for such metrics if returned value is false, depending on the
situation. (It is only a guess;)

Thanks,
Ilya.



> On 9/19/06, Ilya Okomin < ilya.okomin@gmail.com> wrote:
> > Hi, community!
> >
> > I found for java.awt.Font.hasUniformLineMetrics() RI returns false for
> all
> > fonts (physical/logical) while Harmony returns true for physical and
> false
> > for logical.
> > Spec says: "Checks whether or not this Font has uniform line metrics. A
> > logical Font might be a composite font, which means that it is composed
> of
> > different physical fonts to cover different code ranges. Each of these
> fonts
> > might have different LineMetrics. If the logical Font is a single font
> then
> > the metrics would be uniform. ". Thus I find reasonable to return true
> for
> > physical fonts, as they are single.I assume that it is a non-bug
> difference
> > from RI.
> > Any thoughts on this issue?
> >
> > Regards,
> > Ilya.
> >
> >
> > On 9/13/06, Ilya Okomin (JIRA) < jira@apache.org> wrote:
> > >
> > > [classlib][awt]java.awt.Font.hasUniformLineMetrics() return true on
> > > Harmony while RI returns false
> > >
> > >
> --------------------------------------------------------------------------------------------------
>
> > >
> > >                 Key: HARMONY-1456
> > >                 URL: http://issues.apache.org/jira/browse/HARMONY-1456
> > >             Project: Harmony
> > >          Issue Type: Bug
> > >          Components: Non-bug differences from RI
> > >         Environment: Windows XP
> > >            Reporter: Ilya Okomin
> > >            Priority: Trivial
> > >
> > >
> > > According to the specification method must
> Font.hasUniformLineMetricsreturn true if this Font has uniform
> > > line metrics; false otherwise.
> > > RI returns false for physical font "Arial" while Harmony returns true.
>
> > > ====================test.java====================
> > > import java.awt.*;
> > >
> > > import junit.framework.TestCase;
> > >
> > > public class test extends TestCase {
> > >
> > >    public void testRun() {
> > >        final String name = "Arial";
> > >
> > >        Font f=new Font(name, Font.BOLD, 12);
> > >
> > >        // Check if created font is physical, it's family name
> > >        // is not logical and equals to the name parameter.
> > >        assertEquals(f.getFamily(), name);
> > >        assertTrue(f.hasUniformLineMetrics());
> > >    }
> > > }
> > > ===============================================
> > >
> > > Output:
> > > RI: java version "1.5.0"
> > > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> > > BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32,
> > > R25.0.0-75, GC: System optimized over throughput (initial strategy
> > > singleparpar))
> > >
> > > junit.framework.AssertionFailedError
> > >        at junit.framework.Assert.fail (Assert.java:47)
> > >        at junit.framework.Assert.assertTrue(Assert.java:20)
> > >        at junit.framework.Assert.assertTrue(Assert.java:27)
> > >        at test.testRun(Test9688.java:17)
> > >        at jrockit.reflect.VirtualNativeMethodInvoker.invoke(
> > > Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
> Source)
> > >        at java.lang.reflect.Method.invoke (Ljava.lang.Object;[
> > > Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
> > >        at junit.framework.TestCase.runTest(TestCase.java:154)
> > >        at junit.framework.TestCase.runBare(TestCase.java :127)
> > >        at junit.framework.TestResult$1.protect(TestResult.java:106)
> > >        at junit.framework.TestResult.runProtected(TestResult.java:124)
> > >        at junit.framework.TestResult.run (TestResult.java:109)
> > >        at junit.framework.TestCase.run(TestCase.java:118)
> > >        at junit.framework.TestSuite.runTest(TestSuite.java:208)
> > >        at junit.framework.TestSuite.run (TestSuite.java:203)
> > >        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > > RemoteTestRunner.java:478)
> > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (
> > > RemoteTestRunner.java:344)
> > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> > > RemoteTestRunner.java:196)
> > >
> > > Harmony: java version "1.5.0 "
> > > pre-alpha : not complete or compatible
> > > svn = r431938, (Aug 16 2006), Windows/ia32/msvc 1310, release build
> > > http://incubator.apache.org/harmony
> > >
> > > // test passed!
> > >
> > > I would suppose that it is RI bug, since spec says: " If the logical
> Font
> > > is a single font then the metrics would be uniform." In this case we
> have
> > > "Arial" font that is a single physical font on Windows platform and
> > > according to spec it has to have uniform metrics.
> > >
> > >
> > >
> > > --
> > > This message is automatically generated by JIRA.
> > > -
> > > If you think it was sent incorrectly contact one of the
> administrators:
> > > http://issues.apache.org/jira/secure/Administrators.jspa
> > > -
> > > For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> > >
> > >
> > >
> >
> >
> > --
> > --
> > Ilya Okomin
> > Intel Middleware Products Division
> >
> >
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
--
Ilya Okomin
Intel Middleware Products Division

Re: [jira] Created: (HARMONY-1456) [classlib][awt]java.awt.Font.hasUniformLineMetrics() return true on Harmony while RI returns false

Posted by Oleg Khaschansky <ol...@gmail.com>.
+1. BTW, I can't imagine the application that could be affected by
this difference.

On 9/19/06, Ilya Okomin <il...@gmail.com> wrote:
> Hi, community!
>
> I found for java.awt.Font.hasUniformLineMetrics() RI returns false for all
> fonts (physical/logical) while Harmony returns true for physical and false
> for logical.
> Spec says: "Checks whether or not this Font has uniform line metrics. A
> logical Font might be a composite font, which means that it is composed of
> different physical fonts to cover different code ranges. Each of these fonts
> might have different LineMetrics. If the logical Font is a single font then
> the metrics would be uniform. ". Thus I find reasonable to return true for
> physical fonts, as they are single.I assume that it is a non-bug difference
> from RI.
> Any thoughts on this issue?
>
> Regards,
> Ilya.
>
>
> On 9/13/06, Ilya Okomin (JIRA) <ji...@apache.org> wrote:
> >
> > [classlib][awt]java.awt.Font.hasUniformLineMetrics() return true on
> > Harmony while RI returns false
> >
> > --------------------------------------------------------------------------------------------------
> >
> >                 Key: HARMONY-1456
> >                 URL: http://issues.apache.org/jira/browse/HARMONY-1456
> >             Project: Harmony
> >          Issue Type: Bug
> >          Components: Non-bug differences from RI
> >         Environment: Windows XP
> >            Reporter: Ilya Okomin
> >            Priority: Trivial
> >
> >
> > According to the specification method must Font.hasUniformLineMetricsreturn true if this Font has uniform
> > line metrics; false otherwise.
> > RI returns false for physical font "Arial" while Harmony returns true.
> > ====================test.java====================
> > import java.awt.*;
> >
> > import junit.framework.TestCase;
> >
> > public class test extends TestCase {
> >
> >    public void testRun() {
> >        final String name = "Arial";
> >
> >        Font f=new Font(name, Font.BOLD, 12);
> >
> >        // Check if created font is physical, it's family name
> >        // is not logical and equals to the name parameter.
> >        assertEquals(f.getFamily(), name);
> >        assertTrue(f.hasUniformLineMetrics());
> >    }
> > }
> > ===============================================
> >
> > Output:
> > RI: java version "1.5.0"
> > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> > BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32,
> > R25.0.0-75, GC: System optimized over throughput (initial strategy
> > singleparpar))
> >
> > junit.framework.AssertionFailedError
> >        at junit.framework.Assert.fail(Assert.java:47)
> >        at junit.framework.Assert.assertTrue(Assert.java:20)
> >        at junit.framework.Assert.assertTrue(Assert.java:27)
> >        at test.testRun(Test9688.java:17)
> >        at jrockit.reflect.VirtualNativeMethodInvoker.invoke(
> > Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
> >        at java.lang.reflect.Method.invoke(Ljava.lang.Object;[
> > Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
> >        at junit.framework.TestCase.runTest(TestCase.java:154)
> >        at junit.framework.TestCase.runBare(TestCase.java:127)
> >        at junit.framework.TestResult$1.protect(TestResult.java:106)
> >        at junit.framework.TestResult.runProtected(TestResult.java:124)
> >        at junit.framework.TestResult.run(TestResult.java:109)
> >        at junit.framework.TestCase.run(TestCase.java:118)
> >        at junit.framework.TestSuite.runTest(TestSuite.java:208)
> >        at junit.framework.TestSuite.run(TestSuite.java:203)
> >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> > RemoteTestRunner.java:478)
> >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> > RemoteTestRunner.java:344)
> >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> > RemoteTestRunner.java:196)
> >
> > Harmony: java version "1.5.0"
> > pre-alpha : not complete or compatible
> > svn = r431938, (Aug 16 2006), Windows/ia32/msvc 1310, release build
> > http://incubator.apache.org/harmony
> >
> > // test passed!
> >
> > I would suppose that it is RI bug, since spec says: " If the logical Font
> > is a single font then the metrics would be uniform." In this case we have
> > "Arial" font that is a single physical font on Windows platform and
> > according to spec it has to have uniform metrics.
> >
> >
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > If you think it was sent incorrectly contact one of the administrators:
> > http://issues.apache.org/jira/secure/Administrators.jspa
> > -
> > For more information on JIRA, see: http://www.atlassian.com/software/jira
> >
> >
> >
>
>
> --
> --
> Ilya Okomin
> Intel Middleware Products Division
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org