You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Chunrong Lai (JIRA)" <ji...@apache.org> on 2007/08/24 15:03:30 UTC

[jira] Updated: (HARMONY-4641) [classlib][awt][font] Harmony has problem with some fonts in Fedora

     [ https://issues.apache.org/jira/browse/HARMONY-4641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chunrong Lai updated HARMONY-4641:
----------------------------------

    Attachment: H4641.println.workaround.patch
                H4641.fixed.patch

  
  The patch H4641.fixed.patch fixes the issue.
  The patch H4641.println.workaround.patch is actually not directly related with HARMONY-4641 but it enables the Fedora to display Chinese by println. However we may have better design for that.

> [classlib][awt][font] Harmony has problem with some fonts in Fedora
> -------------------------------------------------------------------
>
>                 Key: HARMONY-4641
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4641
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Linux32(Fedora)
>            Reporter: Chunrong Lai
>         Attachments: H4641.fixed.patch, H4641.println.workaround.patch
>
>
> This issue does not happen in Win32.
> Here's the simple test demonstrating the problem, one needs to copy simsun.ttc from windows to /usr/share/fonts/simsun.ttf before run it:
> import javax.swing.JFrame;
> import javax.swing.JLabel;
> import java.awt.*;
> public class Test {
>     public static void main(String argv[]) {
>         JFrame frame = new JFrame("test");
>         JLabel label = new JLabel("Hello World");
>         final GraphicsEnvironment g = GraphicsEnvironment.getLocalGraphicsEnvironment();
>         final String[] fonts = g.getAvailableFontFamilyNames();
>         for (int i = 0; i < fonts.length; i ++) {
>            System.out.println("Font " + i + ": " + fonts[i]);
>         }
>         label.setFont(new Font("SimSun", Font.PLAIN, 32));
>         
>         frame.add(label);
>         frame.pack();
>         frame.setVisible(true);
>     }
> }
> Other VMs are OK with this example but Harmony crashes with below StackTrace
> SIGSEGV in VM code.
> Stack trace:
>   0: ?? (??:-1)
>   1: ?? (??:-1)
>   2: Java_org_apache_harmony_awt_gl_font_LinuxNativeFont_drawStringNative (/home/clai1/harmony.0723/trunk/working_classlib/modules/awt/src/main/native/linuxfont/unix/LinuxNativeFont.c:1496)
>   3: 0x063DFAF4  <Generated stub>
>   4: org/apache/harmony/awt/gl/linux/DrawableTextRenderer.drawNormalString(Lorg/apache/harmony/awt/gl/CommonGraphics2D;Ljava/lang/String;DD)V (DrawableTextRenderer.java:132)
>   5: org/apache/harmony/awt/gl/linux/DrawableTextRenderer.drawString(Ljava/awt/Graphics2D;Ljava/lang/String;FF)V (DrawableTextRenderer.java:63)
>   6: org/apache/harmony/awt/gl/linux/XGraphics2D.drawString(Ljava/lang/String;FF)V (XGraphics2D.java:556)
>   7: org/apache/harmony/awt/gl/CommonGraphics2D.drawString(Ljava/lang/String;II)V (CommonGraphics2D.java:654)
>   8: javax/swing/plaf/basic/BasicGraphicsUtils.drawStringUnderlineCharAt(Ljava/awt/Graphics;Ljava/lang/String;III)V (BasicGraphicsUtils.java:144)
>   9: org/apache/harmony/x/swing/Utilities.drawString(Ljava/awt/Graphics;Ljava/lang/String;IILjava/awt/FontMetrics;Ljava/awt/Color;I)V (Utilities.java:503)
>  10: javax/swing/plaf/basic/BasicLabelUI.paintEnabledText(Ljavax/swing/JLabel;Ljava/awt/Graphics;Ljava/lang/String;II)V (BasicLabelUI.java:133)
>  11: javax/swing/plaf/basic/BasicLabelUI.paint(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V (BasicLabelUI.java:99)
>  12: javax/swing/plaf/ComponentUI.update(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V (ComponentUI.java:38)
>  13: javax/swing/JComponent.paintComponent(Ljava/awt/Graphics;)V (JComponent.java:897)
>   It is also noticed that Harmony returns much less fonts from getAvailableFontFamilyNames(), compared to other VMs.
>   There are other fonts also have this issue, for example, AR PL ShanHeiSun Uni, PMingLiu, etc. We also notice that some fonts would be OK for such unage, Tahoma is such example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.