[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#156115: X server generates bogus font names for scalable fonts



> No reply...
> 
> Could I please ask you to tell me whether you can reproduce the
> problem without Tk, i.e. what happens if you do
> 
>   xfd -fn '-adobe-helvetica-medium-r-normal--12-*-75-75-p-*-iso8859-1'
> 
> 
> If the problem is not reproducible with xfd, it's a Tk bug, not an X
> bug.  If it is reproducible with xfd, I will need the output of
> 
>   xlsfonts -ll -fn '-adobe-helvetica-medium-r-normal--12-*-75-75-p-*-iso8859-1'
> 
> Regards,
> 
>                                         Juliusz
> 

The problem can't be reproduced with your commands but the following
shows a problem similar to the one with Tk:

  xfd -fn `xlsfonts -fn "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso8859-1" | head -1`

The problem is that xserver generates fontnames with fixed size for Type1
scalable fonts and some (or all?) of these fonts look considerable worse
than the corresponding fixed size fonts:

  $ xlsfonts -fn "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso8859-1"
  -adobe-helvetica-medium-r-normal--12-116-75-75-p-0-iso8859-1
  -adobe-helvetica-medium-r-normal--12-116-75-75-p-0-iso8859-1
  -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
  -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
  $ xlsfonts -fn "-*-helvetica-medium-r-normal-*-*-120-*-*-*-*-iso8859-1"
  -adobe-helvetica-medium-r-normal--12-120-75-75-p-0-iso8859-1
  -adobe-helvetica-medium-r-normal--12-120-75-75-p-0-iso8859-1
  -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
  -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
  -adobe-helvetica-medium-r-normal--17-120-100-100-p-88-iso8859-1
  -adobe-helvetica-medium-r-normal--17-120-100-100-p-88-iso8859-1

Note that this happens only with certain sizes, for example a search
for Helvetica 16 returns only fixed fonts:

  $ xlsfonts -fn "-*-helvetica-medium-r-normal-*-16-*-*-*-*-*-iso8859-1"
  -adobe-helvetica-medium-r-normal--16-154-75-75-p-0-iso8859-1
  -adobe-helvetica-medium-r-normal--16-154-75-75-p-0-iso8859-1
  $ xlsfonts -fn "-*-helvetica-medium-r-normal-*-*-160-*-*-*-*-iso8859-1"
  -adobe-helvetica-medium-r-normal--17-160-75-75-p-0-iso8859-1
  -adobe-helvetica-medium-r-normal--17-160-75-75-p-0-iso8859-1

Can you explain why a search for Helvetica 12 returns a variable fixed
font while Helvetica 16 returns only fixed fonts?

The output of xlsfonts -ll with the two fonts gives the following result:

  $ xlsfonts -ll -fn '-adobe-helvetica-medium-r-normal--12-116-75-75-p-0-iso8859-1'
  name:  -adobe-helvetica-medium-r-normal--12-116-75-75-p-0-iso8859-1
  direction:            left to right
  indexing:             linear
  rows:                 0x00 thru 0x00 (0 thru 0)
  columns:              0x00 thru 0xff (0 thru 255)
  all chars exist:      no
  default char:         0x0000 (0)
  ascent:               11
  descent:              3
  font type:            Proportional (min and max widths not equal)
  bounds:               width left  right  asc  desc   attr   keysym
        min                2     0     0    -1    -7  0x00bf
        max               12     2    11    12     3  0x03f7
  properties:           24
      FOUNDRY               urw
      FAMILY_NAME           nimbus sans l
      WEIGHT_NAME           regular
      SLANT                 r
      SETWIDTH_NAME         normal
      ADD_STYLE_NAME        
      PIXEL_SIZE            12
      POINT_SIZE            116
      RESOLUTION_X          75
      RESOLUTION_Y          75
      SPACING               p
      AVERAGE_WIDTH         65
      CHARSET_REGISTRY      iso8859
      CHARSET_ENCODING      1
      FONT                  -urw-nimbus sans l-regular-r-normal--12-116-75-75-p-65-iso8859-1
      COPYRIGHT             (URW)++,Copyright 1999 by (URW)++ Design & Development. See the file COPYING (GNU General
se) for license conditions. As a special exception, permission is granted to include this font program in a Postscrip
 that consists of a document that contains text to be displayed or printed using this font, regardless of the conditi
e applying to the document itself.
      RAW_PIXEL_SIZE        1000
      RAW_POINT_SIZE        964
      RAW_ASCENT            953
      RAW_DESCENT           285
      RAW_AVERAGE_WIDTH     5435
      FACE_NAME             NimbusSanL-Regue
      FONT_TYPE             Type 1
      RASTERIZER_NAME       X Consortium Type 1 Rasterizer

  $ xlsfonts -ll -fn '-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1'
  name:  -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
  direction:            left to right
  indexing:             linear
  rows:                 0x00 thru 0x00 (0 thru 0)
  columns:              0x00 thru 0xff (0 thru 255)
  all chars exist:      no
  default char:         0x0000 (0)
  ascent:               11
  descent:              3
  font type:            Proportional (min and max widths not equal)
  bounds:               width left  right  asc  desc   attr   keysym
        min                2     0     1    -1    -8  0x0000
        max               12     1    11    12     3  0x0000
  properties:           27
      FOUNDRY               Adobe
      FAMILY_NAME           Helvetica
      WEIGHT_NAME           Medium
      SLANT                 R
      SETWIDTH_NAME         Normal
      ADD_STYLE_NAME        
      PIXEL_SIZE            12
      POINT_SIZE            120
      RESOLUTION_X          75
      RESOLUTION_Y          75
      SPACING               P
      AVERAGE_WIDTH         67
      CHARSET_REGISTRY      ISO8859
      CHARSET_ENCODING      1
      CAP_HEIGHT            9
      X_HEIGHT              7
      FACE_NAME             Helvetica
      COPYRIGHT             Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
      NOTICE                Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.  
      _DEC_DEVICE_FONTNAMES 225
      RELATIVE_SETWIDTH     50
      RELATIVE_WEIGHT       50
      FULL_NAME             Helvetica
      FONT                  -Adobe-Helvetica-Medium-R-Normal--12-120-75-75-P-67-ISO8859-1
      WEIGHT                10
      RESOLUTION            103
      QUAD_WIDTH            7

The problem happens only with some clients because it depends on the
algorithm used by the client for selecting the font. If one chooses
the first font of the list it will always get a scalable font which is
usually worse than a fixed font. Since I haven't found any documentation
about the algorithm for choosing a font I assume that all the fonts
returned are equivalent and I can use any of them. Tk happens to be
one of the clients which use a perfectly valid algorithm which gives
bad results only because the xserver lists bad quality fonts first.

In my opinion the error is that xserver generates non existing fixed
font names corresponding to variable fonts. Instead it should list only
fixed fonts at the required size and let the client decide if it wants
to try also variable fonts.

-- 
Massimo Dal Zotto <dz@debian.org>




Reply to: