[cairo-bugs] [Bug 5200] New: Incorrect text rendering when in x86 64-bit precision mode

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Nov 29 20:51:41 PST 2005


Please do not reply to this email: if you want to comment on the bug, go to    
       
the URL shown below and enter yourcomments there.     
   
https://bugs.freedesktop.org/show_bug.cgi?id=5200          
     
           Summary: Incorrect text rendering when in x86 64-bit precision
                    mode
           Product: cairo
           Version: 1.0.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: cworth at cworth.org
        ReportedBy: billy.biggs at gmail.com
         QAContact: cairo-bugs at cairographics.org


The Java virtual machines from Sun and IBM put the FPU into 64-bit mode rather
than Linux's default 80-bit mode.  For a little background on this, see:

  http://www.srware.com/linux_numerics.txt

When in this mode, a bunch of weird rendering issues appear in text of GTK+ 2.8
applications.  The easiest way to see this is to watch the underlined characters
in menus.  The GTK+ application below reproduces the problem when using a font
of "Arial 9" at 96-DPI.  This bug should also occur under other OSs that use
64-bit precision by default, such as FreeBSD, on other architectures such as
PPC, and probably also when compiling cairo using -mfp-math=sse.  However, I
have not verified any of those configurations.

#include <string.h>
#include <gtk/gtk.h>
#include <fpu_control.h>

int main (int argc, char **argv)
{
    GtkWidget *window, *menu, *vbox, *item, *bar;
    fpu_control_t fpu_control;

    _FPU_GETCW (fpu_control);
    fpu_control &= ~_FPU_EXTENDED;
    fpu_control |= _FPU_DOUBLE;
    _FPU_SETCW (fpu_control);

    gtk_init (&argc, &argv);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    g_signal_connect (G_OBJECT (window), "destroy",
                      G_CALLBACK (gtk_main_quit), NULL);
    vbox = gtk_vbox_new (0, FALSE);
    gtk_container_add (GTK_CONTAINER (window), vbox);
    bar = gtk_menu_bar_new ();
    gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0);
    item = gtk_menu_item_new_with_mnemonic ("_File");
    gtk_menu_shell_insert (GTK_MENU_SHELL (bar), item, 0);
    menu = gtk_menu_new ();
    gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu);
    item = gtk_menu_item_new_with_mnemonic ("Open _Type...");
    gtk_container_add (GTK_CONTAINER (menu), item);
    item = gtk_menu_item_new_with_mnemonic ("Open Reso_urce...");
    gtk_container_add (GTK_CONTAINER (menu), item);
    item = gtk_menu_item_new_with_mnemonic ("Sho_w In");
    gtk_container_add (GTK_CONTAINER (menu), item);
    item = gtk_menu_item_new_with_mnemonic ("Ne_xt");
    gtk_container_add (GTK_CONTAINER (menu), item);
    item = gtk_menu_item_new_with_mnemonic ("Pre_vious");
    gtk_container_add (GTK_CONTAINER (menu), item);
    gtk_widget_show_all (window);
    gtk_main ();
    return 0;
}

This problem is not reproducable under GTK+ 2.6 and it smells a lot like a cairo
problem.          
     
     
--           
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email         
     
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the cairo-bugs mailing list