{"id":112,"date":"2008-05-22T15:53:34","date_gmt":"2008-05-22T14:53:34","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=112"},"modified":"2008-05-29T10:53:55","modified_gmt":"2008-05-29T09:53:55","slug":"mathematica-font-bug-in-ubuntu-804-hardy-heron","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=112","title":{"rendered":"Mathematica font bug in Ubuntu 8.04 (Hardy Heron)"},"content":{"rendered":"<p>I recently upgraded my Ubuntu installation from 7.10 to 8.04 and almost immediately ran into problems when trying to run Mathematica 6.0.2 &#8211; all of the fonts are not rendering properly.  In addition, if I run mathematica from a console window I get error messages like<\/p>\n<p>X Error of failed request:  RenderBadPicture (invalid Picture parameter)<br \/>\nMajor opcode of failed request:  158 (RENDER)<br \/>\nMinor opcode of failed request:  7 (RenderFreePicture)<br \/>\nPicture id in failed request: 0x440189f<br \/>\nSerial number of failed request:  69419<br \/>\nCurrent serial number in output stream:  69420<\/p>\n<p>X Error of failed request:  BadMatch (invalid parameter attributes)<br \/>\nMajor opcode of failed request:  158 (RENDER)<br \/>\nMinor opcode of failed request:  4 (RenderCreatePicture)<br \/>\nSerial number of failed request:  71071<br \/>\nCurrent serial number in output stream:  71074<\/p>\n<p>The following screenshot shows the problem &#8211; you cannot see anything you type apart from a few symbols such as [] and {} .<\/p>\n<p style=\"text-align: center\" align=\"right\"><img decoding=\"async\" src=\"\/images\/mathematica\/font_bug.png\" \/><\/p>\n<p>Other people have come across this problem and workarounds have been identified.  The first is to run Mathematica from a console prompt as follows<\/p>\n<p><strong>mathematica -defaultvisual<\/strong><\/p>\n<p>This allows you to see what you are doing but is a big ugly.  Another workaround is to install libqt4-core and libqt4-gui by doing<\/p>\n<p><strong>sudo apt-get install libqt4-core libqt4-gui<\/strong><\/p>\n<p>and then rename a couple of files in the Mathematica distribution as follows<\/p>\n<p><strong>sudo mv \/usr\/local\/Wolfram\/Mathematica\/6.0\/SystemFiles\/Libraries\/Linux\/libQtCore.so.4  \/usr\/local\/Wolfram\/Mathematica\/6.0\/SystemFiles\/Libraries\/Linux\/libQtCore.so.4.old<\/strong><\/p>\n<p><strong>sudo mv \/usr\/local\/Wolfram\/Mathematica\/6.0\/SystemFiles\/Libraries\/Linux\/libQtGui.so.4  \/usr\/local\/Wolfram\/Mathematica\/6.0\/SystemFiles\/Libraries\/Linux\/libQtGui.so.4.old<\/strong><\/p>\n<p>This fixes the problem but you may get two extra blank windows appear when you run Mathematica.  To fix this open up the Option Inspector in Mathematica as follows:<\/p>\n<p><strong>Edit<\/strong>-&gt;<strong> Preferences<\/strong> and click on <strong>Open Option Inspector<\/strong><\/p>\n<p>When in the Option Inspector click on <strong>Notebook Options <\/strong>and then <strong>Window Properties<\/strong> and change the <strong>WindowFrame<\/strong> option from &#8220;Normal&#8221; to &#8220;Generic&#8221; then click on Apply<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"\/images\/mathematica\/nullwinfix.png\" \/><\/p>\n<p>A big thank you to the<a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+bug\/197163\"> people in this thread<\/a> on launchpad.net for developing all of these workarounds.  I will be reporting these problems to Wolfram&#8217;s tech support as soon as I have finished writing this.<\/p>\n<p><strong>Update: 28 May 2008<\/strong><\/p>\n<p>Someone from Wolfram responded to these issues in <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+bug\/197163\">this thread<\/a>.  For anyone who has googled themselves here I have copied and pasted his response below:<\/p>\n<p><em>Note &#8211; this is not an &#8220;official&#8221; Wolfram response, I just wanted to let you all know we&#8217;re aware of the issues&#8230;<\/em><\/p>\n<p><em>With that in mind, a few comments:<\/em><\/p>\n<p><em>The original error messages are due to X11 providing an incorrect visual buffer to draw on &#8211; the &#8216;export XLIB_SKIP_<\/em><wbr><\/wbr><em>ARBG_VISUALS=<\/em><wbr><\/wbr><em>1&#8242; command tells X to discard any composite visuals (which is what compiz and the like uses to do window effects) when we request a new visual. The reason we are getting a bad visual is complicated, but should be resolved by the next major release of Mathematica.<\/em><\/p>\n<p><em>The extra windows are supposed to be hidden, and will go back into hiding with 6.0.3 (coming very soon).<\/em><\/p>\n<p><em>The font rendering issues are related to Hardy&#8217;s lack of some fonts we normally assume to be installed by default, namely a decent Courier and Times fonts. Some adjustments were made for 6.0.3, but if these do not resolve your issues, you may want to adjust the substitution rules (Option Inspector-&gt;Global Options-&gt;Menu Settings-<\/em><wbr><\/wbr><em>&gt;FontSubstituti<\/em><wbr><\/wbr><em>ons) to point to fonts installed on your system.<\/em><\/p>\n<p><em>On deleting\/replacing libQt* &#8211; this is not recommended, as we ship a commercial version of the Qt library, which can potentially differ from the open source version. If it works for now, that&#8217;s fortunate, but I would not consider that a permanent fix. We will be updating our shipping version of Qt with our next major release, most likely from the Qt 4 .3 version tree, as 4.4 is causing some compatibility issues (the above mentioned QObject warnings)<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently upgraded my Ubuntu installation from 7.10 to 8.04 and almost immediately ran into problems when trying to run Mathematica 6.0.2 &#8211; all of the fonts are not rendering properly. In addition, if I run mathematica from a console window I get error messages like X Error of failed request: RenderBadPicture (invalid Picture parameter) [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[],"class_list":["post-112","post","type-post","status-publish","format-standard","hentry","category-math-software","category-mathematica"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-1O","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":0,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}