Re: [R] plotmath "overstrikes" in output on a Linux system

From: Paul Johnson <pauljohn32_at_gmail.com>
Date: Tue, 08 Apr 2008 13:23:17 -0500

On Tue, Apr 8, 2008 at 4:29 AM, Prof Brian Ripley <ripley_at_stats.ox.ac.uk> wrote:

> Looks likes the the laptop is using different fonts with incorrect font
> metrics.  This could happen because it has a different screen resolution, or
> one of the systems is set to use scalable fonts or it is giving metrics for
> one fonts and using another or ....
>
>  BTW, this is probably nothing to do with plotmath per se -- the issue is
> most likely the device (presumably X11(), but you did not say) and its
> handling of font metric requests.  It looks to me as if the widths of normal
> text strings (and not symbols) is the problem.  I have seen something
> similar where there was a long-standing bug in plotmath (fixed in r44534),
> but this only manifested itself when text was kerned, which the X11() device
> in 2.6.2 does not ask for.
>
>  My best guess is that the font selected is (to use the technical terms)
> returning glyph widths without left/right bearings.
>
>  Please try 2.7.0 beta, which has a different X11() device (and the above
> bug fixed).  That ought to solve the problem for you, but otherwise you'll
> need to debug what the X11 metricInfo callback is giving you.
>
>

I installed R-latest from the beta directory. Following your leads, I've got some information that may help you see if this is purely an isolated X11 problem on my computer or something you might fix in R.

On screen, I see this bad looking plot:

http://pj.freefaculty.org/R/png-screenshot-notOK.png

Using a png device to write the graph to file, either with

dev.copy(png ... )

or

png (file = " ")
plot ( )
dev.off()

The saved file is GOOD:

http://pj.freefaculty.org/R/png-output-OK.png

http://pj.freefaculty.org/R/png_dev_copy_OK.png

More details about this laptop. The display has a native resolution of 1680x1050, and IF I put the X11 display at that resolution, then the on-screen X11 display of that particular graph is fine.

However, if I change the display to another value, the one I prefer is 1400x1050, and re-start, then I see the bad on-screen display. In both cases, however, I have confirmed that the DPI settings in xdpyinfo are correctly representing pixels/inches.

That leads me back to Prof. Ripley's suggestion that I've got a mismatch in fonts between what X11 really wants and what it gets. The font configuration on these systems is becoming so complicated I'm completely bewildered, as Fedora has both traditional linux font server and xft fonts and pango/cairo and freetype and apparently anything else they can think of. I'm going to keep studying the R admin guide to see how to debug it.

<off topic>

Finally, something came up that I don't want to forget. It is an RPM building question for R fans. This concerns my experience with R-beta-20080407.r45159. R built & installed without any apparent trouble, and I decided to try to make an RPM package of it so other Fedora people can test. I took the spec file from the existing Fedora 8 updates R package, and made a few changes to suit the new file name for R, and I built RPMS. The build proceeds without noticeable trouble, but when I try to install the RPM, I get this error

 $ sudo rpm -ivh R-2.7.20080407.r45159-1fc8.1.i386.rpm Password:
error: Failed dependencies:

        perl(R::Dcf) is needed by R-2.7.20080407.r45159-1fc8.1.i386
        perl(R::Logfile) is needed by R-2.7.20080407.r45159-1fc8.1.i386
        perl(R::Rd) is needed by R-2.7.20080407.r45159-1fc8.1.i386
        perl(R::Rdconv) is needed by R-2.7.20080407.r45159-1fc8.1.i386
        perl(R::Rdtools) is needed by R-2.7.20080407.r45159-1fc8.1.i386
        perl(R::Utils) is needed by R-2.7.20080407.r45159-1fc8.1.i386
        perl(R::Vars) is needed by R-2.7.20080407.r45159-1fc8.1.i386

As you can see, the package does have the perl modules, but something has gone wrong in the scripting process that takes note of them:

$ rpm -qilp R-2.7.20080407.r45159-1fc8.1.i386.rpm | grep perl
/usr/share/R/perl
/usr/share/R/perl/File
/usr/share/R/perl/File/Copy
/usr/share/R/perl/File/Copy/Recursive.pm
/usr/share/R/perl/R
/usr/share/R/perl/R/Dcf.pm
/usr/share/R/perl/R/Logfile.pm
/usr/share/R/perl/R/Rd.pm
/usr/share/R/perl/R/Rdconv.pm
/usr/share/R/perl/R/Rdlists.pm
/usr/share/R/perl/R/Rdtools.pm
/usr/share/R/perl/R/Utils.pm
/usr/share/R/perl/R/Vars.pm
/usr/share/R/perl/Text
/usr/share/R/perl/Text/DelimMatch.pm
/usr/share/R/perl/build-help-windows.pl
/usr/share/R/perl/build-help.pl
/usr/share/R/perl/massage-Examples.pl

I'm contacting the RPM maintainer from redhat to see if he knows. But if you know, please let me know.

-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 08 Apr 2008 - 18:29:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Apr 2008 - 18:30:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive