[R] Font problem

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Dec 9 16:40:14 CET 2003


Marc Schwartz <MSchwartz at MedAnalytics.com> writes:

> It may be as simple as being sure that both the 75 dpi and 100 dpi fonts
> are loaded as the SUSE query earlier this year seemed to indicate that
> the 100 dpi fonts were not installed initially.

I actually wrote the bug so I'm supposed to know what it is about....
It is just that it was so difficult to write that I have been
reluctant to try and fix it.

The exact issue is that the X11 driver jumps through a few hoops to
help you get the real Adobe-designed fonts rather that some ugly
rescaled ones. These exist in pixel sizes

8,10,11,12,14,17,18,20,24,25,34 

(of which 10/11 and 24/25 are actually identical).

If you use unscaled fonts, the logic inside RLoadFont will try to give
you one of the above, by choosing the one closest to the one you
specified. If you request a 22 pixel font, the system will load the 20
pixel font. The catch is that e.g. the 20 pixel font only exists in
100 dpi

blueberry:~/>xlsfonts -fn '-adobe-helvetica-medium-r-*-*-20-*-*-*-*-*-*-*'
-adobe-helvetica-medium-r-normal--20-140-100-100-p-100-iso10646-1
-adobe-helvetica-medium-r-normal--20-140-100-100-p-100-iso8859-1

(actually, on my machine, only the 12 pixel version exists in both 100
and 75 dpi).

I.e. if you use unscaled fonts, you need to have both dpi sets
installed. With scaled fonts you don't run into this issue, but some
screen fonts may (will!) be ugly. Of course the default SuSE install
gives you only one dpi set, unscaled.

The bug is that there is a gap in the font-substitution logic so that
if you have only one set of fonts, then RLoadFont may end up returning
NULL, rather than the "fixed" font or a suitable fallback size.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list