You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sergey Dmitriev (JIRA)" <ji...@apache.org> on 2007/04/22 18:13:15 UTC
[jira] Created: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Graphics.getFontMetrics() throws HeadlessExcetion if headless
-------------------------------------------------------------
Key: HARMONY-3719
URL: https://issues.apache.org/jira/browse/HARMONY-3719
Project: Harmony
Issue Type: Bug
Components: Classlib
Environment: Linux
Reporter: Sergey Dmitriev
java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
] bob@moon ~
] cat getfontmetrics.java
import java.awt.*;
import java.awt.image.*;
public class getfontmetrics {
public static void main(String args[]) throws Exception {
BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
FontMetrics fm = g.getFontMetrics();
System.out.println("font metrics: " + fm);
}
}
] bob@moon ~
] java -showversion -Djava.awt.headless=true getfontmetrics
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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
] bob@moon ~
] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
http://incubator.apache.org/harmony
Uncaught exception in main:
java.awt.HeadlessException
at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
at java.awt.Graphics.getFontMetrics(Unknown Source)
at getfontmetrics.main(getfontmetrics.java)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Petrenko closed HARMONY-3719.
------------------------------------
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
> Assignee: Alexey Petrenko
> Attachments: H-3719.patch
>
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Sergey Dmitriev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506863 ]
Sergey Dmitriev commented on HARMONY-3719:
------------------------------------------
Have you tried "java getfontmetrics" on your side? Actually it does fail this way:
] guy@sun ~
] ~/jre/bin/java -showversion getfontmetrics
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r549111, (Jun 21 2007), Linux/ia32/gcc 3.3.3, debug build
http://harmony.apache.org
Uncaught exception in AWT-NativeEventThread:
Uncaught exception in AWT-EventDispatchThread:
Uncaught exception in main:
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Nikolay Viskov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506862 ]
Nikolay Viskov commented on HARMONY-3719:
-----------------------------------------
It should work since FontLibrary contribution has been applied.
Please verify.
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Petrenko updated HARMONY-3719:
-------------------------------------
Patch Info: [Patch Available]
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
> Assignee: Alexey Petrenko
> Attachments: H-3719.patch
>
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Sergey Dmitriev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508524 ]
Sergey Dmitriev commented on HARMONY-3719:
------------------------------------------
And here is non-headless variant:
] boy@room ~
] ~/jre/bin/java getfontmetrics
font metrics: org.apache.harmony.awt.gl.font.FontMetricsImpl[font=java.awt.Font[family=Default,name=Dialog,style=plain,size=12]ascent=10, descent=4, height=15]
] boy@room ~
] echo $DISPLAY
:7
] boy@room ~
]
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Sergey Dmitriev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516466 ]
Sergey Dmitriev commented on HARMONY-3719:
------------------------------------------
I confirm.
java -Djava.awt.headless=true -showversion getfontmetrics
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r555193, (Jul 11 2007), Linux/ia32/gcc 3.4.2, release build
http://harmony.apache.org
font metrics: org.apache.harmony.awt.gl.font.FontMetricsImpl[font=java.awt.Font[family=Luxi Sans,name=Dialog,style=plain,size=12]ascent=8, descent=2, height=13]
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
> Assignee: Alexey Petrenko
> Attachments: H-3719.patch
>
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Nikolay Viskov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506887 ]
Nikolay Viskov commented on HARMONY-3719:
-----------------------------------------
yepp it is known bug,
it occurs because on your machine fontlib does not find needed fonts, now it is discussed in "[classlib][awt] Default fonts needed for headless support (was Re:[contributions][awt] Font library)" topic on dev.
Please, try to create a directory jre/lib/fonts and to add there font "Courier" plain (it is a default font at present) or any another, having changed the name in org\apache\harmony\awt\gl\font\fontmanager.java
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Petrenko resolved HARMONY-3719.
--------------------------------------
Resolution: Fixed
The patch has been applied.
Please verify.
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
> Assignee: Alexey Petrenko
> Attachments: H-3719.patch
>
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Nikolay Viskov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nikolay Viskov updated HARMONY-3719:
------------------------------------
Attachment: H-3719.patch
patch added,
FontsMetrics now are cached in ToolkitImpl instead of GraphicsFactory
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
> Attachments: H-3719.patch
>
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Sergey Dmitriev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509850 ]
Sergey Dmitriev commented on HARMONY-3719:
------------------------------------------
As I can see r551077 with the given patch does work on getfontmetrics test:
] boy@moon ~
] ~/jre/bin/java -version
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r551077, (Jul 3 2007), Linux/ia32/gcc 3.3.3, release build
http://harmony.apache.org
] boy@moon ~
] ~/jre/bin/java -Djava.awt.headless=true getfontmetrics
font metrics: org.apache.harmony.awt.gl.font.FontMetricsImpl[font=java.awt.Font[family=Luxi Sans,name=Dialog,style=plain,size=12]ascent=8, descent=2, height=13]
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
> Assignee: Alexey Petrenko
> Attachments: H-3719.patch
>
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Petrenko reassigned HARMONY-3719:
----------------------------------------
Assignee: Alexey Petrenko
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
> Assignee: Alexey Petrenko
> Attachments: H-3719.patch
>
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-3719) Graphics.getFontMetrics() throws
HeadlessExcetion if headless
Posted by "Sergey Dmitriev (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-3719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508523 ]
Sergey Dmitriev commented on HARMONY-3719:
------------------------------------------
Ok, thanks for the info. Here is what I have:
] boy@room ~
] ~/jre/bin/java -version
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r550333, (Jun 27 2007), Linux/ia32/gcc 3.3.3, release build
http://harmony.apache.org
] boy@room ~
] ls -la ~/jre/lib/fonts/
total 644
drwxrwxrwx 2 boy boys 4096 2007-06-27 16:32 .
drwxrwxrwx 6 boy boys 4096 2007-06-27 16:31 ..
-rw-r--r-- 1 boy boys 29887 2007-06-27 16:32 cour.afm
-rw-r--r-- 1 boy boys 29815 2007-06-27 16:32 courb.afm
-rw-r--r-- 1 boy boys 29979 2007-06-27 16:32 courbi.afm
-rw-r--r-- 1 boy boys 125201 2007-06-27 16:32 courbi.pfa
-rw-r--r-- 1 boy boys 126868 2007-06-27 16:32 courb.pfa
-rw-r--r-- 1 boy boys 30032 2007-06-27 16:32 couri.afm
-rw-r--r-- 1 boy boys 122124 2007-06-27 16:32 couri.pfa
-rw-r--r-- 1 boy boys 126064 2007-06-27 16:32 cour.pfa
] boy@room ~
] ~/jre/bin/java -Djava.awt.headless=true getfontmetrics
Uncaught exception in main:
java.awt.HeadlessException
at java.awt.HeadlessToolkit.getGraphicsFactory(HeadlessToolkit.java:171)
at java.awt.ToolkitImpl.getFontMetrics(ToolkitImpl.java:135)
at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(CommonGraphics2D.java:833)
at java.awt.Graphics.getFontMetrics(Graphics.java:151)
at getfontmetrics.main(getfontmetrics.java:8)
] boy@room ~
]
> Graphics.getFontMetrics() throws HeadlessExcetion if headless
> -------------------------------------------------------------
>
> Key: HARMONY-3719
> URL: https://issues.apache.org/jira/browse/HARMONY-3719
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Linux
> Reporter: Sergey Dmitriev
>
> java.awt.Graphics.getFontMetrics() throws HeadlessException in headless mode.
> ] bob@moon ~
> ] cat getfontmetrics.java
> import java.awt.*;
> import java.awt.image.*;
>
> public class getfontmetrics {
> public static void main(String args[]) throws Exception {
> BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
> Graphics g = image.getGraphics();
> FontMetrics fm = g.getFontMetrics();
> System.out.println("font metrics: " + fm);
> }
> }
>
> ] bob@moon ~
> ] java -showversion -Djava.awt.headless=true getfontmetrics
> 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-linux-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar))
>
> font metrics: sun.font.FontDesignMetrics[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12]ascent=12, descent=3, height=15]
>
> ] bob@moon ~
> ] ~/jre/bin/java -showversion -Djava.awt.headless=true getfontmetrics
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r531171, (Apr 22 2007), Linux/ia32/gcc 3.3.3, release build
> http://incubator.apache.org/harmony
> Uncaught exception in main:
> java.awt.HeadlessException
> at java.awt.HeadlessToolkit.getGraphicsFactory(Unknown Source)
> at java.awt.ToolkitImpl.getFontMetrics(Unknown Source)
> at org.apache.harmony.awt.gl.CommonGraphics2D.getFontMetrics(Unknown Source)
> at java.awt.Graphics.getFontMetrics(Unknown Source)
> at getfontmetrics.main(getfontmetrics.java)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.